Channel usage methods, electronic devices, and computer storage media

By allocating time slices for itself and slave devices and sequentially occupying channels to send data, the conflict problem in multi-device co-channel communication is resolved, achieving stable communication and dynamic device addition.

CN116232556BActive Publication Date: 2025-11-14ECOFLOW INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310304422.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2025-11-14
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

In outdoor point-to-point communication, conflicts can easily occur when multiple devices use the same LoRa channel simultaneously, leading to data loss.

Method used

The base station allocates time slices to itself and its slave devices according to the preset time slice allocation rules, controls each device to occupy the channel in sequence to transmit data, and detects the addition of new devices after the last slave device releases the channel, dynamically adjusting the time slice allocation to avoid conflicts.

Benefits of technology

It enables stable communication between the base station and multiple slave devices on the same channel, avoiding data loss, while allowing more devices to join and meeting communication needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232556B_ABST
    Figure CN116232556B_ABST
Patent Text Reader

Abstract

This application relates to the field of communications, providing a channel usage method, an electronic device, and a computer storage medium. In this application, during each channel occupancy cycle, the base station prioritizes using the channel within its allocated time slot to transmit data. After this, the channel is released, allowing other joined slave devices to sequentially occupy the channel and transmit data according to their allocated time slots. After the last joined slave device releases its channel, newly joined devices are detected, and time slots are allocated to them according to a preset time slot allocation rule. Thus, the base station and slave devices can determine their respective time slots according to the preset time slot allocation rule and transmit data sequentially. Furthermore, after the data transmission in the current channel occupancy cycle is completed, more slave devices can join, satisfying the need for the base station and multiple slave devices to communicate using the same channel while avoiding data loss due to conflicts when transmitting data on the same channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communications, and more specifically to a method for using a channel, an electronic device, and a computer storage medium. Background Technology

[0002] Currently, most outdoor point-to-point communication solutions use Long Range Radio (Lora) channels. Lora channels are widely used due to their long range and low power consumption. However, the physical layer of Lora lacks specific protocols for collision detection and avoidance within the same channel. Therefore, when multiple devices communicate simultaneously using the same channel—for example, when a base station, acting as a master device, needs to communicate with multiple slave devices—multiple devices typically need to communicate on the same channel to avoid frequent channel switching by the base station. This can easily lead to collisions caused by multiple devices simultaneously transmitting data, resulting in data loss. Summary of the Invention

[0003] In view of the above, it is necessary to provide a channel usage method, electronic device, and computer storage medium to solve the technical problem of data not being received due to channel usage conflicts.

[0004] In a first aspect, this application provides a channel usage method applied in a base station, whereby the base station, as a master device, can establish communication with multiple slave devices. The method includes: occupying a channel for data transmission according to a time slice allocated to the base station; wherein the time slice represents the maximum time each device can occupy the channel; releasing the channel after the channel is fully occupied; controlling the joined slave devices to occupy the channel sequentially according to the allocated time slices for data transmission; after the last joined slave device releases the channel, detecting whether a new device has joined; if a new device has joined, allocating a time slice for the new device according to a preset time slice allocation rule and recording the new device.

[0005] In the above method, the base station prioritizes occupying the channel to transmit data in the time slot allocated to it each time. After the data transmission is completed, the channel is released, and other joined slave devices occupy the channel in turn according to their allocated time slots to transmit data. After the last joined slave device releases the channel, the newly joined device is detected and a time slot is allocated to it according to the preset time slot allocation rules. In this way, the base station and slave devices can determine their respective time slots according to the preset time slot allocation rules and transmit data in turn. At the same time, after the current round of data transmission is completed, more slave devices can be accepted to join. This satisfies the need for the base station and multiple slave devices to communicate using the same channel, while avoiding data loss caused by conflicts when transmitting data on the same channel.

[0006] Secondly, this application provides an electronic device, including: a memory for storing program instructions; and a processor for reading and executing the program instructions stored in the memory, wherein when the program instructions are executed by the processor, the electronic device performs the aforementioned channel usage method.

[0007] Thirdly, this application provides a computer storage medium storing program instructions that, when executed on an electronic device, cause the electronic device to perform the aforementioned channel usage method. Attached Figure Description

