Multi-gateway-based terminal matching method and device, electronic equipment and medium

CN122994846APending Publication Date: 2026-10-27SHENZHEN MINEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611122555.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0010]本申请实施例中,预先设置有第一预设接口和第二预设接口,通过第一预设接口,可以直接获取各终端设备与各网关设备之间的信号质量信息,通过第二预设接口,可以直接获取网关设备的负载状态信息,实现对外部监测数据的有效获取。根据各终端设备与各网关设备之间的信号质量信息,对各终端设备进行排序,得到终端分配顺序信息,便于后续以终端为导向进行网关分配。按照终端分配顺序信息,根据各终端设备与各网关设备之间的信号质量信息、以及各网关设备的负载状态信息,确定与终端设备匹配的网关设备,即得到终端匹配信息。通过结合信号质量和负载状态,提高终端设备与网关设备之间的匹配精度,进而提高后续的任务执行效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994846A_ABST
    Figure CN122994846A_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of Internet of Things communication, and provides a terminal matching method and device based on multiple gateways, electronic equipment and medium, which comprises the following steps: for each terminal device, acquiring signal quality information between the terminal device and each gateway device through a first preset interface; for each gateway device, acquiring load state information of the gateway device through a second preset interface; the signal quality information represents a signal quality score between the terminal device and the gateway device; determining terminal allocation sequence information according to the signal quality information between each terminal device and each gateway device; the terminal allocation sequence information represents an arrangement sequence between each terminal device when the terminal device is allocated to the gateway device; determining terminal matching information according to the terminal allocation sequence information, the signal quality information between each terminal device and each gateway device, and the load state information of each gateway device; and the terminal matching information represents a matching relationship between the gateway device and the terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of Internet of Things (IoT) communication technology, and in particular relates to a terminal matching method, device, electronic device and medium based on multiple gateways. Background Technology

[0002] In large-scale wireless IoT systems, multiple gateway devices are typically required to cover the entire application scenario and manage and transmit data to thousands or even tens of thousands of terminal devices.

[0003] Different gateway devices can be matched with different terminal devices, and the coordinated scheduling among multiple gateways can determine the overall system performance, transmission reliability, and resource utilization. How to allocate the optimal gateway device to each terminal device is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] This application provides a terminal matching method, apparatus, electronic device, and medium based on multiple gateways, which can improve the matching accuracy between terminal devices and gateway devices, thereby improving task scheduling efficiency.

[0005] In a first aspect, embodiments of this application provide a terminal matching method based on multiple gateways, including: For each terminal device, signal quality information between the terminal device and each gateway device is obtained through a first preset interface, and for each gateway device, load status information of the gateway device is obtained through a second preset interface; wherein, the signal quality information represents a score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. Based on the signal quality information between each terminal device and each gateway device, the terminal allocation order information is determined; wherein, the terminal allocation order information represents the order in which the terminal devices are arranged when allocating gateway devices to the terminal devices; Based on the terminal allocation order information, the signal quality information between each terminal device and each gateway device, and the load status information of each gateway device, terminal matching information is determined; wherein, the terminal matching information represents the matching relationship between the gateway device and the terminal device.

[0006] Secondly, embodiments of this application provide a terminal matching device based on multiple gateways, comprising: The information acquisition module is used to acquire signal quality information between the terminal device and each gateway device through a first preset interface for each terminal device, and to acquire load status information of the gateway device through a second preset interface for each gateway device; wherein, the signal quality information represents a score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. The sequence determination module is used to determine the terminal allocation sequence information based on the signal quality information between each terminal device and each gateway device; wherein, the terminal allocation sequence information represents the arrangement order of each terminal device when allocating gateway devices to the terminal devices; The terminal matching module is used to determine terminal matching information based on the terminal allocation order information, the signal quality information between each terminal device and each gateway device, and the load status information of each gateway device; wherein, the terminal matching information represents the matching relationship between the gateway device and the terminal device.

[0007] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the method described in the first aspect above.

[0010] In this embodiment, a first preset interface and a second preset interface are pre-configured. The first preset interface allows direct acquisition of signal quality information between each terminal device and each gateway device, while the second preset interface allows direct acquisition of the load status information of the gateway devices, thus enabling effective acquisition of external monitoring data. Based on the signal quality information between each terminal device and each gateway device, the terminal devices are sorted to obtain terminal allocation order information, facilitating subsequent gateway allocation based on the terminal. According to the terminal allocation order information, and based on the signal quality information between each terminal device and each gateway device, as well as the load status information of each gateway device, the gateway device matching the terminal device is determined, thus obtaining terminal matching information. By combining signal quality and load status, the matching accuracy between terminal devices and gateway devices is improved, thereby increasing the efficiency of subsequent task execution. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.

[0012] Figure 1 This is a flowchart illustrating the terminal matching method based on multiple gateways provided in an embodiment of this application; Figure 2 This is a schematic diagram of the first preset interface provided in an embodiment of this application; Figure 3 This is a schematic diagram of a terminal matching system based on multiple gateways provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the terminal matching method based on multiple gateways provided in an embodiment of this application; Figure 5 This is a flowchart illustrating the terminal matching method based on multiple gateways provided in an embodiment of this application; Figure 6 This is a flowchart illustrating the terminal matching method based on multiple gateways provided in an embodiment of this application; Figure 7 This is a flowchart illustrating the terminal matching method based on multiple gateways provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of the terminal matching device based on multiple gateways provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0013] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0014] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0015] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0016] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0017] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0018] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0019] The terminal matching method based on multiple gateways provided in this application can be applied to terminal devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of terminal device.

[0020] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application are explained, and the nouns and terms used in the embodiments of this application shall be interpreted as follows: Terminal devices: These refer to IoT terminal devices, which are the underlying hardware that directly collects data from the physical world, performs local control, and connects to the IoT platform via the network. They are the core carriers of the IoT's sensing and execution layers, and can be, for example, electronic tags.

[0021] Received Signal Strength Indicator (RSSI) is a common RF signal quality assessment metric that measures the power intensity of the received signal to determine the quality of link communication.

[0022] Link Quality Indicator (LQI) is a signal quality assessment metric based on the link layer bit error rate, directly reflecting the reliability of data transmission.

[0023] Channel State Information (CSI) is a set of detailed wireless channel measurement parameters that reflect channel characteristics such as multipath and fading, and are used for high-precision signal quality assessment.

[0024] Bluetooth Channel Sounding (CS) can reflect information such as fading, multipath propagation, interference distribution, and latency.

[0025] In large-scale wireless IoT systems, multiple gateway devices are typically deployed to cover the entire application scenario, enabling the management and data transmission of thousands or even tens of thousands of terminal devices. Multi-gateway collaborative scheduling algorithms are the core technology determining the overall system performance, transmission reliability, and resource utilization.

[0026] Currently, IoT systems generally adopt a two-level scheduling architecture: 1. Global task priority scheduling: Tasks are sorted according to their urgency and importance, with high-priority tasks (such as emergency alarms and equipment control commands) being executed first. 2. Terminal scheduling within a single task: Within batch tasks of the same priority, the terminal devices that need to be processed are sorted and allocated.

[0027] Currently, the "task-oriented" scheduling mode is commonly and consistently used within a single task. This mode allocates resources based on the task itself, prioritizing tasks corresponding to terminal devices with good signals and fast transmission speeds, or randomly distributing tasks evenly to various gateway devices without considering the signal quality between the terminal and the gateway.

[0028] However, regardless of the task-oriented mode used, terminals with poor signal strength cannot obtain the optimal gateway service that matches them. For example, in the priority processing mode, terminals with poor signal strength are processed last, by which time the optimal gateway matching them has already been occupied; in the average allocation mode, terminals with poor signal strength are randomly assigned and are unlikely to be assigned to the optimal gateway matching them, ultimately leading to a further increase in transmission time and a communication success rate that remains below 60% for a long time, forming the so-called "starvation of weak signal terminals" phenomenon.

[0029] Furthermore, in the priority processing mode, terminals with poor signal have long transmission and processing times. The task-oriented mode concentrates them for final processing or randomly distributes them for processing, resulting in a large amount of idle time for the gateway during the terminal processing stage, causing a waste of resources. In the average distribution mode, terminals with poor signal can only be matched with gateways that are not optimally matched with them, further reducing the transmission speed and creating a vicious cycle.

