WO2020181534A1 - 连接控制方法、路由器及计算机可读存储介质 - Google Patents

连接控制方法、路由器及计算机可读存储介质 Download PDF

Info

Publication number
WO2020181534A1
WO2020181534A1 PCT/CN2019/078029 CN2019078029W WO2020181534A1 WO 2020181534 A1 WO2020181534 A1 WO 2020181534A1 CN 2019078029 W CN2019078029 W CN 2019078029W WO 2020181534 A1 WO2020181534 A1 WO 2020181534A1
Authority
WO
WIPO (PCT)
Prior art keywords
input device
state information
data
processed
router
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/078029
Other languages
English (en)
French (fr)
Inventor
李友
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Royole Technologies Co Ltd
Original Assignee
Shenzhen Royole Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Royole Technologies Co Ltd filed Critical Shenzhen Royole Technologies Co Ltd
Priority to CN201980073398.2A priority Critical patent/CN113557698A/zh
Priority to PCT/CN2019/078029 priority patent/WO2020181534A1/zh
Publication of WO2020181534A1 publication Critical patent/WO2020181534A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/78Architectures of resource allocation
    • H04L47/781Centralised allocation of resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects
    • H04L47/824Applicable to portable or mobile terminals

Definitions

  • This application relates to the field of communication technology, and in particular to a connection control method, router and computer-readable storage medium.
  • the Bluetooth router can be connected to multiple Bluetooth devices (such as writing boards) to transmit the data of each Bluetooth device to the display device for display in real time, achieving the goal of multi-user collaborative operation.
  • the Bluetooth router will evenly allocate the time for processing the data of each Bluetooth device according to the number of connected Bluetooth devices. For example, the Bluetooth router allocates the same time for processing the data of each Bluetooth device.
  • the Bluetooth router may not be able to complete the data of the wordpad with more data in the allocated time Transmission, which in turn leads to serious data loss on the tablet; or, the Bluetooth router may choose to process the tablet without data within the allocated time, resulting in a waste of resource utilization of the Bluetooth router.
  • the application discloses a connection control method for improving the resource utilization rate of a router, a router and a computer-readable storage medium.
  • connection control method applied to a router including:
  • a second aspect of the embodiments of the present application provides a router, including:
  • a memory storing status information of each input device in a preset number of input devices, the status information including whether there is pending data in the last connection and the number of accumulated connections;
  • a processor connected to the memory, the processor determines according to each state information that one of the preset number of input devices is a target input device; the processor also determines whether there is any related to the target input device When there is data to be processed associated with the target input device, the processor is used to complete the processing of the data to be processed.
  • the third aspect of the embodiments of the present application provides a computer-readable storage medium storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in any one of the first aspects of the embodiments of the present application is implemented Part or all of the steps.
  • the embodiments of the present application provide a connection control method, a router, and a computer-readable storage medium, which can reduce the waste of resource utilization caused by the time that the router processes access devices that do not have data to be processed. It can also reduce the insufficiency of data loss due to the possibility that the processing of the data to be transmitted cannot be completed within the allocated time.
  • Fig. 1 is a schematic diagram of a connection control system in an embodiment of the present application.
  • Fig. 2 is a flow chart of the steps of the connection control method in one embodiment of the present application.
  • Fig. 3 is a flowchart of steps of a connection control method in one embodiment of the present application.
  • FIG. 4 is a schematic diagram of the initialization operation of the preset model in an embodiment of the present application.
  • Fig. 5 is a schematic diagram of updating a preset model in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of updating the default model in an embodiment of this application.
  • Fig. 7 is a schematic diagram of the hardware structure of a router in an embodiment of the present application.
  • the connection control system 90 may include one or more routers 50, one or more input devices 40, and a display terminal 60.
  • each router 50 can be connected to one or more input devices 40
  • the input device 40 can be a tablet
  • the router 50 can be a router supporting Bluetooth communication (such as a Bluetooth router).
  • the input device 40 can generate data to be processed (such as the data to be transmitted for the generated handwriting), and can transmit the generated data to be processed through wireless communication methods such as Bluetooth or wired communication.
  • the router 50 can transmit the to-be-processed data generated by the input device 40 to the display terminal 60, and the display terminal 60 displays the corresponding handwriting.
  • the input device 40 can also be other types of electronic equipment.
  • connection control method includes the following steps:
  • Step 100 Obtain status information of each input device in a preset number of input devices, where the status information includes whether there is pending data for the most recent connection and the number of accumulated connections.
  • the router 50 can store and update the status information of each input device in the preset number of input devices.
  • the status information can include whether there is pending data in the last connection and the number of accumulated connections. Whether there is data to be processed in the last connection in the status information can include the first tag value or the second tag value, where the first tag value can indicate that there is data to be processed in the most recent connection, and the second tag value can indicate that there is no data in the most recent connection.
  • Data to be processed; the cumulative number of connections in the status information represents the cumulative number of data to be transmitted of the input device corresponding to the status information that the router 50 selects to process.
  • the router 50 can receive a preset number of data to be transmitted transmitted by the input device 40, and can associate the received data to be transmitted with the corresponding input device, where the preset number can be expressed as one or more.
  • each status information can be represented by a storage space of 1 byte (ie, 8 words).
  • the status information can be represented by an 8-bit binary system, and whether there is data to be processed in the last connection (
  • the identification part can be represented by two words (bit), and the cumulative connection times (such as the counting part) can be represented by six words (bit).
  • the number of bytes of the state information storage space is not limited to one byte, the identification part is not limited to two words, and the counting part is not limited to six words.
  • the data to be processed in the last connection when whether the data to be processed in the last connection is the first identification value (for example, binary "01"), it means that the input device corresponding to the state information in the router 50 has data to be transmitted in the last connection;
  • the second identification value for example, binary "00"
  • the router 50 before acquiring the state information of the preset number of input devices, the router 50 is also used to control the initialization operation of the state information of the preset number of input devices.
  • the router 50 sets whether there is pending data for the latest connection of the status information of each input device as the first identification value (for example, set to binary "01"), and sets the cumulative number of connections for each status information Is the first count value (for example, set to binary "000000"). In this way, in the initialization operation, the router 50 sets whether the data to be processed in the latest connection in the status information of each input device is data to be transmitted and sets the number of accumulated connections to 0.
  • Step 102 Determine one of the preset number of input devices as a target input device according to each state information.
  • the router 50 can determine the target input device according to whether there is data to be processed in the last connection in the state information. For example, the router 50 can prioritize the input device connected to the data to be processed the last time as the target input device. 50 By determining the input device with the data to be processed last time among the preset number of input devices, it is beneficial to reduce the waste of resource utilization caused by the time of the router processing the access device without the data to be processed. If the most recent connection among the preset number of input devices has no data to be processed, the router 50 can determine the target input device from the input devices that have no data to be processed in the last connection in the state information.
  • the router 50 can It is determined from the preset number of input devices that the input device to which the data to be processed is last connected is the first input device set, and the input device with the least accumulated connection times is determined from the first input device set as the candidate target input device, It also determines any one of the candidate target input devices as the target input device.
  • the router 50 stores first state information corresponding to the first input device, second state information corresponding to the second input device, and third state information corresponding to the third input device. Among them, whether the last connection in the first state information has pending data is the first identification value and the number of accumulated connections is 2, and whether the last connection in the second state information has pending data is the first identification value and accumulated connections The number of times is 3, whether the last connection has pending data in the third status information is the second identification value and the number of accumulated connections is 2. Since whether the number of pending connections in the last connection in the first status information and the second status information is the first identification value, the router 50 determines that the first input device and the second input device are the first input device set.
  • the router 50 may determine the input device with the least number of accumulated connections as the candidate target input device. Therefore, the router 50 determines the candidate target input device from the first set of input devices, such as determining that the input device in the first set of input devices whose status information is accumulated the least number of times is the candidate target input device. Since the cumulative number of connections in the first status information is less than the cumulative number of connections in the second status information, the router 50 can determine that the first input device corresponding to the first status information is a candidate target input device, and further, the router 50 can determine that the first input device is the target input device.
  • the router 50 may Determine any one of the candidate target input devices as the target input device.
  • the router 50 can determine any one of the first input device corresponding to the first state information and the second input device corresponding to the second state information as the target input device.
  • the router 50 when the preset number of input devices does not include the data to be processed in the last connection (that is, there is no data to be processed in the last connection of the preset number of input devices), from the preset number of input devices The input device with the least number of accumulated connections is determined as the candidate target input device.
  • the router 50 stores fourth state information corresponding to the fourth input device, fifth state information corresponding to the fifth input device, and sixth state information corresponding to the sixth input device. Among them, whether the last connection in the fourth status information has pending data is the second identification value and the number of accumulated connections is 3, and whether the last connection in the fifth status information has pending data is the second identification value and accumulated connections The number of times is 4, whether the latest connection has pending data in the sixth status information is the second identification value and the number of accumulated connections is 2. At this time, because the number of accumulated connections in the sixth state information is the smallest, the router 50 can determine that the sixth input device corresponding to the sixth state information is the candidate target input device, and can determine that the sixth input device is the target Input device.
  • the router 50 can determine that the fourth input device and the sixth input device with the least cumulative number of connections in the status information are candidate target input devices. At this time, the router 50 can determine that any one of the fourth input device and the sixth input device is The target input device.
  • Step 104 Update the cumulative number of connections in the status information of the target input device.
  • the router 50 determines the target input device, for example, it is determined whether the last connection of the above state information has data to be processed and the first input device is the target input device or whether the last connection of the state information has data to be processed is The fourth input device without data to be processed is the target input device, and the router 50 adds 1 to the cumulative number of connections of the first state information corresponding to the first input device. At this time, the first state corresponding to the first input device The cumulative number of connections for the information is 3; the router 50 can also add 1 to the cumulative number of connections for the fourth input device corresponding to the fourth input device. The cumulative number of connections is 4.
  • Step 106 Determine whether there is to-be-processed data associated with the target input device; when there is to-be-processed data associated with the target input device, complete the processing of the to-be-processed data.
  • the router 50 after determining the target input device, the router 50 also determines whether there is to-be-processed data associated with the target input device (that is, the router 50 determines whether there is currently to-be-transmitted data associated with the target state information), If it exists, it means that the input device 40 corresponding to the target state information has transmitted the data to be processed to the router 50. At this time, in order to reduce the lack of data loss due to the inability to complete the processing of the data to be transmitted within the allocated time, the router 50 After completing the processing of the to-be-processed data associated with the target state information, it may return to step 102 to continue execution. In this embodiment, the router 50 may transmit the to-be-processed data associated with the target state information to the display terminal 60 for display.
  • the router 50 when there is pending data associated with the target input device in the router 50, the router 50 updates whether there is pending data for the last connection in the state information of the target input device as the pending data for the last connection. When there is no pending data associated with the target input device in the router 50, the router 50 updates whether the last connection has pending data in the state information of the target input device as the last connection has no pending data.
  • the router 50 can set the first state information corresponding to the first input device For example, the router 50 can set whether the data to be processed in the last connection in the first status information corresponding to the first input device is the second identification value;
  • the router 50 can set whether the latest connection in the fourth state information corresponding to the fourth input device is pending The data is the data to be processed in the last connection. For example, the router 50 can set whether the data to be processed in the last connection in the fourth state information corresponding to the fourth input device is the first identification value.
  • the maximum value is 63 (decimal), so when the number of cumulative connections of the access device corresponding to the status information is greater than At 63 o'clock, the accumulated connection times of the status information will overflow. At this time, the router 50 can control the initialization operation of the status information of the preset number of input devices.
  • the router 50 when the cumulative number of connections of the third state information is 63, if the third state information is determined to be the target state information and there is data to be transmitted associated with the third state information in the router 50, the router 50 will After adding 1 to the accumulated connection times of the third status information, the accumulated connection times of the third status information may overflow, which may cause the accumulated connection times of the third information to change from 63 to 0. At this time, the router 50 Enter the status information of the device for initialization.
  • the above connection control method firstly determines whether the latest connection in the state information corresponding to the preset number of input devices has the data to be processed is the data to be processed and the input device with the least number of cumulative connections is the target input device, and completes the connection with the target state
  • the processing of the data to be transmitted related to the information so as to reduce the waste of resource utilization caused by the time of the router processing the access device without the data to be processed, and also reduce the possibility that the transmission of the data may not be completed within the allocated time Insufficient data loss caused by data processing.
  • connection control method determines whether the latest connection in the state information corresponding to the preset number of input devices has data to be processed is no data to be processed and the input device with the least number of accumulated connections is the target input device, which is beneficial to improve The recklessness of the system and the fairness of router resource allocation.
  • connection control method includes the following steps:
  • Step 200 Control the initialization operation of the state information of a preset number of input devices.
  • FIG. 4 shows a schematic diagram of the initialization operation of the preset model in an embodiment of the application.
  • the router 50 controls the initializing operation of the state information of the preset number of input devices, including setting whether the last connection in each state information has pending data (identification part) and the number of accumulated connections (counting part).
  • the router 50 can store the status information of 10 input devices, which are respectively represented as the first status information to the tenth status information, the identification part of each status information can be initialized to decimal 1, and the counting part of each status information is initialized It is 0 in decimal, that is, each status information can be expressed as "1/0".
  • Step 202 Obtain status information of the preset number of input devices, where the status information includes whether there is data to be processed in the last connection and the number of accumulated connections.
  • the router 50 After initializing the state information of the preset number of input devices, the router 50 can obtain each state information.
  • Step 204 Model the state information value of the preset number of input devices according to a preset model, where the state information of each input device includes a state information value.
  • the status information of each input device can be whether there is data to be processed in the last connection and the number of accumulated connections, for example, the status information can be expressed as "1/0" during the initialization operation.
  • the router 50 determines the state information value of each input device according to the representation of the state information.
  • the state information value of the input device that is connected to the data to be processed the most recently is greater than the state information value of the input device that is connected to the input device that has no data to be processed the most recently (such as setting the last connection No data to be processed is "0"); for the input device that has data to be processed in the last connection, the more the number of accumulated connections, the smaller the value of the status information; for the input device that has no data to be processed in the last connection, it is The more the accumulated connection times, the smaller the status information value.
  • the router 50 may model the state information value of the preset number of input devices according to a preset model.
  • the router 50 may model the state information values of a preset number of input devices according to a binary tree model, where the binary tree model includes a root node, multiple child nodes, and multiple leaf nodes. After the initialization operation, each state information value is the same. Therefore, the router 50 can randomly select the state information value on the corresponding node according to the binary tree model.
  • the first state information value may be the root node
  • the second state information value (left child node) and the third state information value (right child node) are child nodes of the first state information value
  • the fourth state information value (left child node) Child node) and the fifth state information value (right child node) are child nodes of the second state information value
  • the sixth state information value (left child node) and the seventh state information value (right child node) are the third state information
  • the value of the child node, the eighth state information value (left child node) and the ninth state information value (right child node) are the child nodes of the fourth state information value
  • the tenth state information value (left child node) is the fifth state
  • the child nodes of the information value, where the sixth state information value, the seventh state information value, the eighth state information value, the ninth state information value, and the tenth state information value are also leaf nodes.
  • the router 50 may control the state information values in the preset model to be sorted in a maximum heap ordering manner, where the maximum heap ordering means that the state information value of the parent node of the binary tree is greater than (or not less than) it The status information value of the left and right child nodes.
  • Step 206 Determine that the input device corresponding to the state information value at the target position in the preset model is the target input device.
  • the router 50 controls the preset number of input devices to be sorted by the largest heap of state information values
  • the root node position ie the position of the top of the heap
  • the router 50 can represent the target position with the largest state information value. Therefore, the router 50 can The input device corresponding to the state information value at the position of the root node in the preset model is determined as the target input device.
  • the router 50 can also use other models to model the state information value of a preset number of input devices. The router 50 only needs to determine the input device corresponding to the state information value with the largest state information value as the target. Just enter the device.
  • Step 208 Determine whether there is data to be transmitted associated with the target input device; when there is data to be transmitted associated with the target information, perform step 210; when there is no data to be transmitted associated with the target information When transmitting data, step 212 is executed.
  • the router 50 when the router 50 receives the data to be transmitted from the input device 40, the router 50 may associate the data to be transmitted from the input device with corresponding state information. If it exists, it means that the input device 40 corresponding to the target state information has transmitted the data to be processed to the router 50. Therefore, the router 50 processes the data to be transmitted; if it does not exist, the router 50 executes step 212.
  • Step 210 Process the data to be transmitted.
  • the router 50 may first complete the processing of the data to be transmitted, so as to reduce data loss due to the inability to complete the processing of the data to be transmitted within the allocated time. insufficient.
  • Step 212 Update the status information value of the target input device.
  • the router 50 When determining the target input device, the router 50 will update whether there is pending data and the number of accumulated connections in the state information of the target input device in the last connection, so as to achieve the purpose of updating the state information value of the target input device.
  • the router 50 increases the number of accumulated connections in the status information of the target input device by 1, and the router 50 also sets whether there is pending data for the latest connection according to whether there is status information associated with the target input device.
  • the router 50 sets whether there is pending data in the last connection in the status information of the target input device and is set to the first identification value; When there is pending data associated with the target input device, the router 50 sets whether there is pending data in the latest connection in the status information of the device target input device as the second identification value.
  • FIG. 5 shows a schematic diagram of updating the default model in an embodiment of this application.
  • the router 50 may add the state information of the first input device to Is there any pending data for the last connection to be set to "0" (decimal), and the cumulative number of connections in the status information of the first input device is increased by 1, therefore, the status information value of the first input device can be expressed as " 0/1".
  • FIG. 6 shows a schematic diagram of updating the default model in an embodiment of this application.
  • the router 50 may change the state information of the second input device Whether there is pending data in the last connection is set to "1" (decimal), and the cumulative number of connections in the status information of the first input device is increased by 1, therefore, the status information value of the first input device can be expressed as "1" /1".
  • Step 214 Determine whether the cumulative number of connections of any one of the preset number of input devices exceeds the threshold; when the cumulative number of connections of any one of the preset number of input devices exceeds the threshold, return to step 200 When the cumulative number of connections of each input device in the preset number of input devices does not exceed the threshold, step 216 is executed.
  • the maximum value is 63 (decimal), so when the number of cumulative connections of the access device corresponding to the status information is greater than At 63, the accumulated connection times of the status information will overflow. At this time, the router 50 may return to step 200 to control the initialization operation of the status information of the preset number of input devices.
  • the router 50 when the cumulative number of connections of the third state information is 63, if the third state information is determined to be the target state information and there is data to be transmitted associated with the third state information in the router 50, the router 50 will After adding 1 to the accumulated connection times of the third status information, the accumulated connection times of the third status information may overflow, which may cause the accumulated connection times of the third information to change from 63 to 0. At this time, the router 50 Enter the status information of the device for initialization. When the cumulative number of connections of each input device in the preset number of input devices does not exceed the threshold, it means that the router 50 can continue to process the data to be transmitted corresponding to the preset number of input devices.
  • Step 216 Update the position of each state information value in the preset model.
  • the router 50 Since the router 50 adjusts the position of each state information value in the preset model with the maximum heap of the binary tree according to the state information value, after the state information value of the target input device is updated, the state information value of the target input device may change. Therefore, the router 50 needs to update the position of each state information value in the preset model, so that subsequent processing can be performed, such as returning to step 206 to continue execution.
  • the state information value of the input device with data to be processed last time is greater than the value of the state information of the input device with no data to be processed in the last connection; for the input device that has data to be processed in the last connection, the more accumulated connection times, then The smaller the value of the status information; for the input device that has no data to be processed in the last connection, the more the number of accumulated connections, the smaller the value of the status information.
  • the router 50 adjusts the updated first state information value to the position of the original eighth state information value, thereby making the first state information the eighth state The left child node of the message.
  • the router 50 adjusts the updated second state information value to the position of the original ninth state information value, so that the second state information is the right child node of the ninth state information.
  • the above connection control method determines the input device corresponding to the state information value at the root node position in the binary tree sorted by the maximum heap as the target input device, and completes the processing of the data to be transmitted associated with the target state information. In this way, routers can be reduced. The waste of resource utilization caused by the time of processing the access device without the data to be processed can also reduce the lack of data loss due to the possibility that the processing of the data to be transmitted cannot be completed within the allocated time.
  • the above connection control method can also determine whether the status information of the target input device will overflow, and perform the initialization operation when the status information of the target input device is used. In this way, in some extreme cases, the tablet at the top of the stack always has data writing , And other WordPad nodes are in no data transmission state, which helps to avoid the possibility that the router will be monopolized by a WordPad all the time.
  • FIG. 7 shows a schematic diagram of the hardware structure of a router in an embodiment of the present application.
  • the router 50 can apply the above-mentioned embodiments.
  • the router 50 provided in the present application will be described below.
  • the router 50 may include a processor 500, a storage device 502, and a communication interface 504, and is stored in The computer program (instruction) in the storage device 502 that can be run on the processor 500, the router 50 may also include other hardware parts, which will not be repeated here.
  • the processor 500 can exchange data with the storage device 502 and the communication interface 504 via the bus 506.
  • the processor 500 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
  • the processor is the control center of the router 50 and connects various parts of the entire router 50 through various interfaces and lines.
  • the storage device 502 may be used to store the computer program and/or module, and the processor 500 runs or executes the computer program and/or module stored in the storage device 502 and calls the computer program and/or module stored in the storage device 502 Data to realize various functions of the connection control method.
  • the storage device 502 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, and the like.
  • the storage device 502 may include a high-speed random access storage device, and may also include a non-volatile storage device, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital). , SD) card, flash card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • the communication interface 504 may be a Bluetooth interface, so that the router 50 can exchange data with the input device via Bluetooth.
  • the communication interface 504 may be other types of wireless communication interfaces or wired communication interfaces.
  • the processor 500 reads the executable program code stored in the storage device 502 to run the program corresponding to the executable program code, so as to execute the connection control method executed by the router in any of the foregoing embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种连接控制方法、路由器及计算机可读存储介质,该连接控制方法包括:获取预设数量的输入装置中每个输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数(100);根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置(102);确定是否存在与所述目标输入装置相关联的待处理数据;当存在与所述目标输入装置相关联的待处理数据时,完成所述待处理数据的处理(106)。本申请实施例可减少路由器处理没有待处理数据的接入装置的时间而带来的资源利用率的浪费,亦可减少因可能无法在分配的时间内完成待传输数据的处理而导致数据丢失的不足。