[0008] Figure 1 This is an application scenario diagram of a channel usage method in one embodiment of this application.

[0009] Figure 2 This is a flowchart of a channel usage method in one embodiment of this application.

[0010] Figure 3 This is a schematic diagram of time slices allocated to a base station in one embodiment of this application.

[0011] Figure 4 This is a flowchart illustrating the steps of a base station controlling joined slave devices to sequentially occupy channels and transmit data according to allocated time slices in one embodiment of this application.

[0012] Figure 5 This is a flowchart illustrating the steps of a base station detecting whether a new device has been added, according to one embodiment of this application.

[0013] Figure 6 This is a flowchart illustrating the steps of a base station allocating a time slice to a new device and recording the new device according to a preset time slice allocation rule in one embodiment of this application.

[0014] Figure 7 This is a schematic diagram of a preset command format in one embodiment of this application.

[0015] Figure 8 This is a schematic diagram of a channel usage device provided in an embodiment of this application.

[0016] Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0017] To better understand the above-mentioned objectives, features and advantages of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing an embodiment in one instance only and is not intended to be limiting of the application.

[0019] It should be noted that the terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, and not to describe a specific order or sequence. In the embodiments of this application, the words "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0020] It should also be noted that the methods disclosed in the embodiments of this application or the methods shown in the flowcharts include one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchanged, and some steps can be deleted. Some embodiments will be described below with reference to the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0021] refer to Figure 1The diagram illustrates an application scenario of a channel usage method according to an embodiment of this application. This method is applied in a base station 10. The base station 10, as a master device, can establish communication connections with multiple slave devices 20. In one embodiment of this application, the base station 10 can use a Long Range Radio (Lora) channel to communicate with the slave devices 20 simultaneously using the same channel. The base station 10 allocates time slots to itself and the slave devices 20 that are already connected to it according to a preset time slot allocation rule, and controls the base station 10 and the slave devices 20 to occupy the channel sequentially according to the allocated time slots for data transmission. The slave devices 20 interact with the base station 10 and, under the control of the base station 10, occupy the channel to complete the transmission of their data. In one embodiment of this application, the base station 10 may include a Lora base station, and the slave devices 20 may include any one or more electronic devices such as mobile energy storage devices, home energy storage devices, portable air conditioners, lawnmowers, and sweepers. In some scenarios, base station 10 needs to act as a master device to communicate with multiple slave devices 20 in a one-to-many manner. In this case, to avoid frequent switching between different channels, base station 10 and the multiple slave devices 20 can communicate on a fixed channel. However, this can easily lead to data collisions caused by multiple devices simultaneously transmitting data, resulting in data loss. Therefore, this application provides a channel usage method to solve this problem. (See reference...) Figure 2 The diagram shown is a flowchart of a channel usage method in one embodiment of this application. This method is applied to a base station (e.g., as shown in the image). Figure 1 (Base station 10 shown). The method includes the following steps.

[0022] Step S201: According to the time slice allocated to the base station, occupy a channel for data transmission; wherein, the time slice is used by each device to represent the maximum time to occupy the channel.

[0023] In one embodiment of this application, base station 10 allocates time slots sequentially to base station 10 and slave devices 20 that have joined base station 10, and base station 10 and slave devices 20 that have joined base station 10 sequentially occupy channels to transmit data. In one embodiment of this application, slave device 20 that has joined base station 10 refers to a device that has established a communication connection with base station 10. (See reference...) Figure 3 The diagram shown illustrates a time slice allocated by base station 10 in one embodiment of this application. The time slices allocated by base station 10 have a preset duration, and there is a preset time interval between two time slices. In one embodiment of this application, the preset duration and preset time interval can be set as needed. In one embodiment of this application, the preset duration can be set to 100ms, and the preset time interval can be set to 2ms.

[0024] In one embodiment of this application, the transmission priority of the time slice allocated to base station 10 is higher than the transmission priority of the time slice of slave device 20. In a specific embodiment, considering that base station 10 needs to allocate channel time slices to other slave devices 20 as a master device, after each power-on, base station 10 allocates a first time slice for itself, and the first time slice has the highest transmission priority among all time slices allocated by base station 10. For example, base station 10 numbers the time slice allocated to itself as 00 and uses it as the first time slice, and numbers the time slices of slave device 20 as 01, 02, ..., and so on, according to the order in which slave device 20 joined base station 10.