[0030] This embodiment relates to the fields of wireless communication and Internet of Things (IoT) technology. It breaks the industry's technical bias of faster task-oriented models, greatly shortens task transmission time and overall task execution time, and significantly improves the compatibility, reliability and operating efficiency of multi-gateway systems.

[0031] General Description of Embodiments in this Application According to one embodiment of this application, a terminal matching method based on multiple gateways is provided, which is applicable to all large-scale wireless Internet of Things systems, such as electronic price tags, electronic billboards, smart homes, and other scenarios.

[0032] Figure 1 This is a flowchart illustrating a multi-gateway-based terminal matching method, as shown below. Figure 1 As shown, a terminal matching method based on multiple gateways according to one embodiment of this application may include: Step 110: For each terminal device, obtain signal quality information between the terminal device and each gateway device through the first preset interface, and for each gateway device, obtain load status information of the gateway device through the second preset interface; wherein, the signal quality information represents the score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. Step 120: Determine the terminal allocation order information based on the signal quality information between each terminal device and each gateway device; wherein, the terminal allocation order information represents the order in which each terminal device is arranged when allocating gateway devices to the terminal devices; Step 130: Determine terminal matching information based on terminal allocation order information, signal quality information between each terminal device and each gateway device, and load status information of each gateway device; wherein, terminal matching information represents the matching relationship between gateway devices and terminal devices.

[0033] Steps 110-130 are described in detail below.

[0034] In step 110, a first preset interface and a second preset interface are pre-set. The first preset interface is a standardized signal quality unified interface, which is the agreed data interaction specification between the terminal matching system and the underlying signal quality assessment module in this embodiment. This interface is not bound to any particular signal quality acquisition hardware and computing logic. Its core function is to uniformly shield the differences in data format, units, and output structure of different signal quality assessment modules, providing the terminal matching process with uniformly formatted and universally readable signal quality information. This achieves complete decoupling between the terminal matching logic and the underlying signal assessment technology, allowing any signal quality assessment module to access the entire matching process simply by adapting to this interface specification.

[0035] In other words, the first preset interface is a signal quality acquisition interface, used by the terminal matching system to query the latest signal quality data between any terminal device and any gateway device. When acquiring signal quality information, input parameters can include `terminal_id` and `gateway_id`, where `terminal_id` is the unique identifier of the terminal device, and `gateway_id` is the unique identifier of the gateway device. The return value of the first preset interface can include `signal_quality`, `confidence`, and `update_time`. `signal_quality` represents the signal quality information between the terminal device and the gateway device, and the signal quality information is a value within a standardized range, for example, a value between 0 and 100. `confidence` is the confidence level of the signal quality assessment result, and `update_time` is the timestamp of the generation of the signal quality assessment result.

[0036] Regardless of whether the underlying signal quality assessment module uses RSSI, LQI, CSI, CS channel probing, or any other assessment technique, it must return data in a pre-defined, uniform format. The first pre-defined interface can be implemented using any method, such as function calls, API calls, message queues, or shared memory, and the interface response time must not exceed 100 milliseconds.

[0037] Signal quality information can characterize the scores of one or more dimensions of RSSI, LQI, CSI, and CS channel detection. In this embodiment, there is no specific limitation on how the score of signal quality information is calculated. For example, the scores of RSSI and LQI can be monitored, and the two scores can be weighted and summed to obtain the signal quality information.

[0038] Figure 2 This is a schematic diagram of the first preset interface. Figure 2The hardware layer can represent different types of terminal devices and / or gateway devices, for example, it can include four types: A, B, C, and D. The evaluation layer represents the underlying signal quality evaluation module, which can monitor signal quality in multiple dimensions, such as RSSI, LQI, CSI, and CS channel sounding.

[0039] The second preset interface is a standardized gateway load status acquisition interface. It is a data interaction specification agreed upon between the terminal matching system and the gateway device operation status acquisition module, and is not bound to any gateway hardware platform or internal gateway load statistics logic. Its core function is to standardize the reading of real-time operation load-related data of all online gateway devices, provide a basis for the real-time resource usage of gateway devices in the terminal matching process, balance the service load pressure of each gateway device during the generation of terminal matching information, and support dynamic load control and other related logic.

[0040] In other words, the second preset interface is the gateway load status acquisition interface, used by the terminal matching system to query the real-time operating load status of any gateway device. Input parameters may include `gateway_id`, and return values ​​may include `comprehensive_load`, `load_level`, `pending_tasks`, and `status`. `comprehensive_load` represents the gateway's overall load value, which is a value within a standardized range; `load_level` represents the gateway device's load level, for example, 0 indicates light load, 1 indicates normal, 2 indicates high load, and 3 indicates overload; `pending_tasks` represents the number of tasks currently pending processing by the gateway; and `status` indicates the gateway's online status, for example, 0 indicates offline, and 1 indicates online.

[0041] Regardless of the hardware platform or communication protocol used by the gateway device, it must return data in a unified format. The second preset interface can be implemented through function calls, API calls, message queues, or any other means, with an interface response time not exceeding 100 milliseconds. Both types of preset interfaces only need to adhere to a unified data output structure specification; there is no need to modify the native calculation logic of the underlying signal quality assessment module and the gateway device operating status acquisition module. In this embodiment, no specific limitations are imposed on the signal quality assessment module and the gateway device operating status acquisition module.

[0042] Signal quality information is data uniformly converted through a first preset interface, and it reflects the transmission reliability of the wireless communication link between a single terminal device and a single gateway device in a unified quantitative scoring format. For example, the higher the signal quality score, the better the communication link between the terminal device and the gateway device. Signal quality information can be used to determine the communication quality of terminal devices, ensuring that terminal devices with poor communication conditions can be preferentially matched with gateway resources, avoiding the phenomenon of "weak signal terminals starving".

[0043] Load status information is standardized gateway operation status representation data formed through unified conversion via a second preset interface. Specifically, it represents the gateway device's real-time resource usage, online operation, and the scale of pending services. By determining load status information, overload caused by excessive allocation of terminal devices to a single gateway device can be avoided, achieving a balanced distribution of global gateway resources. Load status information can be collected either by the gateway device proactively reporting it or by the scheduling side proactively initiating status queries to the gateway device.

[0044] In this embodiment, before starting the calculations related to terminal allocation and gateway matching, the signal quality information of all terminal devices and all corresponding gateway devices are collected in a unified manner. At the same time, the real-time operating load data of all gateway devices are collected to complete the standardized collection of the original input data required for matching calculation, eliminate the data format differences caused by different hardware and different evaluation technologies, and provide a standardized input source for the unified calculation of terminal allocation order information and terminal matching information in the future.

[0045] In step 120, the terminal allocation order information is a priority sequence of terminal devices calculated based on the full signal quality information. Terminal devices ranked higher in the order need to be matched with gateway devices more frequently. This allows terminals with poor communication quality to be prioritized, thus avoiding resource starvation issues caused by weak signal terminals being allocated gateways late and high-quality gateway resources being preemptively occupied by strong signal terminals.

[0046] For each terminal device, its final signal quality score can be determined based on its signal quality information relative to all gateway devices. For example, the average signal quality information of the terminal device and all gateway devices can be used as the terminal device's final signal quality score. The final signal quality scores of each terminal device are then sorted from low to high to obtain the terminal allocation order information. This terminal allocation order information defines the order in which gateway resources are allocated, prioritizing terminal devices with poor communication links and longer transmission times for gateway matching calculations. It is worth noting that when determining the terminal allocation order information, it can be applied only to batch service tasks within the same global priority level, without changing the system's pre-defined global task urgency level, and is fully compatible with high-priority alarm and control command services.

[0047] By generating terminal allocation order information based on signal quality information, prioritizing terminals with weak signals, terminal devices with poor communication conditions can be given priority to occupy idle and high-quality gateway resources, significantly shortening the overall transmission time of terminals with weak signals. At the same time, it reduces the idle time during the service processing phase of gateway devices and improves the overall resource utilization of the gateway.