Description

连接控制方法、路由器及计算机可读存储介质 技术领域
本申请涉及通信技术领域,尤其涉及一种连接控制方法、路由器及计算机可读存储介质。
背景技术
在多人的会议室或者教室中,蓝牙路由器可接入多个蓝牙设备(如写字板),以将各蓝牙设备的数据实时传输到显示设备显示,达到多用户协同操作的目标。一般地,蓝牙路由器会按照接入蓝牙设备的数量平均分配处理每一蓝牙设备的数据的时间,如蓝牙路由器分配处理每一蓝牙设备的数据的时间均相同。然而,每时每刻,并不是所有写字板都是在书写产生数据,或者写字板产生的数据亦可能不同,如此,蓝牙路由器可能无法在分配的时间内完成数据较多的写字板的数据的传输,进而导致写字板的数据丢失较为严重;或者,蓝牙路由器在分配的时间内亦可能选择处理的写字板没有数据,导致了蓝牙路由器的资源利用率的浪费。
发明内容
本申请公开了一种提高路由器的资源利用率的连接控制方法、路由器及计算机可读存储介质。
本申请实施例第一方面提供一种连接控制方法,应用于路由器,包括:
获取预设数量的输入装置中每个输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数;
根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置;
确定是否存在与所述目标输入装置相关联的待处理数据;
当存在与所述目标输入装置相关联的待处理数据时,完成所述待处理数据的处理。
本申请实施例第二方面提供一种路由器,包括:
存储器,存储预设数量的输入装置中每一输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数;
处理器,连接于所述存储器,所述处理器根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置;所述处理器还确定是否存在与所述目标输入装置相关联的待处理数据;当存在与所述目标输入装置相关联的待处理数据时,所述处理器用于完成所述待处理数据的处理。
本申请实施例第三方面提供一种计算机可读存储介质,存储有计算机指令,其特征在于,所述计算机指令被处理器执行时实现如本申请实施例第一方面任一方法中所描述的部分或全部步骤。
相较于现有技术,本申请实施方式提供了一种连接控制方法、路由器及计算机可读存储介质可减少路由器处理没有待处理数据的接入装置的时间而带来的资源利用率的浪费,亦可减少因可能无法在分配的时间内完成待传输数据的处理而导致数据丢失的不足。
附图说明
为了更清楚地说明本申请实施方式或现有技术中的技术方案,下面将对实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中的连接控制系统的示意图。
图2是本申请其中的一实施例中的连接控制方法的步骤流程图。
图3是本申请其中的一实施例中的连接控制方法的步骤流程图。
图4是本申请其中的一实施例中的预设模型的初始化操作的示意图。
图5是本申请其中的一实施例中的更新预设模型的示意图。
图6为本申请其中的一实施例中的更新预设模型的示意图。
图7是本申请一实施例中的路由器的硬件结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实 施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
需要说明的是,对于以下的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。
请参阅图1,所示为本申请一实施例中的连接控制系统90的示意图。本实施例中,连接控制系统90可包括一个或多个路由器50、一个或多个输入装置40及显示终端60。本实施例中,每一路由器50可接入一个或多个输入装置40,输入装置40可为写字板,路由器50可为支持蓝牙通信的路由器(如蓝牙路由器)。例如,用户在输入装置40进行绘制时,输入装置40可产生待处理数据(如产生绘制的笔迹的待传输数据),并可通过蓝牙等无线通讯方式或有线通讯方式将产生的待处理数据传输至路由器50,路由器50则可将输入装置40产生的待处理数据传输至显示终端60,并由显示终端60显示对应的笔迹。在其他实施例中,输入装置40亦可为其他类型的电子设备。
请参阅图2,所示为本申请其中的一实施例中的连接控制方法的步骤流程图。该连接控制方法包括如下步骤:
步骤100,获取预设数量的输入装置中每个输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数。
本实施例中,路由器50可存储并更新该预设数量的输入装置中每一输入装置的状态信息,状态信息可包括最近一次连接是否有待处理数据及被累计连接次数。状态信息中的最近一次连接是否有待处理数据可包括第一标记值或第二标记值,其中,第一标记值可表示为最近一次连接有待处理数据,第二标记值可表示为最近一次连接无待处理数据;状态信息中的被累计连接次数表示为路由器50选择处理该状态信息所对应的输入装置的待传输数据的累计次数。路由器50可接收到预设数量的输入装置40传输的待传输数据,并可将接收到的待传输数据与对应的输入装置进行关联,其中,该预设数量可表示为一个或多个。
本实施例中,每一状态信息可通过1字节(byte)(即8个字)的存储空间来表示,如状态信息可通过8位二进制来表示,其中,最近一次连接是否有待处理数据(如标识部)可通过两个字(bit)来表示,被累计连接次数(如计数部)可通过六个字(bit)来表示。在其他实施例中,状态信息存储空间的字节数并不限制于1字节,标识部亦不限于两个字,计数部亦不限于六个字。
本实施例中,当最近一次连接是否有待处理数据为第一标识值(如为二进制“01”)时,表示在路由器50中的该状态信息所对应的输入装置的最近一次连接有待传输数据;当最近一次连接是否有待处理数据为第二标识值(如为二进制“00”)时,表示在路由器50中该状态信息所对应的输入装置的最近一次连接无待传输数据。
本实施例中,在获取预设数量的输入装置的状态信息之前,路由器50还用于控制预设数量的输入装置的状态信息的初始化操作。在初始化操作时,路由器50将每一输入装置的状态信息的最近一次连接是否有待处理数据设置为第一标识值(如设置为二进制“01”),并设置每一状态信息的被累计连接次数为第一计数值(如设置为二进制“000000”)。如此,在初始化操作中,路由器50设置每一输入装置的状态信息中的最近一次连接是否有待处理数据为有待传输数据且设置被累计连接次数为0。
步骤102,根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置。
本实施例中,路由器50可根据状态信息中的最近一次连接是否有待处理 数据来确定该目标输入装置,如路由器50可优先确定最近一次连接有待处理数据的输入装置为目标输入装置,进而,路由器50通过确定预设数量的输入装置中的最近一次连接有待处理数据的输入装置,有利于减少路由器处理没有待处理数据的接入装置的时间而带来的资源利用率的浪费的不足。若预设数量的输入装置中的最近一次连接均为无待处理数据,路由器50则可再从状态信息中最近一次连接无待处理数据的输入装置中确定该目标输入装置。
在一实施例中,当状态信息中的最近一次连接是否有待处理数据为最近一次连接有待处理数据时,表示该状态信息所对应的输入装置在最近一次连接中有待处理数据,因而,路由器50可在预设数量的输入装置中确定最近一次连接有待处理数据的输入装置为第一输入装置集合,并从该第一输入装置集合中确定被累计连接次数最少的输入装置作为备选目标输入装置,还确定备选目标输入装置中的任一个作为该目标输入装置。
例如,路由器50中存储了第一输入装置所对应的第一状态信息、第二输入装置所对应的第二状态信息及第三输入装置所对应的第三状态信息。其中,第一状态信息中的最近一次连接是否有待处理数据为第一标识值且被累计连接次数为2,第二状态信息中的最近一次连接是否有待处理数据为第一标识值且被累计连接次数为3,第三状态信息中的最近一次连接是否有待处理数据为第二标识值且被累计连接次数为2。由于第一状态信息及第二状态信息中的最近一次连接是否有待处理数量为第一标识值,因此,路由器50则确定第一输入装置及第二输入装置为第一输入装置集合。为保证路由器50资源分配的公平性,路由器50可确定被累计连接次数最少的输入装置为备选目标输入装置。因此,路由器50从第一输入装置集合中确定备选目标输入装置,如确定第一输入装置集合中状态信息被累计连接次数最少的输入装置为备选目标输入装置。由于第一状态信息中的被累计连接次数小于第二状态信息中的被累计连接次数,因此,路由器50可确定第一状态信息所对应的第一输入装置为备选目标输入装置,进而,路由器50可确定第一输入装置为该目标输入装置。
在一实施例中,第一输入装置集合中可能存在至少两个状态信息中最近一次连接是否有待处理数据为第一标识值,且被累计连接次数均为最少并相等,此时,路由器50可确定备选目标输入装置中的任一个作为该目标输入装置。
例如,若第一状态信息中的最近一次连接是否有待处理数据为第一标识值且被累计连接次数为2,第二状态信息中的最近一次连接是否有待处理数据为第一标识值且被累计连接次数为2,第三状态信息中的最近一次连接是否有待处理数据为第二标识值且被累计连接次数为2。由于第一状态信息及第二状态信息中的最近一次连接是否有待处理数据为第一标识值,且被累计连接次数均为最少并相等。此时,路由器50可确定第一状态信息所对应的第一输入装置及第二状态信息所对应的第二输入装置中的任一个作为该目标输入装置。
在一实施例中,当状态信息中的最近一次连接是否有待处理数据为最近一次连接无待处理数据时,表示该状态信息所对应的输入装置在最近一次连接无待处理数据,因而,路由器50可在预设数量的输入装置中不包括最近一次连接有待处理的数据的情况下(即该预设数量的输入装置的最近一次连接均无待处理数据),从该预设数量的输入装置中确定被累计连接次数最少的输入装置作为该备选目标输入装置。
例如,路由器50中存储了第四输入装置对应的第四状态信息、第五输入装置对应的第五状态信息及第六输入装置对应的第六状态信息。其中,第四状态信息中的最近一次连接是否有待处理数据为第二标识值且被累计连接次数为3,第五状态信息中的最近一次连接是否有待处理数据为第二标识值且被累计连接次数为4,第六状态信息中的最近一次连接是否有待处理数据为第二标识值且被累计连接次数为2。此时,由于第六状态信息中的被累计连接次数最少,进而,路由器50可确定第六状态信息所对应的第六输入装置为备选目标输入装置,并可确定第六输入装置为该目标输入装置。在其他实施例中,若第六状态信息中的最近一次连接是否有待处理数据为第二标识值且被累计连接次数为3。路由器50可确定状态信息中被累计连接次数最少的第四输入装置及第六输入装置为备选目标输入装置,此时,路由器50可从第四输入装置及第六输入装置中确定任一个为该目标输入装置。
步骤104,更新所述目标输入装置的状态信息中的被累计连接次数。
当路由器50确定了目标输入装置时,如确定上述状态信息的最近一次连接是否有待处理数据为有待处理数据的第一输入装置为目标输入装置或确定上述状态信息的最近一次连接是否有待处理数据为无待处理数据的第四输入 装置为目标输入装置,路由器50则将第一输入装置所对应的第一状态信息的被累计连接次数加1,此时,第一输入装置所对应的第一状态信息的被累计连接次数则为3;路由器50亦可则将第四输入装置所对应的第四状态信息的被累计连接次数加1,此时,第四输入装置所对应的第四状态信息的被累计连接次数则为4。
步骤106,确定是否存在与所述目标输入装置相关联的待处理数据;当存在与所述目标输入装置相关联的待处理数据时,完成所述待处理数据的处理。
本实施例中,在确定了目标输入装置后,路由器50还确定是否存在与该目标输入装置相关联的待处理数据(即路由器50确定当前是否存在与目标状态信息相关联的待传输数据),若存在,表示该目标状态信息所对应的输入装置40已传输待处理数据至路由器50,此时,为减少因可能无法在分配的时间内完成待传输数据的处理而导致数据丢失的不足,路由器50在完成与该目标状态信息相关联的待处理数据的处理后,再可返回步骤102继续执行。本实施例中,路由器50可将与该目标状态信息相关联的待处理数据传输至显示终端60,以进行显示。
在一实施例中,当路由器50中存在与目标输入装置相关联的待处理数据时,路由器50更新该目标输入装置的状态信息中的最近一次连接是否有待处理数据为最近一次连接有待处理数据。当路由器50中不存在与目标输入装置相关联的待处理数据时,路由器50更新该目标输入装置的状态信息中的最近一次连接是否有待处理数据为最近一次连接无待处理数据。
例如,若第一输入装置为目标输入装置时,若路由器50中不存在与第一输入装置相关联的待处理数据,此时,路由器50可设置第一输入装置所对应的第一状态信息中的最近一次连接是否有待处理数据为最近一次连接无待处理数据,如路由器50可设置第一输入装置所对应的第一状态信息中的最近一次连接是否有待处理数据为第二标识值;若第四输入装置为目标输入装置时,当路由器50中存在与第四输入装置相关联的待处理数据时,路由器50可设置第四输入装置所对应的第四状态信息中的最近一次连接是否有待处理数据为最近一次连接有待处理数据,如路由器50可设置第四输入装置所对应的第四状态信息中的最近一次连接是否有待处理数据为第一标识值。
在本实施例中,由于状态信息的被累计连接次数以六个字的二进制来表示,其最大的值为63(十进制),因此,当状态信息所对应的接入装置被累计连接的次数大于63时,状态信息的被累计连接次数则会产生溢出,此时,路由器50可控制对预设数量的输入装置的状态信息进行初始化操作。例如,当第三状态信息的被累计连接次数为63时,若第三状态信息确定为目标状态信息且路由器50中存在与第三状态信息相关联的待传输数据,路由器50将第三状态信息的被累计连接次数加1后,第三状态信息的被累计连接次数则发生溢出,可能会导致第三信息的被累计连接次数由63变为0,此时,路由器50则对预设数量的输入装置的状态信息进行初始化操作。
上述连接控制方法通过优先确定预设数量的输入装置所对应的状态信息中的最近一次连接是否有待处理数据为有待处理数据且被累计连接次数最少的输入装置为目标输入装置,并完成与目标状态信息相关联的待传输数据的处理,如此,可减少路由器处理没有待处理数据的接入装置的时间而带来的资源利用率的浪费,亦可减少因可能无法在分配的时间内完成待传输数据的处理而导致数据丢失的不足。另外,上述连接控制方法通过确定预设数量的输入装置所对应的状态信息中的最近一次连接是否有待处理数据为无待处理数据且被累计连接次数最少的输入装置为目标输入装置,有利于提高系统的鲁莽性及路由器资源分配的公平性。
请参阅图3,所示为本申请其中的一实施例中的连接控制方法的步骤流程图。该连接控制方法包括如下步骤:
步骤200,控制预设数量的输入装置的状态信息的初始化操作。
请一并参阅图4,所示为本申请其中的一实施例中预设模型的初始化操作的示意图。
本实施例中,路由器50控制预设数量的输入装置的状态信息的初始化操作包括设置每一状态信息中的最近一次连接是否有待处理数据(标识部)及被累计连接次数(计数部)。例如,路由器50可存储10个输入装置的状态信息,分别表示为第一状态信息至第十状态信息,每一状态信息的标识部均可初始化为十进制1,每一状态信息的计数部均初始化为十进制0,即每一状态信息可表示为“1/0”。
步骤202,获取所述预设数量的输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数。
在初始化预设数量的输入装置的状态信息后,路由器50可获取每一状态信息。
步骤204,根据预设模型对所述预设数量的输入装置的状态信息值进行建模,其中,每一输入装置的状态信息包括状态信息值。
本实施例中,由于每一输入装置的状态信息可最近一次连接是否有待处理数据及被累计连接次数,如初始化操作时状态信息可表示为“1/0”。路由器50根据状态信息的表示确定为每一输入装置的状态信息值。其中,最近一次连接有待处理数据的输入装置的状态信息值(如设置最近一次连接有待处理数据为“1”)大于最近一次连接无待处理数据的输入装置的状态信息值(如设置最近一次连接无待处理数据为“0”);对于最近一次连接均有待处理数据的输入装置,被累计连接次数越多,则状态信息值越小;对于最近一次连接均无待处理数据的输入装置,被累计连接次数越多,则状态信息值越小。
在本实施例中,路由器50可根据预设模型对所述预设数量的输入装置的状态信息值进行建模。例如,路由器50可根据二叉树模型对预设数量的输入装置的状态信息值进行建模,其中,二叉树模型包括一个根节点、多个子节点及多个叶节点。在初始化操作后,每一状态信息值均相同,因此,路由器50可根据二叉树模型随机选择对应节点上的状态信息值。例如,第一状态信息值可为根节点,第二状态信息值(左孩子节点)及第三状态信息值(右孩子节点)为第一状态信息值的子节点,第四状态信息值(左孩子节点)及第五状态信息值(右孩子节点)为第二状态信息值的子节点,第六状态信息值(左孩子节点)及第七状态信息值(右孩子节点)为第三状态信息值的子节点,第八状态信息值(左孩子节点)及第九状态信息值(右孩子节点)为第四状态信息值的子节点,第十状态信息值(左孩子节点)为第五状态信息值的子节点,其中,第六状态信息值、第七状态信息值、第八状态信息值、第九状态信息值及第十状态信息值亦为叶节点。
在一实施例中,路由器50可控制该预设模型中的状态信息值以最大堆排序方式进行排序,其中,最大堆排序表示为二叉树的父节点的状态信息值大于 (亦或者不小于)其左右孩子节点的状态信息值。
步骤206,确定所述预设模型中位于目标位置的状态信息值所对应的输入装置为目标输入装置。
当路由器50控制预设数量的输入装置以状态信息值的最大堆排序时,位于预设模型的根节点位置(即堆顶的位置)可表示状态信息值最大的目标位置,因此,路由器50可将预设模型中位于根节点位置处的状态信息值所对应的输入装置确定为该目标输入装置。在其他实施例中,路由器50亦可通过其他模型来对预设数量的输入装置的状态信息值进行建模,路由器50只需确定状态信息值最大的状态信息值所对应的输入装置为该目标输入装置即可。
步骤208,判断是否存在与所述目标输入装置相关联的待传输数据;当存在与所述目标信息相关联的待传输数据时,执行步骤210;当不存在与所述目标信息相关联的待传输数据时,执行步骤212。
本实施例中,当路由器50接收到输入装置40的待传输数据时,路由器50可将该输入装置的待传输数据与对应的状态信息进行关联。若存在,表示该目标状态信息所对应的输入装置40已传输待处理数据至路由器50,因此,路由器50进行待传输数据的处理;若不存在,路由器50执行步骤212。
步骤210,处理所述待传输数据。
在路由器50中存在与目标输入装置相关联的待传输数据时,路由器50可先完成该待传输数据的处理,以减少因可能无法在分配的时间内完成待传输数据的处理而导致数据丢失的不足。
步骤212,更新所述目标输入装置的状态信息值。
当确定该目标输入装置时,路由器50将更新目标输入装置的状态信息中的最近一次连接是否有待处理数据及被累计连接次数,以达到更新该目标输入装置的状态信息值的目的。本实施例中,路由器50将目标输入装置的状态信息中的被累计连接次数增加1,路由器50还根据是否存在与目标输入装置相关联的状态信息来设置最近一次连接是否有待数据。在确定路由器50中存在与目标输入装置相关联的待处理数据时,路由器50则设置目标输入装置的状态信息中的最近一次连接是否有待处理数据设置为第一标识值;在确定路由器50中不存在与目标输入装置相关联的待处理数据时,路由器50则设备目标输 入装置的状态信息中的最近一次连接是否有待处理数据设置为第二标识值。
请一并参阅图5,所示为本申请其中的一实施例中更新预设模型的示意图。当确定第一状态信息值所对应的第一输入装置为目标输入装置,且路由器50内不存在与第一输入装置相关联的待处理数据时,路由器50可将第一输入装置的状态信息中的最近一次连接是否有待处理数据设置为“0”(十进制),并将第一输入装置的状态信息中的被累计连接次数增加1,因此,第一输入装置的状态信息值可表示为为“0/1”。
请一并参阅图6,所示为本申请其中的一实施例中更新预设模型的示意图。当确定第二状态信息值所对应的第二输入装置为目标输入装置,且路由器50内存在与第二输入装置相关联的待处理数据时,路由器50可将第二输入装置的状态信息中的最近一次连接是否有待处理数据设置为“1”(十进制),并将第一输入装置的状态信息中的被累计连接次数增加1,因此,第一输入装置的状态信息值可表示为为“1/1”。
步骤214,判断所述预设数量的输入装置中任一输入装置被累计连接次数是否超过阈值;当所述预设数量的输入装置中任一输入装置被累计连接次数超过阈值时,返回步骤200;当所述预设数量的输入装置中每一输入装置被累计连接次数均没有超过阈值时,执行步骤216。
在本实施例中,由于状态信息的被累计连接次数以六个字的二进制来表示,其最大的值为63(十进制),因此,当状态信息所对应的接入装置被累计连接的次数大于63时,状态信息的被累计连接次数则会产生溢出,此时,路由器50可返回步骤200,以控制对预设数量的输入装置的状态信息进行初始化操作。例如,当第三状态信息的被累计连接次数为63时,若第三状态信息确定为目标状态信息且路由器50中存在与第三状态信息相关联的待传输数据,路由器50将第三状态信息的被累计连接次数加1后,第三状态信息的被累计连接次数则发生溢出,可能会导致第三信息的被累计连接次数由63变为0,此时,路由器50则对预设数量的输入装置的状态信息进行初始化操作。在所述预设数量的输入装置中每一输入装置被累计连接次数均没有超过阈值时,表示路由器50可继续处理预设数量的输入装置所对应的待传输数据。
步骤216,更新所述预设模型中各状态信息值的位置。
由于路由器50根据状态信息值以二叉树的最大堆来调整预设模型中各状态信息值的位置,在更新目标输入装置的状态信息值后,目标输入装置的状态信息值可能发生变化,因此,路由器50需要更新预设模型中各状态信息值的位置,以便再进行后续的处理,如返回步骤206继续执行。
由于最近一次连接有待处理数据的输入装置的状态信息值大于最近一次连接无待处理数据的输入装置的状态信息值;对于最近一次连接均有待处理数据的输入装置,被累计连接次数越多,则状态信息值越小;对于最近一次连接均无待处理数据的输入装置,被累计连接次数越多,则状态信息值越小。
如图5所示,当第一状态信息值更新为“0/1”时,更新后的第一状态信息值比第二状态信息值“1/0”、第四状态信息值“1/0”及第八状态信息值“1/0”小,因此,路由器50将更新后的第一状态信息值调整至原第八状态信息值的位置处,进而,使得第一状态信息为第八状态信息的左孩子节点。
如图6所示,当第二状态信息值更新为“1/1”时,更新后的第二状态信息值比第四状态信息值“1/0”及第八状态信息值“1/0”小,因此,路由器50将更新后的第二状态信息值调整至原第九状态信息值的位置处,进而使得第二状态信息为第九状态信息的右孩子节点。
上述连接控制方法通过确定以最大堆排序的二叉树中根节点位置处的状态信息值所对应的输入装置为目标输入装置,并完成与目标状态信息相关联的待传输数据的处理,如此,可减少路由器处理没有待处理数据的接入装置的时间而带来的资源利用率的浪费,亦可减少因可能无法在分配的时间内完成待传输数据的处理而导致数据丢失的不足。上述连接控制方法还可确定目标输入装置的状态信息是否会发生溢出,并在目标输入装置的状态信息时进行初始化操作,如此,在某些极端情况下导致堆顶的写字板一直有数据在书写,而其他写字板节点处于没有数据传输状态,有利于避免路由器被一个写字板一直独占的可能。
请参阅图7,所示本申请的一实施例中路由器的硬件结构示意图。如图7所示,所述路由器50可应用上述的各实施例,下面对本申请所提供的路由器50进行描述,所述路由器50可以包括处理器500、存储装置502及通信接口504,以及存储在所述存储装置502中并可向所述处理器500上运行的计算机 程序(指令),所述路由器50还可以包括其他的硬件部分,在此不再赘述。所述处理器500可通过总线506与存储装置502及通信接口504进行数据交换。
所述处理器500可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述路由器50的控制中心,利用各种接口和线路连接整个路由器50的各个部分。
所述存储装置502可用于存储所述计算机程序和/或模块,所述处理器500通过运行或执行存储在所述存储装置502内的计算机程序和/或模块,以及调用存储在存储装置502内的数据,实现所述连接控制方法的各种功能。所述存储装置502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等。此外,存储装置502可以包括高速随机存取存储装置,还可以包括非易失性存储装置,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储装置件、闪存器件、或其他易失性固态存储装置件。
所述通信接口504可以是蓝牙接口,以使得路由器50可通过蓝牙与输入装置进行数据交换。在其他实施例中,所述通信接口504可为其他类型的无线通信接口或有线通信接口等。
所述处理器500通过读取存储装置502中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行前面任一实施例中路由器所执行的连接控制方法。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在 具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (23)

  1. 一种连接控制方法,应用于路由器,其特征在于,所述连接控制方法包括:
    获取预设数量的输入装置中每个输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数;
    根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置;
    确定是否存在与所述目标输入装置相关联的待处理数据;
    当存在与所述目标输入装置相关联的待处理数据时,完成所述待处理数据的处理。
  2. 如权利要求1所述的连接控制方法,其特征在于,所述根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置之后,还包括:
    更新所述目标输入装置的状态信息中的被累计连接次数。
  3. 如权利要求1所述的连接控制方法,其特征在于,所述确定是否存在与所述目标输入装置相关联的待处理数据之后,还包括:
    当存在与所述目标输入装置相关联的待处理数据时,更新所述目标输入装置的状态信息中的最近一次连接是否有待处理数据为:最近一次连接有待处理数据;
    当不存在与所述目标输入装置相关联的待处理数据时,更新所述目标输入装置的状态信息中的最近一次连接是否有待处理数据为:最近一次连接无待处理数据。
  4. 如权利要求1所述的连接控制方法,其特征在于,所述根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置,具体包括:
    在所述预设数量的输入装置中包括最近一次连接有待处理数据的第一输入装置集合的情况下,从所述第一输入装置集合中确定被累计连接次数最少的输入装置作为备选目标输入装置;
    在所述预设数量的输入装置中不包括最近一次连接有待处理数据的情况下,从所述预设数量的输入装置中确定被累计连接次数最少的输入装置作为所述备选目标输入装置;
    确定所述备选目标输入装置中的任一个作为目标输入装置。
  5. 如权利要求1所述的连接控制方法,其特征在于,所述预设数量的输入装置的状态信息包括状态信息值;最近一次连接有待处理数据的输入装置的状态信息值大于最近一次连接无待处理数据的输入装置的状态信息值;对于最近一次连接均有待处理数据的输入装置,被累计连接次数越多,则状态信息值越小;对于最近一次连接均无待处理数据的输入装置,被累计连接次数越多,则状态信息值越小;
    所述根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置包括:
    确定状态信息值最小的输入装置为所述目标输入装置。
  6. 如权利要求5所述的连接控制方法,其特征在于,
    根据预设模型对所述预设数量的输入装置的状态信息值进行建模;
    确定所述预设模型中位于目标位置的状态信息值对应的输入装置为所述目标输入装置。
  7. 如权利要求6所述的连接控制方法,其特征在于,所述预设模型为二叉树模型,所述目标位置为所述二叉树模型的根节点。
  8. 根据权利要求6所述连接控制方法,其特征在于,所述确定所述预设模型中位于目标位置的状态信息值对应的输入装置为所述目标输入装置之后,还包括:
    更新所述目标输入装置的状态信息值;
    更新所述预设模型中各状态信息值的位置。
  9. 如权利要求8所述的连接控制方法,其特征在于,所述更新所述预设模型中各状态信息值的位置,具体包括:
    控制所述预设模型中的状态信息值以最大堆排序方式进行排序。
  10. 如权利要求3或4所述的连接控制方法,其特征在于,所述获取预设数量的输入装置的状态信息之前,还包括:
    控制对所述预设数量的输入装置的状态信息执行初始化操作。
  11. 如权利要求1所述的连接控制方法,其特征在于,所述处理所述待处理数据之后,还包括:
    在所述预设数量的输入装置中任一输入装置被累计连接次数超过阈值的情况下,重置所述预设数量的输入装置中每个输入装置的状态信息。
  12. 如权利要求1所述的连接控制方法,其特征在于,所述输入装置为写字板,所述路由器为蓝牙路由器。
  13. 一种路由器,其特征在于,所述路由器包括:
    存储器,存储预设数量的输入装置中每一输入装置的状态信息,所述状态信息包括最近一次连接是否有待处理数据及被累计连接次数;
    处理器,连接于所述存储器,所述处理器根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置;所述处理器还确定是否存在与所述目标输入装置相关联的待处理数据;当存在与所述目标输入装置相关联的待处理数据时,所述处理器完成所述待处理数据的处理。
  14. 如权利要求13所述的路由器,其特征在于,所述处理器在根据每一状态信息确定所述预设数量的输入装置中的一个为目标输入装置之后,所述处理器还更新所述目标输入装置的状态信息中的被累计连接次数。
  15. 如权利要求13所述的路由器,其特征在于,所述处理器在确定是否存在与所述目标输入装置相关联的待处理数据之后,所述处理器还用于在存在与所述目标输入装置相关联的待处理数据时更新所述目标输入装置的状态信息中的最近一次连接是否有待处理数据为最近一次连接有待处理数据;所述处理器还用于在不存在与所述目标输入装置相关联的待处理数据时更新所述目标输入装置的状态信息中的最近一次连接是否有待处理数据为最近一次连接无待处理数据。
  16. 如权利要求13所述的路由器,其特征在于,在所述预设数量的输入装置中包括最近一次连接有待处理数据的第一输入装置集合的情况下,所述处理器从所述第一输入装置集合中确定被累计连接次数最少的输入装置作为备选目标输入装置;
    在所述预设数量的输入装置中不包括最近一次连接有待处理数据的情况下,所述处理器从所述预设数量的输入装置中确定被累计连接次数最少的输入装置作为所述备选目标输入装置;
    所述处理器确定所述备选目标输入装置中的任一个作为目标输入装置。
  17. 如权利要求13所述的路由器,其特征在于,所述预设数量的输入装置 的状态信息包括状态信息值;最近一次连接有待处理数据的输入装置的状态信息值大于最近一次连接无待处理数据的输入装置的状态信息值;对于最近一次连接均有待处理数据的输入装置,被累计连接次数越多,则状态信息值越小;对于最近一次连接均无待处理数据的输入装置,被累计连接次数越多,则状态信息值越小;
    所述处理器确定状态信息值最小的输入装置为所述目标输入装置。
  18. 如权利要求17所述的路由器,其特征在于,所述处理器根据预设模型对所述预设数量的输入装置的状态信息值进行建模;所述处理器还用于确定所述预设模型中位于目标位置的状态信息值对应的输入装置为所述目标输入装置。
  19. 如权利要求18所述的路由器,其特征在于,所述预设模型为二叉树模型,所述目标位置为所述二叉树模型的根节点。
  20. 根据权利要求18所述路由器,其特征在于,所述处理器确定所述预设模型中位于目标位置的状态信息值对应的输入装置为所述目标输入装置之后,所述处理器还更新所述目标输入装置的状态信息值,还用于更新所述预设模型中各状态信息值的位置。
  21. 如权利要求20所述的路由器,其特征在于,所述处理器在更新所述预设模型中各状态信息值的位置时,所述处理器控制所述预设模型中的状态信息值以最大堆排序方式进行排序。
  22. 如权利要求13所述的路由器,其特征在于,所述处理器在处理所述待处理数据之后,所述处理器还在所述预设数量的输入装置中任一输入装置被累计连接次数超过阈值的情况下重置所述预设数量的输入装置中每一输入装置的状态信息。
  23. 一种计算机可读存储介质,存储有计算机指令,其特征在于,所述计算机指令被处理器执行时实现如权利要求1至12中任意一项所述的连接控制方法。