[0025] It is understood that in other embodiments, after power-on, if necessary, the base station 10, as the master device, can also reallocate time slices to each device. That is, the transmission priority of the time slices allocated to each slave device 20 by the base station 10 can also be determined in other ways, and this application does not impose any particular restrictions on this. For example, when multiple slave devices 20 are all self-moving devices, the transmission priority of the time slice of the self-moving device currently performing a task can be higher than the time slice of the self-moving device in an idle state. As another example, when one of the slave devices 20 is an energy storage device and is supplying power to the base station 10, the transmission priority of the time slice of the energy storage device can be the highest.

[0026] In one embodiment of this application, the base station 10 can limit the number of slave devices 20 joining the base station 10, for example, limiting the maximum number of slave devices 20 allowed to join the base station 10 to 10. Since the more slave devices 20 joining the base station 10, the more devices need to occupy the channel, excessive channel occupation will affect the data communication latency. Therefore, by limiting the number of slave devices 20 joining the base station 10, this application can ensure stable and efficient operation of communication between the base station 10 and the slave devices 20.

[0027] In one embodiment of this application, when its own time slice arrives, base station 10 will occupy the channel to transmit data according to the time slice allocated to base station 10. For example, when base station 10's time slice arrives, base station 10 preempts the channel and checks whether there is data to be transmitted in base station 10's transmission buffer. If there is data to be transmitted, it will be transmitted directly through the channel.

[0028] Step S202: Release the channel after the channel has been occupied.

[0029] In one embodiment of this application, the method of releasing the channel after the channel is fully occupied by the base station 10 includes: the base station 10 confirms that the channel is fully occupied after completing data transmission or when the time slice of the base station 10 ends, and then releases the channel.

[0030] Step S203: Control the joined slave devices to occupy the channel in sequence according to the allocated time slices to send data.

[0031] In one embodiment of this application, after the base station 10 releases the channel, the channel is idle. Since time slots have been allocated to the joined slave devices 20, when the channel is idle, the base station 10 can sequentially notify each slave device 20 to start transmitting data on the channel according to the allocated time slots. Simultaneously, after each slave device 20 finishes transmitting data, or after the corresponding time slot ends, the base station 10 will confirm whether the channel has been released again. After the channel is released again, it will continue to notify the next slave device 20 to use the channel, until all joined slave devices 20 have transmitted data. By controlling the joined slave devices 20 to occupy the channel sequentially according to the allocated time slots, only one device will occupy the channel to transmit data within the same time slot. This avoids the technical problem of channel conflict and data loss caused by multiple slave devices 20 competing for data transmission.

[0032] Step S204: After the last joined slave device releases the channel, check if any new devices have joined.

[0033] In one embodiment of this application, base station 10 acts as the master device responsible for network formation, and slave devices 20 can apply to join the network of base station 10. To realize the networking function of base station 10, base station 10 allows new devices to join and establish communication connections with them. In one embodiment of this application, after the last joined slave device 20 releases the channel, base station 10 detects whether a new device has joined. If a new device joins, step S205 is executed. If no new device joins, the process returns to step S201. In one embodiment of this application, the channel is cyclically occupied. In this round of cycling, if no new device joins base station 10 after the last joined slave device 20 releases the channel, the channel occupancy control for this round of cycling ends, and base station 10 executes step S201 to begin the channel occupancy control for the next round of cycling.

[0034] Step S205: Allocate time slices to the new device according to the preset time slice allocation rules and record the new device.

[0035] As mentioned earlier, the channel is cyclically occupied. In this round of cyclical allocation, after the last joined slave device 20 releases the channel, if a new device joins base station 10, base station 10 needs to allocate a time slice for the new device. It can be understood that the newly joined device can immediately occupy the channel to transmit data when the current time slice arrives upon joining. In this case, base station 10 will return to step S201 after the newly joined device releases the channel, and begin the next round of channel cyclical allocation. Alternatively, the newly joined device can wait for the next round of cyclical allocation after the time slice is allocated, and then begin transmitting data in the time slice allocated to it. In this case, after allocating the time slice to the newly joined device, base station 10 will immediately return to step S201 without waiting for the new device to transmit data, and begin the next round of channel cyclical allocation.