[0048] In step 130, the terminal matching information is a set of one-to-one binding relationships between terminal devices and gateway devices, calculated based on three types of data: the sorted terminal sequence, the communication link score, and the real-time load of the gateway. When generating the terminal matching information, terminal devices can be processed one by one according to the order of their allocation information, i.e., each terminal device is matched with a gateway device sequentially. Then, using the signal quality information between the terminal device and each gateway device, as well as the load status information of each gateway device, the gateway device with the best availability is selected to form a pairing with the current terminal device. For example, the gateway device with the best signal quality and the lightest load can be assigned to the terminal device. After all terminal devices have been traversed, all pairing relationships are summarized to form complete terminal matching information. By determining the terminal matching information, service binding relationships that can be directly split and executed in parallel can be output, providing data basis for the automatic generation of subsequent subtasks and their execution by gateways, while also considering link communication reliability and global gateway load balancing.

[0049] Based on terminal matching information, parallel-executable subtasks can be automatically generated. The size of the subtasks is naturally determined by the terminal matching information, rather than being pre-fixed, achieving optimal allocation of system resources. For example, after all terminal devices are matched, for each gateway device, the list of terminal devices it is responsible for is packaged into an independent subtask. The number of subtasks equals the number of online gateways participating in this task. All subtasks are prioritized according to the load status information of the gateway devices. Gateway devices with lower loads can have higher priority subtasks, which are issued first to ensure that lightly loaded gateways can start working as soon as possible, improving the overall parallelism of the system. Subtasks are issued to the corresponding gateway devices via TCP (Transmission Control Protocol) connections according to priority, and the execution progress of all subtasks is monitored in real time.

[0050] Terminal matching information can be stored as a mapping table structure of gateway device identifiers corresponding to multiple terminal device identifiers, or as an array structure of single gateway-terminal pairing records. During the matching calculation process, signal quality and gateway load can be configured with different weight values ​​to adapt to different business scenarios.

[0051] By combining terminal allocation order information, signal quality information, and load status information to jointly calculate and generate terminal matching information, the service load of each gateway device can be evenly distributed while prioritizing the acquisition of high-quality links for terminals with weak signals. This shortens the overall completion time of the entire batch of services and improves the data transmission success rate of all terminal devices.

[0052] Figure 3 This is a schematic diagram of a terminal matching system based on multiple gateways. Figure 3The server in this embodiment can be the execution entity, and multiple gateway devices can be deployed in the edge gateway layer and multiple terminal devices can be deployed in the terminal layer.

[0053] In this embodiment, a first preset interface and a second preset interface are pre-configured. The first preset interface allows direct acquisition of signal quality information between each terminal device and each gateway device, while the second preset interface allows direct acquisition of the load status information of the gateway devices, thus enabling effective acquisition of external monitoring data. Based on the signal quality information between each terminal device and each gateway device, the terminal devices are sorted to obtain terminal allocation order information, facilitating subsequent gateway allocation based on the terminal. According to the terminal allocation order information, and based on the signal quality information between each terminal device and each gateway device, as well as the load status information of each gateway device, the gateway device matching the terminal device is determined, thus obtaining terminal matching information. By combining signal quality and load status, the matching accuracy between terminal devices and gateway devices is improved, thereby increasing the efficiency of subsequent task execution.

[0054] Figure 4 This is a flowchart illustrating a multi-gateway-based terminal matching method, as shown below. Figure 4 As shown, a terminal matching method based on multiple gateways according to one embodiment of this application may include: Step 410: For each terminal device, obtain signal quality information between the terminal device and each gateway device through the first preset interface, and for each gateway device, obtain load status information of the gateway device through the second preset interface; wherein, the signal quality information represents the score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. Step 420: For each terminal device, determine the target quality information corresponding to the terminal device based on the signal quality information between the terminal device and each gateway device. Step 430: Determine the terminal allocation order information based on the target quality information corresponding to each terminal device; Step 440: Determine terminal matching information based on terminal allocation order information, signal quality information between each terminal device and each gateway device, and load status information of each gateway device; wherein, terminal matching information represents the matching relationship between gateway devices and terminal devices.

[0055] Steps 410 and 440 have been described in detail above and will not be repeated here. Steps 420 and 430 will be described in detail below.

[0056] In step 420, each terminal device can correspond to a target quality information, which is communication link quality characterization data obtained by combining the signal quality information of a single terminal device with that of all online gateway devices. The target quality information can serve as a benchmark for judging the communication quality of a single terminal device and is the basis for calculating the terminal allocation order information.

[0057] For example, target quality information can be obtained by iterating through the signal quality information of all gateway devices associated with a single terminal device and selecting the signal quality information with the highest value as the target quality information for that terminal device. Alternatively, the average value of the signal quality information of all gateway devices associated with a single terminal device can be used as the target quality information. The target quality information maintains the same data format and quantization representation as the original signal quality information.

[0058] By extracting the corresponding target quality information for each terminal device individually, multi-dimensional and multi-gateway link data can be converged into a single terminal's unique and comparable quantitative indicator, simplifying the sorting and calculation logic of terminal allocation order information and unifying the evaluation criteria for all terminal devices.

[0059] In step 430, based on the target quality information of each terminal device, all terminal devices included in the batch service task under the same global priority are arranged in an orderly manner to generate a terminal sequence with a priority allocation order, i.e., terminal allocation order information.

[0060] This embodiment can use only the target quality information as the sole criterion for sorting, without superimposing other parameters such as gateway load and service type. This ensures that the sorting logic revolves solely around the quality of the terminal's own wireless communication conditions, which is beneficial for ensuring that terminals with weak signals have priority in participating in gateway matching calculations.

[0061] In this embodiment, terminal devices with poor communication conditions can be given priority in gateway matching, eliminating the resource starvation problem of weak signal terminals being unable to obtain high-quality gateway resources for a long time. At the same time, it simplifies the sorting operation logic in large-scale terminal scenarios and improves the efficiency and accuracy of task scheduling.

[0062] In one implementation, step 420 includes: determining the maximum value of the signal quality information from the signal quality information between the terminal device and each gateway device; and determining the maximum value of the signal quality information as the target quality information corresponding to the terminal device.

[0063] Specifically, for each terminal device, there is corresponding signal quality information between that terminal device and all online gateway devices. From the signal quality information between the terminal device and each gateway device, the maximum value of the signal quality information can be selected, that is, the maximum signal quality score. The maximum value of the signal quality information can serve as an objective quantitative upper limit of the wireless communication capability of a single terminal device, providing a unified and comparable evaluation benchmark for subsequent batch ranking of terminal devices, ensuring that the target quality information can objectively reflect the optimal wireless link level that a single terminal device can access.

[0064] Target quality information can be generated by directly assigning the maximum value of the signal quality information, representing the maximum value of signal quality information that the terminal device can tolerate. That is, the maximum value of the signal quality information is used as the target quality information for the terminal device. For each terminal device, a target quality information can be determined.

[0065] In this embodiment, by extracting the maximum value of the signal quality information of all gateway devices corresponding to a single terminal device as a terminal-specific evaluation index, the optimal communication link level that a single terminal device can obtain can be accurately characterized, thereby eliminating data interference caused by low-quality links and offline gateways, and forming a unified and objective standard for measuring terminal communication capabilities.

[0066] In one implementation, step 430 includes: sorting each terminal device from smallest to largest according to the target quality information corresponding to each terminal device to obtain terminal allocation order information.

[0067] Specifically, the ascending sorting process is based on the target quality information corresponding to each of all terminal devices as the sole sorting criterion. This operation only reads the target quality information to complete the numerical comparison, without incorporating other parameters such as gateway load status information, service type, or terminal hardware model into the sorting determination. By sorting the target quality information from smallest to largest, the sorting result of the terminal devices corresponding to the target quality information can be obtained, that is, the terminal allocation order information can be obtained.

[0068] By sorting from smallest to largest, a terminal sequence with a fixed order can be generated. Terminal devices with low target quality information values ​​and poor wireless communication link levels are placed at the beginning of the sequence, thereby determining the order of subsequent gateway resource allocation. This avoids resource starvation caused by weak signal terminals being allocated gateways late and high-quality gateway resources being occupied in advance by terminals with good communication conditions.