PCT/CN2019/078029 2019-03-13 2019-03-13 连接控制方法、路由器及计算机可读存储介质 Ceased WO2020181534A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980073398.2A CN113557698A (zh) 2019-03-13 2019-03-13 连接控制方法、路由器及计算机可读存储介质
PCT/CN2019/078029 WO2020181534A1 (zh) 2019-03-13 2019-03-13 连接控制方法、路由器及计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/078029 WO2020181534A1 (zh) 2019-03-13 2019-03-13 连接控制方法、路由器及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020181534A1 true WO2020181534A1 (zh) 2020-09-17

Family

ID=72426332

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/078029 Ceased WO2020181534A1 (zh) 2019-03-13 2019-03-13 连接控制方法、路由器及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN113557698A (zh)
WO (1) WO2020181534A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150365329A1 (en) * 2014-06-13 2015-12-17 D.E. Shaw Research, Llc Inverse weighted arbitration
CN105721341A (zh) * 2016-01-28 2016-06-29 苏黎 一种路由器网络资源分配的方法及路由器
CN105871753A (zh) * 2015-11-30 2016-08-17 乐视致新电子科技(天津)有限公司 路由器带宽管理方法、装置及路由器
CN107820281A (zh) * 2017-11-13 2018-03-20 上海斐讯数据通信技术有限公司 一种分配网络资源的方法和路由器

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6378057B2 (ja) * 2014-11-13 2018-08-22 株式会社東芝 接続制御装置、接続制御方法、接続制御システムおよびコンピュータプログラム
CN105491642B (zh) * 2015-11-25 2019-09-10 小米科技有限责任公司 网络连接的方法和装置
CN108174017A (zh) * 2017-11-29 2018-06-15 维沃移动通信有限公司 一种蓝牙开启方法及移动终端
CN108696917B (zh) * 2018-06-12 2021-01-12 Oppo广东移动通信有限公司 通信连接方法、装置、电子装置及计算机可读介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150365329A1 (en) * 2014-06-13 2015-12-17 D.E. Shaw Research, Llc Inverse weighted arbitration
CN105871753A (zh) * 2015-11-30 2016-08-17 乐视致新电子科技(天津)有限公司 路由器带宽管理方法、装置及路由器
CN105721341A (zh) * 2016-01-28 2016-06-29 苏黎 一种路由器网络资源分配的方法及路由器
CN107820281A (zh) * 2017-11-13 2018-03-20 上海斐讯数据通信技术有限公司 一种分配网络资源的方法和路由器