[0036] by Figure 3 For example, if a slave device 20 joins and occupies time slot 02, while base station 10, as the master device, occupies time slot 01. In this cycle, base station 10 first occupies the channel in time slot 01 to transmit data. After data transmission is completed or time slot 01 ends (e.g., after 100ms), it releases the channel and notifies slave device 20 within 2ms. Slave device 20 then occupies the channel in time slot 02 to transmit data. After data transmission is completed or time slot 01 ends, it also releases the channel. At this point, time slot 03 begins. This time slot was not occupied in this cycle. In time slot 03, base station 10 checks if any new device requests to join. If so, it allocates a time slot, for example, time slot 03, to the new device. The new device can immediately transmit data during the remaining time of time slot 03, or it can choose not to occupy the channel in this cycle and wait for its own time slot in the next cycle before occupying the channel to transmit data.

[0037] In the method described above in this application, after the base station 10 has finished sending data using the channel within the time slot allocated to it, the channel is released and other joined slave devices 20 are allowed to use the channel to send data in sequence according to their allocated time slots. After the last joined slave device 20 releases its channel, the newly joined device is detected and a time slot is allocated to it according to a preset time slot allocation rule. In this way, the base station 10 and the slave devices 20 can determine their respective time slots according to the preset time slot allocation rule and send data in sequence. At the same time, after the current round of data transmission is completed, more slave devices 20 can be accepted for joining. This satisfies the need for the base station 10 and multiple slave devices 20 to communicate using the same channel, while avoiding data loss due to conflicts when sending data on the same channel.

[0038] In one embodiment of this application, the preset time slice allocation rule is as follows: the transmission priority of the time slice of the base station 10 is higher than the transmission priority of the time slice of any slave device 20; the transmission priority of the time slice of the slave device 20 is determined according to the joining order.

[0039] In one specific embodiment, the base station 10 allocates a time slice with a higher transmission priority than any slave device 20, and determines the transmission priority of the slave device 20's time slice according to the joining order. For example, if the first slave device 20 joins the base station 10 at a first time point and the second slave device 20 joins the base station 10 at a second time point, where the first time point is earlier than the second time point, then the base station 10 determines that the transmission priority of the first slave device 20's time slice is higher than the transmission priority of the second slave device 20 according to the joining order.

[0040] In one embodiment of this application, after the base station 10 has allocated a time slice to the new device, the base station 10 ends its control over the channel occupation in the current cycle, and the base station 10 will continue to execute step S201 to start the control of the channel occupation in the next cycle.

[0041] Please refer to Figure 4 The diagram shows a flowchart illustrating the steps of a base station controlling joined slave devices to sequentially occupy channels and transmit data according to allocated time slices in an embodiment of this application. This process includes the following detailed steps.

[0042] Step S401: Determine the next slave device occupying the channel as the target device based on the transmission priority of the time slice of the slave devices that have joined.

[0043] In one embodiment of this application, in the channel occupancy control of the current cycle, the base station 10 determines a slave device 20 that has not yet transmitted data in the current cycle as the target device based on the transmission priority of the time slice of the slave device 20 that has joined, so that the target device occupies the channel and transmits data.

[0044] Step S402: Send a start command to the target device to instruct the target device to occupy the channel according to the allocated time slice for data transmission.

[0045] In one embodiment of this application, the startup command carries the Media Access Control (MAC) address of the target device reported by the target device when it joins the base station 10. The base station 10 records this MAC address and uses it when it needs to send commands to the target device. After receiving the startup command, if the target device determines that the MAC address carried in the startup command matches its own MAC address, it sends a response to the startup command to the base station 10 and occupies the channel for data transmission. After completing data transmission, the target device releases the channel and sends a termination command to the base station 10. The termination command indicates that the channel has been occupied.

[0046] Step S403: If no response to the start command is received within the timeout period or an end command is received from the target device, it is determined that the channel has been released.