[0069] For example, for each terminal device, the highest signal quality to all online gateway devices is identified, i.e., the target quality information. Within batch tasks of the same priority, all terminal devices are sorted in ascending order of highest signal quality, ensuring that the terminal device with the worst signal and longest transmission time is allocated first. This allows terminal devices with poor signals to be matched with the optimal gateway device with the lightest load and best signal, fundamentally solving the problem of "weak signal terminal starvation" and gateway resource waste, without affecting the system's global task priority mechanism and being fully compatible with high-priority tasks such as emergency alarms. For example, if terminal 1 has a signal quality of 70 with gateways M and N, but less than 70 with other gateways, and terminal 2 has a signal quality of 90 with gateways M and K, but less than 90 with other gateways, then when prioritizing terminals, terminal 1 is ranked before terminal 2. During device-by-device optimal matching, terminal 1 will be assigned a gateway first because it is ranked before terminal 2.

[0070] In this embodiment, by sorting the target quality information of all terminal devices from smallest to largest, terminal devices with weak communication capabilities can be placed at the front of the allocation sequence, ensuring that weak signal terminals have priority in occupying idle high-quality gateway resources, reducing the overall transmission time of weak signal terminals, and reducing the idle time period of the gateway device during the service processing stage.

[0071] In this embodiment, a first preset interface and a second preset interface are pre-configured. The first preset interface allows direct acquisition of signal quality information between each terminal device and each gateway device, while the second preset interface allows direct acquisition of the load status information of the gateway devices, thus enabling effective acquisition of external monitoring data. Based on the signal quality information between each terminal device and each gateway device, the terminal devices are sorted to obtain terminal allocation order information, facilitating subsequent gateway allocation based on the terminal. According to the terminal allocation order information, and based on the signal quality information between each terminal device and each gateway device, as well as the load status information of each gateway device, the gateway device matching the terminal device is determined, thus obtaining terminal matching information. By combining signal quality and load status, the matching accuracy between terminal devices and gateway devices is improved, thereby increasing the efficiency of subsequent task execution.

[0072] Figure 5 This is a flowchart illustrating a multi-gateway-based terminal matching method, as shown below. Figure 5 As shown, a terminal matching method based on multiple gateways according to an embodiment of this application may include: Step 510: For each terminal device, obtain signal quality information between the terminal device and each gateway device through the first preset interface, and for each gateway device, obtain load status information of the gateway device through the second preset interface; wherein, the signal quality information represents the score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. Step 520: Determine the terminal allocation order information based on the signal quality information between each terminal device and each gateway device; wherein, the terminal allocation order information represents the order in which each terminal device is arranged when allocating gateway devices to the terminal devices; Step 530: Traverse the terminal allocation order information. For the currently traversed terminal device, determine the gateway device that matches the terminal device based on the signal quality information between the terminal device and each gateway device, as well as the load status information of each gateway device. Step 540: Determine the terminal matching information based on each terminal device and the gateway device matched with each terminal device.

[0073] Steps 510 and 520 have been detailed above and will not be repeated here. Steps 530 and 540 will be described in detail below.

[0074] In step 530, the terminal allocation order information is the sorting result of the terminal devices. Traversing the terminal allocation order information involves reading the terminal devices one by one according to the predetermined terminal arrangement order within the information. By traversing the terminal allocation order information, the execution order of gateway matching can be constrained, ensuring that terminal devices with low communication quality are given priority for gateway screening and pairing calculations. During the traversal, the currently traversed terminal device is output sequentially as the processing object for a single gateway matching operation. The traversal loop continues until all terminal devices within the terminal allocation order information have completed the pairing operation.

[0075] The process begins by identifying the currently visited terminal device and determining the signal quality information between it and each gateway device. Based on this signal quality information, along with the load status information of each gateway device, a matching gateway device is selected. In other words, the matched gateway device is chosen through a multi-layered screening process, combining signal quality and load status information, to be a dedicated service gateway device that simultaneously meets the constraints of link communication quality and gateway load capacity. By using the matched gateway device, a dedicated communication service carrier can be established for each terminal device, balancing wireless transmission reliability with global gateway load balancing.

[0076] In this embodiment, after completing a single pairing for the currently traversed terminal device, the load-related data of the corresponding gateway device can be updated synchronously to prevent subsequent terminal devices from being assigned to high-load gateways. For example, the terminal allocation order information can be traversed using a linear loop reading method, extracting individual terminal devices sequentially from beginning to end as the currently traversed terminal device. During the traversal, after processing each terminal device and its corresponding matching gateway device, the load status information of the corresponding gateway device is updated before entering the next loop. Alternatively, the terminal allocation order information can be traversed in segments. After completing the pairing of local terminals in each segment, the gateway load data is updated synchronously. After all segments are processed, all pairing relationships are summarized to obtain the terminal matching information.

[0077] When determining the gateway device that matches the terminal device, various filtering and weighted scoring logics can be used. For example, the screening process can first eliminate gateway devices with substandard links based on signal quality information, then eliminate overloaded gateways based on load status information, and finally select the gateway device closest to the terminal device from the remaining gateway devices.

[0078] In step 540, all pairing results are summarized to form complete terminal matching information. That is, the terminal matching information is a set of correspondences consisting of all terminal devices and the gateway devices that have been paired with the terminal devices.

[0079] In this embodiment, by sequentially traversing terminal devices according to the terminal allocation order information and individually matching dedicated gateway devices, it is possible to ensure that weak signal terminals complete the binding of high-quality gateways first, synchronously adjust the load on each gateway device, and finally summarize a unified set of pairing relationships to support the parallel service delivery of multiple gateways, thereby improving the overall utilization rate of gateway resources and the success rate of terminal transmission.

[0080] In one embodiment, determining a gateway device that matches the terminal device based on signal quality information between the terminal device and each gateway device, and load status information of each gateway device, includes: determining a first candidate gateway from each gateway device based on signal quality information between the terminal device and each gateway device; determining a second candidate gateway from each first candidate gateway based on load status information of each first candidate gateway; and determining a gateway device that matches the terminal device from each second candidate gateway based on signal quality information between the terminal device and each second candidate gateway, and load status information of each second candidate gateway.

[0081] Specifically, for the currently traversed terminal devices, a step-by-step filtering process can be performed from all gateway devices. First, a batch of first-candidate gateways is selected from all gateway devices. The first-candidate gateways are the gateway devices retained in the gateway set after performing the first-level filtering based on the signal quality information of all gateway devices corresponding to a single terminal device. The filtering process uses standardized signal quality information as the judgment criterion, retaining only gateway devices whose communication quality information meets the requirements. Offline gateway devices can be directly excluded from the filtering scope.

[0082] For example, based on the signal quality information between the terminal device and each gateway device, the gateway devices can be sorted from highest to lowest signal quality. The top K gateway devices are then identified as the first candidate gateways. By identifying the first candidate gateways, gateway devices whose wireless transmission conditions cannot meet basic communication requirements can be eliminated in advance, reducing the scale of subsequent load screening and comprehensive scoring calculations, and avoiding data transmission failures caused by communication link degradation.

[0083] If there is only one first candidate gateway, it can be directly identified as the second candidate gateway; if there are multiple first candidate gateways, the second candidate gateway can be further selected from the multiple first candidate gateways.

[0084] The second candidate gateway is the set of gateway devices remaining after a second layer of filtering is performed by retrieving the corresponding load status information from all the first candidate gateways. The filtering process can use standardized load status information as the criterion to eliminate gateway devices whose resource usage exceeds the capacity limit. By determining the second candidate gateway, load constraint filtering can be further performed within the range of gateways with acceptable link quality, eliminating overloaded gateway devices and balancing wireless communication reliability with gateway resource carrying capacity pressure.

[0085] When selecting the first candidate gateway, the load status information of each first candidate gateway can be determined. Based on the load status information of each first candidate gateway, the first candidate gateways can be filtered to obtain one or more second candidate gateways. For example, based on the load status information of each gateway device, the gateway devices can be sorted from smallest to largest load status information, and the top L gateway devices in the sorted list can be determined as second candidate gateways.

[0086] By setting up first and second candidate gateways in a hierarchical manner to complete two-level pre-filtering of link quality and gateway load, the number of candidate gateways can be reduced step by step, reducing the computational workload of subsequent comprehensive scoring. The hierarchical isolation of communication constraints and load constraints simplifies the logical complexity of single-step matching operations.

[0087] If there is only one second candidate gateway, it can be directly identified as the gateway device that matches the terminal device; if there are multiple second candidate gateways, the gateway device that matches the terminal device can be further selected from the multiple second candidate gateways.