Also Published As

Publication number Publication date
CN113557698A (zh) 2021-10-26

Similar Documents

Publication Publication Date Title
US9311110B2 (en) Techniques to initialize from a remotely accessible storage device
CN108323200B (zh) 基于区块链的数据训练方法、装置、存储介质及区块链节点
US9467511B2 (en) Techniques for use of vendor defined messages to execute a command to access a storage device
CN110825440B (zh) 指令执行方法和装置
CN108924250A (zh) 基于区块链的业务请求处理方法、装置和计算机设备
CN112506581B (zh) 渲染小程序的方法、装置、电子设备和可读存储介质
WO2020119029A1 (zh) 分布式任务调度方法、系统及存储介质
CN107317853A (zh) 消息弹窗动效展示方法、装置及系统
US20180227249A1 (en) Adjusting buffer size for network interface controller
CN109558159B (zh) 游戏中用户界面的更新方法和装置
CN111736871A (zh) Fpga芯片的升级方法、装置及系统
CN116561030A (zh) 一种数据传输方法、装置、设备及介质
CN112015098A (zh) 智能家居设备的系统升级方法、装置及电子设备
CN110544159A (zh) 一种地图信息处理方法、装置、可读存储介质和电子设备
WO2020181534A1 (zh) 连接控制方法、路由器及计算机可读存储介质
CN114546457A (zh) 多版本应用的插件实现方法、电子设备及存储介质
CN113810392A (zh) 一种海量数据的top排名方法、设备及存储介质
CN111984202A (zh) 一种数据处理方法、装置、电子设备和存储介质
CN112650763A (zh) 产品额度的配置方法、相关设备和存储介质
CN119538459A (zh) 一种设备拓扑模拟方法、装置、芯片、介质及电子设备
CN114006862B (zh) 报文转发方法、装置和设备及计算机存储介质
WO2020220272A1 (zh) 更改资源状态的方法、系统、终端及存储介质
CN112860449B (zh) 一种防止消息超时导致重启的方法、系统、设备及介质
CN109189378B (zh) 一种数据处理方法及相关装置
CN114401267B (zh) 云应用登录方法、装置、设备、介质及程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19918671

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19918671

Country of ref document: EP

Kind code of ref document: A1