[0047] In one embodiment of this application, the termination command is used to indicate that the channel is fully occupied. "Timeout without receiving a response to the start command" means that the base station 10 does not receive a response to the start command after a preset time has elapsed since sending the start command. The preset time can be set as needed, for example, 10ms. In one embodiment of this application, if the target device leaves the communication area of ​​the base station 10, although the base station 10 has sent a start command to the target device, it cannot receive a response from the target device. Therefore, the base station 10 confirms that the target device has not occupied the channel and considers the channel to have been released. In one embodiment of this application, if the base station 10 receives the termination command from the target device, it will send a response to the termination command to the target device to indicate that the base station 10 has learned that the target device has completed data transmission.

[0048] Step S404: After determining that the channel has been released, continue to execute the step of determining the next slave device occupying the channel as the target device based on the transmission priority of the time slice of the slave devices that have joined the base station after the channel is released (i.e., step S401) until all slave devices that have joined the base station have been polled.

[0049] In this cycle, before all the slave devices 20 that have joined have sent data, each time the channel is released, the base station 10 will send a start command to the next target command until all slave devices 20 have sent data, and then the cycle ends.

[0050] After the last slave device 20 that has joined base station 10 releases the channel, base station 10 still needs to check if any new devices have joined. (Reference) Figure 5 The diagram shown is a flowchart illustrating the steps of base station 10 detecting whether a new device has joined in one embodiment of this application. These steps include the following:

[0051] Step S501: Send a new addition instruction; the new addition instruction is used to indicate the addition of a new device.

[0052] In one embodiment of this application, after the last slave device 20 that has joined base station 10 releases its channel, base station 10 sends a new device instruction. If a new device exists within the communication area of ​​base station 10, the new device can receive the new device instruction sent by base station 10 and send a response to base station 10. The response to the new device instruction carries the MAC address of the new device.

[0053] Step S502: Determine whether a response to the new instruction has been received.

[0054] In one embodiment of this application, if a response to the new instruction is received, the base station 10 executes step S503; if no response to the new instruction is received, the base station 10 executes step S504.

[0055] Step S503: Confirm that a new device has been added.

[0056] In one embodiment of this application, if base station 10 receives a response to a new addition instruction, it indicates that a new device has applied to join base station 10 within its communication area. Base station 10 determines that a new device has joined based on the response to the new addition instruction. In one embodiment of this application, after determining that a new device has joined, base station 10 allocates a time slice to the new device according to a preset time slice allocation rule and records the new device.

[0057] Step S504: Confirm that no new equipment has been added.

[0058] In one embodiment of this application, if base station 10 does not receive a response to the new device's addition instruction, it indicates that there is no new device applying to join base station 10 within the communication area of ​​base station 10. In one embodiment of this application, after determining that no new device has joined, base station 10 executes the step of occupying a channel according to the time slice allocated to base station 10 for data transmission (i.e., step S201) to start the control of the next round of channel occupation.

[0059] refer to Figure 6 The diagram shows a flowchart of the steps in which base station 10 allocates a time slice for a new device and records the new device according to a preset time slice allocation rule in one embodiment of this application. This step specifically includes the following detailed steps.

[0060] Step S601: Obtain the MAC address of the new device from the response to the new instruction.

[0061] In one embodiment of this application, the new device carries its own MAC address in the response to the new instruction from the base station 10, so that the base station 10 can obtain the MAC address of the new device from the response to the new instruction.

[0062] Step S602: Determine the target time slice to be allocated to the new device according to the preset time slice allocation rules.

[0063] In one embodiment of this application, base station 10 allocates a target time slice to a new device according to the order in which the devices join base station 10. Since the new device is the last device to join base station 10, the transmission priority of the target time slice allocated to the new device by base station 10 is the lowest among all time slice transmission priorities.

[0064] Step S603: Send a time slice allocation instruction to the new device; the time slice allocation instruction carries the number of the target time slice.

[0065] In one embodiment of this application, base station 10 numbers the target time slices according to the order in which devices join base station 10, and sends a time slice allocation instruction to the new devices, the instruction carrying the number of the target time slice. After receiving the time slice allocation instruction, the new device sends a response to base station 10 in response to the time slice allocation instruction.

[0066] Step S604: Upon receiving a response to the time slice allocation instruction, the number of the target time slice to be allocated is bound to the MAC address of the new device and recorded.