[0088] After identifying multiple candidate gateways, the signal quality information of the terminal device and each candidate gateway, as well as the load status information of each candidate gateway, are retrieved simultaneously. Combining these two types of quantitative indicators, the optimal gateway device is selected as the dedicated gateway device for the current terminal device. By simultaneously integrating quantitative parameters from both communication quality and gateway load dimensions, and taking into account both transmission reliability and global load balancing, the load-related data of the selected gateway is updated synchronously, completing the gateway matching calculation for a single terminal device.

[0089] In this embodiment, by first filtering the first candidate gateway based on signal quality information, then filtering the second candidate gateway based on load status information, and finally combining the two types of information to determine the matching gateway device from the second candidate gateway, it is possible to filter out gateway devices with substandard communication or overloaded load step by step, reduce the amount of computation for comprehensive scoring, and simultaneously take into account terminal transmission reliability and global gateway load balancing, thereby improving the scheduling efficiency and accuracy of tasks.

[0090] In one embodiment, determining a first candidate gateway from each gateway device based on the signal quality information between the terminal device and each gateway device includes: for each gateway device, if the signal quality information between the terminal device and the gateway device is equal to or greater than a preset quality threshold, then the gateway device is determined as the first candidate gateway.

[0091] Specifically, a quality threshold is preset. The preset quality threshold is a pre-defined benchmark for judging signal quality information. This benchmark follows the unified quantification specification of signal quality information output by the first preset interface and does not rely on the native data dimensions of any kind of underlying signal evaluation technology such as received signal strength indication, link quality indication, channel state information, or Bluetooth channel detection.

[0092] For example, the preset quality threshold can be a standardized quantified value within the same range as the signal quality information, or it can be a unified scale such as a grade, percentage, or exponential scale. For each gateway device, the signal quality information between the terminal device and the gateway device is compared with the preset quality threshold. If the signal quality information is equal to or greater than the preset quality threshold, the gateway device is determined as the first candidate gateway; otherwise, it is not a first candidate gateway. If the signal quality information for each gateway device is less than the preset quality threshold, then all gateway devices are determined as first candidate gateways.

[0093] In other words, gateway devices with signal quality information below a preset quality threshold are filtered out, and a list of first candidate gateways is generated. If the list is empty, all online gateways are retained as first candidate gateways.

[0094] In this embodiment, by comparing the signal quality information of each gateway device with the preset quality threshold, gateway devices that meet the link quality standard are designated as the first candidate gateways. This can accurately screen out gateway devices that meet the link communication capability standard, reduce the computational scale of subsequent load screening and gateway matching, reduce the invalid calculations of subsequent load screening and comprehensive matching, and improve the efficiency and accuracy of terminal matching.

[0095] In one implementation, determining a second candidate gateway from each first candidate gateway based on the load status information of each first candidate gateway includes: for each first candidate gateway, if the load status information of the first candidate gateway is less than a preset load threshold, then the first candidate gateway is determined as the second candidate gateway.

[0096] Specifically, a load threshold is preset. This preset load threshold is a pre-configured criterion for judging load status information. This criterion is adapted to the unified quantification specification of load status information output by the second preset interface and serves as the boundary for determining whether a gateway device is in a state where it can bear new services. The preset load threshold can be used to complete the second-layer gateway filtering operation, eliminating gateway devices whose resource consumption exceeds the bearing boundary, further narrowing the scope of subsequent comprehensive scoring and optimal gateway selection calculations, and realizing layered independent verification of link quality constraints and gateway load constraints.

[0097] The preset load threshold is only used in the selection and comparison of second candidate gateways. For each first candidate gateway, its load status information is compared with the preset load threshold. If the load status information is less than the preset load threshold, the first candidate gateway is determined as a second candidate gateway; otherwise, it is not. If the load status information of each gateway device is not less than the preset load threshold, all first candidate gateways are determined as second candidate gateways.

[0098] In other words, gateway devices whose load status information exceeds a preset load threshold are filtered out from the first candidate gateway list, and a second candidate gateway list is generated. If the second candidate gateway list is empty, the first candidate gateway list is used as the second candidate gateway list.

[0099] In this embodiment, by comparing the load status information of the first candidate gateway with the preset load threshold, the first candidate gateway with service carrying capacity is designated as the second candidate gateway. This can accurately screen out gateway devices that meet the link standards but are resource-saturated, further reduce the scale of subsequent comprehensive matching operations, reduce invalid calculations in subsequent comprehensive matching stages, and simultaneously balance the service carrying pressure of each gateway device, thereby improving the accuracy and efficiency of terminal matching.

[0100] In one implementation, determining a gateway device matching the terminal device from among the second candidate gateways based on signal quality information between the terminal device and each second candidate gateway, and load status information of each second candidate gateway, includes: for each second candidate gateway, determining scoring information of the second candidate gateway based on signal quality information between the terminal device and the second candidate gateway, and load status information of the second candidate gateway; wherein the scoring information characterizes the reliability of communication of the second candidate gateway; and determining a gateway device matching the terminal device from among the second candidate gateways based on the scoring information of each second candidate gateway.

[0101] Specifically, if multiple second candidate devices are identified, a score can be determined for each second candidate device. The score is a comprehensive quantitative indicator calculated based on the signal quality information and load status information of a single second candidate gateway. It characterizes the overall communication reliability and resource capacity adaptability of the second candidate gateway when facing the currently traversed terminal devices. The score can be obtained by calculating the signal quality information and load status information; for example, by calculating their sum or average.

[0102] Using the unique scoring information of each second candidate gateway as the selection criterion, the scoring information values ​​of all second candidate gateways are compared horizontally, and the second candidate gateway with the highest score is selected as the dedicated gateway device for the current terminal device. If the scoring information values ​​of multiple second candidate gateways are consistent, a gateway device can be randomly selected. Alternatively, a secondary determination can be made by combining load status information to select the gateway device with the lightest load. If the optimal gateway still cannot be determined after the secondary determination, a gateway device can be randomly selected.

[0103] In this embodiment, by fusing the signal quality information and load status information of the second candidate gateways, a score information characterizing the overall communication reliability is generated. Then, based on the score information of each second candidate gateway, the matching gateway device is selected optimally. This unifies and quantifies the adaptability of both link quality and gateway capacity, quickly selecting the optimal gateway that balances transmission stability and load balancing, facilitating the subsequent task assignment and execution.

[0104] In one implementation, determining the scoring information of the second candidate gateway based on the signal quality information between the terminal device and the second candidate gateway, and the load status information of the second candidate gateway, includes: determining target load information based on the load status information of each gateway device; wherein the target load information represents the maximum load value that the gateway device is allowed to bear; determining the difference between the target load information and the load status information of the second candidate gateway; and performing a weighted summation process on the signal quality information between the terminal device and the second candidate gateway and the difference to obtain the scoring information of the second candidate gateway.

[0105] Specifically, target load information is standardized, quantified data representing the upper limit of services a gateway device can handle. A maximum load value can be preset as the target load information, or it can be determined based on the load status information of each gateway device. For example, the maximum value from the load status information of each gateway device can be used as the target load information.

[0106] For each second candidate gateway, the target load information is subtracted from the second candidate gateway's load status information, yielding the difference. This difference represents the remaining capacity of the second candidate gateway to add new terminal services; a larger difference indicates more remaining allocable resources for the gateway. In other words, by determining the target load information that characterizes the gateway's maximum capacity, the real-time load occupancy of the gateway can be converted into a quantitative indicator of remaining allocable resources, allowing for subsequent weighted calculations of the load capacity and standardized signal quality information.

[0107] Independent weighting coefficients are configured for the difference between signal quality information and load margin. The two parameters are multiplied by their corresponding weights and then summed to output a single quantified value, which serves as the exclusive scoring information for the second candidate gateway. The scoring information synchronously integrates two core dimensions: wireless link transmission reliability and the gateway's remaining service capacity. The weighting configuration prioritizes amplifying the impact of signal quality information on the scoring information, thus prioritizing the quality of the terminal communication link.

[0108] The formula for calculating rating information can be: Scoring information = Signal quality information × α + (Target load information - Load status information) × β; Here, α represents the weight of signal quality information, and β represents the weight of the difference. By determining the scoring information, transmission reliability and load balancing can be balanced, with a higher weight given to signal quality information to prioritize communication reliability. For example, α can be 0.6 and β can be 0.4.