[0067] In one embodiment of this application, after the base station 10 binds and records the number of the allocated target time slice with the MAC address of the new device, the base station 10 ends the control of channel occupation in the current cycle, and the base station 10 executes step S201 to start the control of channel occupation in the next cycle.

[0068] In the next round of channel occupancy, after receiving the start command sent by base station 10, the new device occupies the channel to send data, thus accepting more devices to join base station 10 and communicating data through the control polling channel of base station 10. This satisfies the communication needs of multiple devices in the network when base station 10 is setting up a network.

[0069] In one embodiment of this application, the start command, start command response, end command, end command response, new command, new command response, time slice allocation command, time slice allocation command response, and transmitted data exchanged between the base station 10 and the slave device 20 are all encapsulated into frames using a preset command format before being transmitted. (See reference...) Figure 7 The diagram shown illustrates a preset command format in one embodiment of this application. The preset command format includes a frame header field (Head1), a frame length field (Length), a command field (Cmd), a type field (Type), a data content field (Data), and a checksum field (Crc8). The frame header field indicates the start of the frame and can be set to fixed characters, such as... Figure 7 The text shows "55" and "aa". The frame length field indicates the frame length. The command field indicates the command type. The data content field contains the frame's payload, i.e., the valid data. The checksum field indicates the frame's checksum.

[0070] In one embodiment of this application, the command type corresponding to the command field includes start command (start instruction / response to start instruction), end command (end instruction / response to end instruction), add command (add instruction / response to add instruction), allocate command (time slice allocation instruction / response to time slice allocation instruction), and data frame (data). For example, 0x01 in the command field indicates that the current frame is one of add instruction / response to add instruction, 0x02 indicates that the current frame is one of time slice allocation instruction / response to time slice allocation instruction, 0x03 indicates that the current frame is one of start instruction / response to start instruction, 0x4 indicates that the current frame is one of end instruction / response to end instruction, and 0x05 indicates that the current frame is a data frame. The type field indicates the instruction type corresponding to the command frame. It can be understood that if the current frame is a data frame, the type field can be ignored. Instruction types include request instructions and response instructions. For example, 01 in the type field indicates a request instruction, and 02 indicates a response instruction. For example, when the command field is 0x01 and the type field is 01, it indicates that the frame is a startup command, specifically a request instruction in the startup command, i.e., a new instruction.

[0071] refer to Figure 8 The diagram shown is a schematic of a channel usage device provided in an embodiment of this application. Specifically, the channel usage device 80 includes a data transmission module 801, a channel release module 802, a control module 803, a detection module 804, and an allocation module 805.

[0072] The data transmission module 801 is used to occupy a channel to transmit data according to the time slice allocated to the base station; wherein, the time slice is used by each device to represent the maximum time to occupy the channel.

[0073] The channel release module 802 is used to release the channel after it has been occupied.

[0074] The control module 803 is used to control the joined slave devices to occupy the channel in sequence according to the allocated time slices to send data.

[0075] The detection module 804 is used to detect whether a new device has joined after the last joined slave device releases the channel.

[0076] The allocation module 805 allocates time slices to new devices and records the new devices according to the preset time slice allocation rules.

[0077] It is understood that the module division described above is a logical functional division, and there may be other division methods in actual implementation. Furthermore, the functional modules in the various embodiments of this application can be integrated into the same processing unit, or each module can exist physically separately, or two or more modules can be integrated into the same unit. The integrated modules described above can be implemented in hardware or in a combination of hardware and software functional modules.

[0078] refer to Figure 9 The diagram shown is a schematic representation of an electronic device provided in an embodiment of this application. In one embodiment of this application, the electronic device 30 includes, but is not limited to, a memory 302, a processor 303, and a computer program, such as a channel usage program, stored in the memory 302 and executable on the processor 303.

[0079] Processor 303 can be a Central Processing Unit (CPU), or 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. The general-purpose processor can be a microprocessor or any conventional processor. Processor 303 is the computational core and control center of electronic device 30, connecting various parts of the electronic device 30 through various interfaces and lines, and acquiring the operating system of electronic device 30 and various installed application programs and program code.