[0109] In this embodiment, by performing a weighted summation on the difference between signal quality information and load margin to generate scoring information, it is possible to take into account both the wireless communication quality of the terminal and the remaining carrying capacity of the gateway, forming a comprehensive adaptation index with horizontal comparison capability, and providing a unified judgment basis for the selection of the optimal gateway.

[0110] In this embodiment, a first preset interface and a second preset interface are pre-configured. The first preset interface allows direct acquisition of signal quality information between each terminal device and each gateway device, while the second preset interface allows direct acquisition of the load status information of the gateway devices, thus enabling effective acquisition of external monitoring data. Based on the signal quality information between each terminal device and each gateway device, the terminal devices are sorted to obtain terminal allocation order information, facilitating subsequent gateway allocation based on the terminal. According to the terminal allocation order information, and based on the signal quality information between each terminal device and each gateway device, as well as the load status information of each gateway device, the gateway device matching the terminal device is determined, thus obtaining terminal matching information. By combining signal quality and load status, the matching accuracy between terminal devices and gateway devices is improved, thereby increasing the efficiency of subsequent task execution.

[0111] Figure 6 This is a flowchart illustrating a multi-gateway-based terminal matching method, as shown below. Figure 6 As shown, a terminal matching method based on multiple gateways according to an embodiment of this application may include: Step 610: If no heartbeat packet is received from the gateway device within the preset time period, the gateway device is identified as an abnormal gateway, and the first terminal to be matched with the abnormal gateway is determined according to the terminal matching information. Step 620: Obtain signal quality information between the first terminal to be matched and each other gateway through the first preset interface, and obtain load status information of other gateways through the second preset interface; wherein, other gateways represent gateway devices other than abnormal gateways. Step 630: Determine the matching order information based on the signal quality information between each first matching terminal and each other gateway; wherein, the matching order information represents the arrangement order of each first matching terminal when allocating other gateways to the first matching terminal. Step 640: Determine the target matching information based on the matching order information, the signal quality information between each first terminal to be matched and each other gateway, and the load status information of each other gateway; wherein, the target matching information represents the matching relationship between other gateways and the first terminal to be matched.

[0112] Steps 610-640 are described in detail below.

[0113] In step 610, a preset time period is established. This preset time period is a pre-configured heartbeat status determination time base, for example, a preset time period of 3 seconds. The preset time period distinguishes between the gateway's normal online operation state and its offline fault state, providing a standardized time-based basis for identifying abnormal gateways.

[0114] For example, the server maintains a heartbeat communication with all online gateway devices once per second. If no heartbeat packet is received from a gateway device for three consecutive seconds, the gateway device can be determined to be faulty and an abnormal gateway. In this case, the matching process can be re-executed for all terminal devices with incomplete tasks under the responsibility of the abnormal gateway, and they can be reassigned to other normally operating gateway devices.

[0115] The system can obtain current terminal matching information and search for terminal devices that have not completed their tasks and are matched with an abnormal gateway, designating them as the first devices to be matched. In this embodiment, after a terminal device is matched with a gateway device, the gateway device can issue a task to the corresponding terminal device. After completing the task, the terminal device can send a task completion feedback message to the gateway device. A terminal device that has not completed its task can refer to either a terminal device that has not yet sent a feedback message or a terminal device that has not yet issued a task.

[0116] A heartbeat is a standardized status message that a gateway device actively sends to the scheduling side (server) at fixed intervals. The message carries basic status data such as the gateway device's online status and brief instantaneous load information. The core function of the heartbeat is to establish a continuous online communication link between the scheduling side and all gateway devices, continuously feeding back the real-time liveness status of the gateways, serving as the primary data source for determining whether a gateway is abnormal.

[0117] In step 620, the other gateways are all online gateway devices except those marked as abnormal, which can be rebound by the first terminal to be matched. The rebinding process is the same as in steps 110 to 130, obtaining signal quality information between the first terminal to be matched and each of the other gateways through the first preset interface, and obtaining load status information of the other gateways through the second preset interface.

[0118] In other words, it is not necessary to obtain signal quality information between all terminal devices and all gateway devices, nor is it necessary to obtain load status information of all gateway devices. It is only necessary to obtain signal quality information between the first terminal to be matched and each of the other gateways, as well as load status information of the other gateways.

[0119] In step 630, similar to step 120, the matching order information is determined based on the signal quality information between each first-to-be-matched terminal and each of the other gateways. The matching order information is an ordered sequence of terminals calculated based on the signal quality information of all first-to-be-matched terminals corresponding to other gateways, representing the order in which each first-to-be-matched terminal acquires gateway resources in a fault redistribution scenario. First-to-be-matched terminals with lower signal quality information can be prioritized, that is, continuing the rule of prioritizing resource allocation for terminals with weaker signals, allowing the first-to-be-matched terminals with poorer communication links to perform gateway rematching operations first.

[0120] In step 640, similar to step 130, the first terminal to be matched is determined based on the matching order information. Then, the target matching information is determined based on the signal quality information between each first terminal to be matched and each other gateway, as well as the load status information of each other gateway. The target matching information is a set of one-to-one binding relationships between other gateways and the first terminal to be matched, formed after the fault transfer process completes the rematching operation. It represents the updated terminal gateway matching correspondence under the fault scenario, thereby replacing the invalid terminal matching information and serving as the data basis for the re-issuance of subsequent sub-tasks and the continued execution of remaining services.

[0121] Once all gateway devices have completed their respective sub-tasks, the server aggregates the execution results and returns a task completion notification to the upper-layer application, including the total task time, success rate, and a list of failed terminal devices.

[0122] In this embodiment, abnormal gateways are identified based on heartbeat packets and a preset time period, and the first affected terminal to be matched is extracted. A standardized interface is reused to collect signal and load data from the remaining gateways. After generating matching order information, rematching is performed to obtain the target matching information. This allows for rapid resource reallocation of faulty terminals in gateway failure scenarios, maintaining the scheduling rule of prioritizing weak signal terminals with high-quality gateways, ensuring uninterrupted batch IoT transmission tasks. Simultaneously, a standardized decoupled scheduling architecture is reused throughout, eliminating the need for separate adaptation to various underlying hardware and evaluation technologies.

[0123] Figure 7 This is a flowchart illustrating a multi-gateway-based terminal matching method, as shown below. Figure 7 As shown, a terminal matching method based on multiple gateways according to an embodiment of this application may include: Step 710: If, based on the load status information of each gateway device, it is determined that there are overloaded gateways and lightly loaded gateways, then, based on the terminal matching information, a second terminal to be matched with the overloaded gateway is determined; wherein, the overloaded gateway represents a gateway device whose load status information is greater than a preset first threshold, and the lightly loaded gateway represents a gateway device whose load status information is less than a preset second threshold. Step 720: Assign the second terminal to be matched to the light-load gateway.

[0124] Steps 710 and 720 are described in detail below.

[0125] In step 710, the load status information of each gateway device is monitored in real time. After determining the terminal matching information, the presence of overloaded and lightly loaded gateways is determined based on the real-time load status information. A first threshold and a second threshold are preset, with the first threshold being greater than the second threshold. The first threshold is a standardized load judgment criterion used to define a gateway device as entering an overloaded operating state, and the second threshold is a standardized load judgment criterion used to define a gateway device as having idle capacity. An overloaded gateway is a gateway device whose load status information exceeds the preset first threshold, and a lightly loaded gateway is a gateway device whose load status information is below the preset second threshold.

[0126] In other words, after determining the terminal matching information, for each online gateway device, the real-time load status information of the gateway device is compared with a preset first threshold and a preset second threshold. If the load status information is greater than the preset first threshold, the gateway device is an overloaded gateway; if the load status information is less than the preset second threshold, the gateway device is a lightly loaded gateway; if the load status information is between the preset first threshold and the preset second threshold, the gateway device is a gateway with normal load.

[0127] If both overloaded and lightly loaded gateways are identified, the second matching terminal corresponding to the overloaded gateway is determined based on the terminal matching information. For example, all terminal devices with incomplete tasks corresponding to the overloaded gateway can be identified as the second matching terminal. If there are only overloaded gateways and no lightly loaded gateways, each gateway device can continue to perform its tasks without needing to be reassigned.

[0128] In step 720, the second terminal to be matched is a terminal device that needs to be moved out of the overloaded gateway and reassigned to the lightly loaded gateway. For example, the second terminal to be matched can be randomly assigned to the lightly loaded gateway, or the second terminal to be matched and the lightly loaded gateway can be reassigned according to steps 110 to 130. Specifically, the signal quality information between each second terminal to be matched and each lightly loaded gateway can be obtained through the first preset interface, and the load status information of each lightly loaded gateway device can be obtained through the second preset interface. Based on the signal quality information between each second terminal to be matched and each lightly loaded gateway device, the allocation order information of the second terminal to be matched is determined. Based on the allocation order information of the second terminal to be matched, the signal quality information between each second terminal device to be matched and each lightly loaded gateway, and the load status information of each lightly loaded gateway, the matching information between the second terminal to be matched and the lightly loaded gateway is determined.

[0129] In this embodiment, by periodically comparing the gateway load status information with two-level load thresholds, overloaded gateways and lightly loaded gateways are identified. The second terminal to be matched bound to the overloaded gateway is extracted and allocated to the lightly loaded gateway using standardized scheduling logic. This can adjust the service bearing distribution of the multi-gateway system in real time, reduce the load gap between gateways, improve the overall resource utilization of the gateways, and avoid the decline in transmission efficiency caused by long-term high-load operation of a single gateway.

[0130] In one implementation, determining a second terminal to be matched with the overloaded gateway based on terminal matching information includes: determining all terminal devices that have not performed tasks and are matched with the overloaded gateway as candidate devices based on the terminal matching information; and determining the second terminal to be matched from the candidate devices based on terminal allocation order information.

[0131] Specifically, the candidate devices are all terminal devices selected from the terminal matching information that have established a binding relationship with the overload gateway and whose corresponding business tasks have not yet been completed. The candidate devices define the basic candidate range of migrateable terminals in dynamic load balancing scenarios, pre-filtering terminal devices that have completed business transmission and cannot participate in load migration and adjustment, thereby reducing the computational scale of subsequent selection of second-to-match terminals.

[0132] Based on the terminal allocation order information, the system selects the second terminal to be matched from the set of candidate devices, continuing the core scheduling logic of prioritizing resource allocation for weak signal terminals. That is, the order of the candidate devices is determined, and one or more of the top-ranked candidate devices are identified as the second terminal to be matched. The number of second terminals to be matched can be preset, thus identifying a predetermined number of second terminals to be matched from the candidate devices.

[0133] For example, the server periodically checks the load status information of all gateway devices. If there are both overloaded and lightly loaded gateways, the server selects the top 20% of terminal devices from the list of terminal devices with incomplete tasks of the overloaded gateway device, re-executes the matching process, and assigns them to the lightly loaded gateway.

[0134] In this embodiment, by first screening candidate devices that have not started tasks and then determining the second terminal to be matched based on the terminal allocation order information, it is possible to avoid terminal devices that are currently performing services and prevent service transmission interruption. At the same time, it prioritizes selecting terminals with poor communication conditions to perform gateway migration, continuously ensuring that terminals with weak signals can obtain high-quality link resources first, achieving real-time dynamic load balancing, and ensuring the stable and efficient execution of tasks.

[0135] It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0136] It should be noted that in various specific embodiments of this application, when processing is required based on data related to the characteristics of the target object, such as target object attribute information or a set of attribute information, the permission or consent of the target object will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require obtaining target object attribute information, separate permission or consent from the target object will be obtained through pop-ups or redirection to a confirmation page. Only after obtaining the target object's separate permission or consent will the necessary target object-related data for the normal operation of the embodiments of this application be obtained.

[0137] Description of apparatus and devices in embodiments of this application Reference Figure 8 , Figure 8 The schematic diagram of the multi-gateway-based terminal matching device 800 provided in the embodiments of this application is shown. The multi-gateway-based terminal matching device 800 includes: The information acquisition module 801 is used to acquire signal quality information between the terminal device and each gateway device through a first preset interface for each terminal device, and to acquire load status information of the gateway device through a second preset interface for each gateway device; wherein, the signal quality information represents the score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. The sequence determination module 802 is used to determine the terminal allocation sequence information based on the signal quality information between each terminal device and each gateway device; wherein, the terminal allocation sequence information represents the order in which each terminal device is arranged when allocating a gateway device to a terminal device; The terminal matching module 803 is used to determine terminal matching information based on terminal allocation order information, signal quality information between each terminal device and each gateway device, and load status information of each gateway device; wherein, the terminal matching information represents the matching relationship between the gateway device and the terminal device.

[0138] In one example, the sequence determination module 802 includes: The quality determination unit is used to determine the target quality information corresponding to each terminal device based on the signal quality information between the terminal device and each gateway device. The sequence determination unit is used to determine the terminal allocation sequence information based on the target quality information corresponding to each terminal device.

[0139] In one example, the quality determination unit is specifically used for: The maximum value of the signal quality information is determined from the signal quality information between the terminal device and each gateway device; The maximum value of the signal quality information is determined as the target quality information corresponding to the terminal device.

[0140] In one example, the sequence determines the unit, specifically for: Based on the target quality information corresponding to each terminal device, the terminal devices are sorted from smallest to largest to obtain the terminal allocation order information.

[0141] In one example, the terminal matching module 803 includes: The terminal traversal unit is used to traverse the terminal allocation order information. For the currently traversed terminal device, it determines the gateway device that matches the terminal device based on the signal quality information between the terminal device and each gateway device, as well as the load status information of each gateway device. The terminal matching unit is used to determine terminal matching information based on each terminal device and the gateway device matched with each terminal device.

[0142] In one example, the terminal traversal unit is specifically used for: Based on the signal quality information between the terminal device and each gateway device, the first candidate gateway is determined from each gateway device; Based on the load status information of each first candidate gateway, a second candidate gateway is determined from each first candidate gateway; Based on the signal quality information between the terminal device and each second candidate gateway, as well as the load status information of each second candidate gateway, a gateway device that matches the terminal device is determined from among the second candidate gateways.

[0143] In one example, the terminal traversal unit is specifically used for: For each gateway device, if the signal quality information between the terminal device and the gateway device is equal to or greater than a preset quality threshold, then the gateway device is determined as the first candidate gateway.

[0144] In one example, the terminal traversal unit is specifically used for: For each first candidate gateway, if the load status information of the first candidate gateway is less than the preset load threshold, then the first candidate gateway is determined as the second candidate gateway.

[0145] In one example, the terminal traversal unit is specifically used for: For each second candidate gateway, a score is determined based on the signal quality information between the terminal device and the second candidate gateway, as well as the load status information of the second candidate gateway; wherein, the score information characterizes the reliability of the communication of the second candidate gateway. Based on the scoring information of each second candidate gateway, a gateway device that matches the terminal device is determined from among the second candidate gateways.

[0146] In one example, the terminal traversal unit is specifically used for: Based on the load status information of each gateway device, the target load information is determined; whereby the target load information represents the maximum load value that the gateway device is allowed to bear. Determine the difference between the target load information and the load status information of the second candidate gateway; The signal quality information and the difference between the terminal device and the second candidate gateway are weighted and summed to obtain the score information of the second candidate gateway.

[0147] In one example, it also includes: The anomaly identification module is used to identify the gateway device as an abnormal gateway if it does not receive a heartbeat packet from the gateway device within a preset time period, and to determine the first terminal to be matched with the abnormal gateway based on the terminal matching information. The reacquisition module is used to acquire signal quality information between the first terminal to be matched and each other gateway through a first preset interface, and to acquire load status information of other gateways through a second preset interface; wherein, other gateways represent gateway devices other than abnormal gateways. The first determining module is used to determine the matching order information based on the signal quality information between each first matching terminal and each other gateway; wherein, the matching order information represents the arrangement order of each first matching terminal when allocating other gateways to the first matching terminal. The second determining module is used to determine the target matching information based on the matching order information, the signal quality information between each first terminal to be matched and each other gateway, and the load status information of each other gateway; wherein, the target matching information represents the matching relationship between other gateways and the first terminal to be matched.

[0148] In one example, it also includes: The load monitoring module is used to determine the second matching terminal to be matched with the overloaded gateway if it is determined that there are overloaded gateways and lightly loaded gateways based on the load status information of each gateway device; wherein, the overloaded gateway represents the gateway device whose load status information is greater than a preset first threshold, and the lightly loaded gateway represents the gateway device whose load status information is less than a preset second threshold. The reallocation module is used to assign the second terminal to be matched to the light-load gateway.