[0080] Processor 303 acquires the operating system and various installed applications of electronic device 30. Processor 303 acquires these applications to implement the steps in the various channel usage method embodiments described above, for example... Figure 2 , Figure 4 , Figure 5 as well as Figure 6 .

[0081] The memory 302 can be used to store computer programs and / or modules. The processor 303 implements various functions of the electronic device 30 by running or retrieving the computer programs and / or modules stored in the memory 302, and by calling the data stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the in-vehicle equipment, etc. In addition, the memory 302 may include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.

[0082] The memory 302 can be an external memory and / or an internal memory of the electronic device 30. Furthermore, the memory 302 can be a memory in physical form, such as a memory stick, a TF card (Trans-flash Card), etc.

[0083] If the program code and various data in memory 302 are implemented as software functional units and sold or used as independent products, they 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, such as the channel method of a base station, can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is 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: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), etc.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.

Claims

1. A channel usage method, applied in a base station, wherein the base station, as a master device, is capable of establishing communication with multiple slave devices, characterized in that, The method includes: According to the time slot allocated to the base station, a channel is occupied for data transmission; wherein, the time slot is used to represent the maximum time each device occupies the channel; Release the channel after it has been occupied; The controlled slave devices occupy the channel sequentially according to the allocated time slices to transmit data; After the last joined slave device releases the channel, check if any new devices are joining. If a new device is added, a time slice is allocated to the new device according to the preset time slice allocation rules and the new device is recorded. When the new device joins, the new device is controlled to temporarily occupy the channel for data transmission during the allocated time slot.

2. The channel usage method as described in claim 1, characterized in that, The method further includes: If no new device joins, the step of occupying a channel to send data according to the time slice allocated to the base station is executed.

3. The channel usage method as described in claim 1, characterized in that, The detection of whether new equipment has been added includes: Send a new instruction; the new instruction is used to indicate the addition of a new device. If a response to the new instruction is received, it is determined that a new device has been added; If no response is received in response to the new instruction, it is determined that no new device has been added.

4. The channel usage method as described in claim 3, characterized in that, The step of allocating a time slice to the new device according to a preset time slice allocation rule and recording the new device includes: Obtain the MAC address of the new device from the response to the new instruction; The target time slice allocated to the new device is determined according to the preset time slice allocation rules; Send a time slice allocation instruction to the new device; the time slice allocation instruction carries the number of the target time slice; Upon receiving a response to the time slice allocation instruction, the number of the allocated target time slice is bound to the MAC address of the new device and recorded.

5. The channel usage method as described in claim 4, characterized in that, The preset time slice allocation rule is as follows: the transmission priority of the base station's time slice is higher than the transmission priority of any slave device's time slice; the transmission priority of the slave device's time slice is determined according to the order of joining.

6. The channel usage method as described in claim 5, characterized in that, The control of the joined slave devices to sequentially occupy the channel for data transmission according to the allocated time slices includes: After the channel is released, the next slave device occupying the channel is determined as the target device based on the transmission priority of the time slice of the slave devices that have joined. Send a start command to the target device to instruct the target device to occupy the channel for data transmission according to the allocated time slice; If no response to the start command is received within a timeout period or an end command is received from the target device, it is determined that the channel has been released; the end command is used to indicate that the channel has been occupied. Continue executing the step of determining the next slave device occupying the channel as the target device based on the transmission priority of the time slice of the already joined slave devices after the channel is released, until all the joined slave devices have been polled.

7. The channel usage method as described in claim 6, characterized in that, After the method controls the joined slave devices to sequentially occupy the channel according to the allocated time slices for data transmission, the method further includes: If all time slices have been allocated, stop detecting the addition of the new device.

8. The channel usage method as described in claim 1, characterized in that, The method further includes: After each power-on, a first time slice is allocated to the base station; the first time slice has the highest transmission priority among all time slices.

9. An electronic device, characterized in that, include: Memory, used to store program instructions; and A processor is configured to read and execute the program instructions stored in the memory, which, when executed by the processor, cause the electronic device to perform the channel usage method as described in any one of claims 1 to 8.

10. A computer storage medium, characterized in that, The computer storage medium stores program instructions that, when executed on an electronic device, cause the electronic device to perform the channel usage method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • LoRa star network time slot allocation method, device and system

    CN107396447A