[0149] In one example, the load monitoring module is specifically used for: Based on the terminal matching information, identify all terminal devices that have not performed tasks and match the overloaded gateway as backup devices; Based on the terminal allocation order information, the second terminal to be matched is determined from the candidate devices.

[0150] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0151] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0152] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device 900 of this embodiment includes: at least one processor 901 ( Figure 9 (Only one is shown in the diagram), memory 902, and computer program 903 stored in memory 902 and executable on at least one processor 901, wherein processor 901 executes computer program 903 to implement the steps in any of the above embodiments of the multi-gateway-based terminal matching method.

[0153] Electronic device 900 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. This electronic device may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art will understand that... Figure 9 This is merely an example of electronic device 900 and does not constitute a limitation on electronic device 900. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0154] The processor 901 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0155] In some embodiments, the memory 902 may be an internal storage unit of the electronic device 900, such as a hard disk or memory of the electronic device 900. In other embodiments, the memory 902 may be an external storage device of the electronic device 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 900. Furthermore, the memory 902 may include both internal and external storage units of the electronic device 900. The memory 902 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 902 can also be used to temporarily store data that has been output or will be output.

[0156] This application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.

[0157] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0158] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.

[0159] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographic device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0160] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

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

[0162] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

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

[0164] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A terminal matching method based on multiple gateways, characterized in that, include: For each terminal device, signal quality information between the terminal device and each gateway device is obtained through a first preset interface, and for each gateway device, load status information of the gateway device is obtained through a second preset interface; wherein, the signal quality information represents a score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. Based on the signal quality information between each terminal device and each gateway device, the terminal allocation order information is determined; wherein, the terminal allocation order information represents the order in which the terminal devices are arranged when allocating gateway devices to the terminal devices; Based on the terminal allocation order information, the signal quality information between each terminal device and each gateway device, and the load status information of each gateway device, terminal matching information is determined; wherein, the terminal matching information represents the matching relationship between the gateway device and the terminal device.

2. The method according to claim 1, characterized in that, The step of determining the terminal allocation order information based on the signal quality information between each terminal device and each gateway device includes: For each terminal device, the target quality information corresponding to the terminal device is determined based on the signal quality information between the terminal device and each gateway device. The terminal allocation order information is determined based on the target quality information corresponding to each terminal device.

3. The method according to claim 2, characterized in that, The step of determining the target quality information corresponding to the terminal device based on the signal quality information between the terminal device and each gateway device includes: The maximum value of the signal quality information is determined from the signal quality information between the terminal device and each gateway device; The maximum value of the signal quality information is determined as the target quality information corresponding to the terminal device.

4. The method according to claim 2, characterized in that, The step of determining the terminal allocation order information based on the target quality information corresponding to each terminal device includes: Based on the target quality information corresponding to each terminal device, the terminal devices are sorted from smallest to largest to obtain the terminal allocation order information.

5. The method according to claim 1, characterized in that, The step of determining terminal matching information based on the terminal allocation order information, the signal quality information between each terminal device and each gateway device, and the load status information of each gateway device includes: The terminal allocation order information is traversed. For the currently traversed terminal device, the gateway device that matches the terminal device is determined based on the signal quality information between the terminal device and each gateway device, as well as the load status information of each gateway device. The terminal matching information is determined based on each terminal device and the gateway device matched with each terminal device.

6. The method according to claim 5, characterized in that, The step of determining the gateway device matching the terminal device based on the signal quality information between the terminal device and each gateway device, and the load status information of each gateway device, includes: Based on the signal quality information between the terminal device and each gateway device, a first candidate gateway is determined from each gateway device; Based on the load status information of each of the first candidate gateways, a second candidate gateway is determined from each of the first candidate gateways; Based on the signal quality information between the terminal device and each of the second candidate gateways, and the load status information of each of the second candidate gateways, a gateway device that matches the terminal device is determined from each of the second candidate gateways.

7. The method according to claim 6, characterized in that, The step of determining a first candidate gateway from among the gateway devices based on the signal quality information between the terminal device and each gateway device includes: For each gateway device, if the signal quality information between the terminal device and the gateway device is equal to or greater than a preset quality threshold, then the gateway device is determined as the first candidate gateway.

8. The method according to claim 6, characterized in that, The step of determining the second candidate gateway from the first candidate gateways based on the load status information of each first candidate gateway includes: For each first candidate gateway, if the load status information of the first candidate gateway is less than a preset load threshold, then the first candidate gateway is determined as the second candidate gateway.

9. The method according to claim 6, characterized in that, The step of determining a gateway device matching the terminal device from among the second candidate gateways based on the signal quality information between the terminal device and each second candidate gateway, and the load status information of each second candidate gateway, includes: For each second candidate gateway, a score information for the second candidate gateway is determined based on the signal quality information between the terminal device and the second candidate gateway, and the load status information of the second candidate gateway; wherein the score information characterizes the reliability of the communication of the second candidate gateway. Based on the scoring information of each of the second candidate gateways, a gateway device that matches the terminal device is determined from each of the second candidate gateways.

10. The method according to claim 9, characterized in that, The step of determining the scoring information of the second candidate gateway based on the signal quality information between the terminal device and the second candidate gateway, and the load status information of the second candidate gateway, includes: Based on the load status information of each gateway device, target load information is determined; wherein, the target load information represents the maximum load value that the gateway device is allowed to bear; Determine the difference between the target load information and the load status information of the second candidate gateway; The signal quality information between the terminal device and the second candidate gateway, along with the difference, are weighted and summed to obtain the score information of the second candidate gateway.

11. The method according to any one of claims 1-10, characterized in that, The method further includes: If no heartbeat packet is received from the gateway device within the preset time period, the gateway device is identified as an abnormal gateway, and the first terminal to be matched with the abnormal gateway is determined according to the terminal matching information. The signal quality information between the first terminal to be matched and each other gateway is obtained through the first preset interface, and the load status information of other gateways is obtained through the second preset interface; wherein, the other gateways represent gateway devices other than abnormal gateways. Based on the signal quality information between each of the first matching terminals and each of the other gateways, the matching order information is determined; wherein, the matching order information represents the arrangement order of each of the first matching terminals when other gateways are assigned to the first matching terminals. Based on the matching order information, the signal quality information between each of the first matching terminals and each of the other gateways, and the load status information of each of the other gateways, target matching information is determined; wherein, the target matching information represents the matching relationship between the other gateways and the first matching terminals.

12. The method according to any one of claims 1-10, characterized in that, The method further includes: If, based on the load status information of each gateway device, it is determined that there are overloaded gateways and lightly loaded gateways, then, based on the terminal matching information, a second terminal to be matched with the overloaded gateway is determined; wherein, the overloaded gateway represents a gateway device whose load status information is greater than a preset first threshold, and the lightly loaded gateway represents a gateway device whose load status information is less than a preset second threshold. The second terminal to be matched is assigned to the light-load gateway.

13. The method according to claim 12, characterized in that, The step of determining the second terminal to be matched with the overload gateway based on the terminal matching information includes: Based on the terminal matching information, all terminal devices that have not executed tasks and match the overload gateway are identified as alternative devices; Based on the terminal allocation order information, the second terminal to be matched is determined from the candidate devices.

14. A terminal matching device based on multiple gateways, characterized in that, include: The information acquisition module is used to acquire signal quality information between the terminal device and each gateway device through a first preset interface for each terminal device, and to acquire load status information of the gateway device through a second preset interface for each gateway device; wherein, the signal quality information represents a score of the signal quality between the terminal device and the gateway device, and the load status information represents the load status of the gateway device. The sequence determination module is used to determine the terminal allocation sequence information based on the signal quality information between each terminal device and each gateway device; wherein, the terminal allocation sequence information represents the arrangement order of each terminal device when allocating gateway devices to the terminal devices; The terminal matching module is used to determine terminal matching information based on the terminal allocation order information, the signal quality information between each terminal device and each gateway device, and the load status information of each gateway device; wherein, the terminal matching information represents the matching relationship between the gateway device and the terminal device.

15. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1 to 13.

16. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 13.

17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 13.