CN117891329A - Wireless communication module, control method and device thereof, electronic equipment and medium - Google Patents

Wireless communication module, control method and device thereof, electronic equipment and medium Download PDF

Info

Publication number
CN117891329A
CN117891329A CN202410070446.5A CN202410070446A CN117891329A CN 117891329 A CN117891329 A CN 117891329A CN 202410070446 A CN202410070446 A CN 202410070446A CN 117891329 A CN117891329 A CN 117891329A
Authority
CN
China
Prior art keywords
thread
wireless communication
communication module
registration
current
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.)
Pending
Application number
CN202410070446.5A
Other languages
Chinese (zh)
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.)
Xian Fibocom Wireless Software Inc
Original Assignee
Xian Fibocom Wireless Software Inc
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 Xian Fibocom Wireless Software Inc filed Critical Xian Fibocom Wireless Software Inc
Priority to CN202410070446.5A priority Critical patent/CN117891329A/en
Publication of CN117891329A publication Critical patent/CN117891329A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a wireless communication module, a control method, a control device, electronic equipment and a medium thereof, relating to the technical field of wireless communication, wherein the method comprises the following steps: acquiring a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module; determining respective task trigger states of each registered thread according to a preset beat time interval by using a timer; if the task trigger state of the current registration thread is trigger, executing corresponding task operation by the current registration thread through the wireless communication module; the task operation period of one period communication function of the wireless communication module is used as a unified metronome, task operations of all period communication functions are uniformly aligned and managed, so that an operation behavior sequence meeting low-power-consumption triggering conditions is created to the maximum extent, the time for the wireless communication module to enter a low-power-consumption state is prolonged, and the power consumption of the wireless communication module is reduced.

Description

Wireless communication module, control method and device thereof, electronic equipment and medium
Technical Field
The present invention relates to the field of wireless communications technologies, and in particular, to a method and an apparatus for controlling a wireless communication module, an electronic device, and a computer readable storage medium.
Background
At present, for software in a wireless communication module of a notebook (namely a Personal Computer (PC)), each periodic communication function is in compliance with a timer during running, and after initialization is completed, the respective periodic communication function is scheduled by an operating system according to beats with fixed duration and completed on time. According to the design of the operating system, when each periodic communication function or task is in a waiting state, the operating system can enable the whole hardware system to enter a low-power standby mode so as to save power consumption. However, when the number of tasks in the wireless communication module is large, the system is often at least in a state of responding to and operating a certain task, so that it is difficult to enter a standby state, and a relatively high power consumption burden is generated. Therefore, how to increase the time for the wireless communication module to enter the low power consumption state and reduce the power consumption of the wireless communication module is an urgent problem to be solved nowadays.
Disclosure of Invention
The invention aims to provide a control method and device of a wireless communication module, the wireless communication module, electronic equipment and a computer readable storage medium, so as to improve the time of the wireless communication module entering a low-power-consumption state and reduce the power consumption of the wireless communication module.
In order to solve the above technical problems, the present invention provides a control method of a wireless communication module, including:
acquiring a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module;
determining respective task trigger states of the registered threads according to preset beat time intervals by using the timer; the preset beat time interval is a trigger time interval of the target registration thread;
if the task trigger state of the current registration thread is trigger, executing corresponding task operation by the current registration thread through the wireless communication module; wherein the current registered thread is any registered thread.
In some embodiments, the determining, by using the timer, the respective task trigger state of each periodic communication function registration thread at a preset beat time interval includes:
waking up all the registered threads according to the preset beat time interval by using the timer;
detecting whether the current beat number can be divided by the corresponding preset beat number by utilizing each registration thread; the current beat number is the current wake-up times corresponding to the preset beat time interval, and the preset beat number is a positive integer greater than or equal to 1;
if the current beat number can be divided by the preset beat number corresponding to the current registration thread, determining that the task trigger state of the current registration thread is trigger;
and if the current beat number cannot be divided by the preset beat number corresponding to the current registration thread, determining that the task trigger state of the current registration thread is not triggered.
In some embodiments, the target registration thread is a registration thread of a periodic communication function with a highest trigger frequency of the periodic communication functions.
In some embodiments, the target registration thread is a registration thread based on a heartbeat function of a message queue telemetry transport protocol MQTT.
In some embodiments, after determining the respective task trigger states of the registered threads at preset beat time intervals by using the timer, the method further includes:
and if the task trigger state of the current registration thread is not triggered, suspending the current registration thread.
In some embodiments, the timer for obtaining the target registration thread includes:
registering the target registration thread in an operating system;
after the target registration thread finishes registration, applying the timer for the target registration thread; the timing time of the timer is the preset beat time interval;
correspondingly, after the timer is applied for the target registration thread, the method further includes:
registering each non-target thread in the operating system, and determining the corresponding preset beat number of each non-target thread; the triggering time interval of each non-target thread is the product of the preset beat time interval and the corresponding preset beat number.
The invention also provides a control device of the wireless communication module, which comprises:
an acquisition unit configured to acquire a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module;
the determining unit is used for determining the respective task trigger state of each registered thread according to a preset beat time interval by using the timer; the preset beat time interval is a trigger time interval of the target registration thread;
the trigger unit is used for executing corresponding task operation by using the current registered thread if the task trigger state of the current registered thread is trigger; wherein the current registered thread is any registered thread.
The invention also provides a wireless communication module, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the control method of the wireless communication module when executing the computer program.
The invention also provides an electronic device, comprising: the device comprises a wireless communication module, a memory and a processor; wherein the memory is used for storing a computer program; the processor is configured to implement the steps of the control method of the wireless communication module when executing the computer program.
Furthermore, the present invention provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the method for controlling a wireless communication module as described above.
The invention provides a control method of a wireless communication module, which comprises the following steps: acquiring a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module; determining respective task trigger states of each registered thread according to a preset beat time interval by using a timer; the preset beat time interval is the trigger time interval of the target registration thread; if the task trigger state of the current registration thread is trigger, executing corresponding task operation by the current registration thread through the wireless communication module; the current registration thread is any registration thread;
therefore, the invention determines the respective task trigger state of each registration thread according to the preset beat time interval by utilizing the timer of the target registration thread, can uniformly align and manage the task operation of all the periodic communication functions by taking the task operation period of one periodic communication function of the wireless communication module as a uniform metronome, so as to furthest create an operation behavior sequence meeting the low-power consumption trigger condition, improve the time of the wireless communication module entering the low-power consumption state and effectively reduce the power consumption of the wireless communication module. In addition, the invention also provides a control device of the wireless communication module, the electronic equipment and the computer readable storage medium, and the control device has the same beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a control method of a wireless communication module according to an embodiment of the present invention;
fig. 2 is a flow chart of another control method of a wireless communication module according to an embodiment of the present invention;
FIG. 3 is a diagram showing task execution time of a periodic communication function of a wireless communication module according to the prior art;
fig. 4 is a diagram showing task execution time of a periodic communication function of a wireless communication module according to an embodiment of the present invention;
fig. 5 is a block diagram of a control device of a wireless communication module according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a wireless communication module according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a control method of a wireless communication module according to an embodiment of the invention. The method may include:
step 101: acquiring a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module.
The target registration thread in this embodiment may be any registration thread of a periodic communication function of the wireless communication module. The periodic communication function of the wireless communication module may be a function that needs to perform periodic wireless communication, which is implemented by the wireless communication module, for example, a heartbeat (keep alive) function based on MQTT (Message Queuing Telemetry Transport, message queue telemetry transport protocol), an EC (Embedded Controller) communication function, a positioning function (such as a global navigation satellite system GNSS positioning function), a cloud reporting function, and the like.
Correspondingly, the registration thread in this embodiment may be a thread corresponding to each periodic communication function registered in the operating system, for example, a thread registered in the operating system of the wireless communication module or the electronic device (such as a computer) where the wireless communication module is located. The Timer (Timer) of the target registration thread in this embodiment may be a Timer (or called Timer) for periodically triggering task operations of the periodic communication function of the target registration thread, for example, the Timer of the target registration thread applied from the operating system, where the timing time of the Timer may be a preset takt time interval, so as to trigger the target registration thread to execute corresponding task operations at the preset takt time interval.
It should be noted that, for the specific number and types of the periodic communication functions of the wireless communication module in this embodiment, the designer may set the periodic communication functions according to the practical scenario and the user requirement, for example, the periodic communication functions may be communication functions of IOT (Internet of Things ) service; for example, the periodic communication function may include an MQTT-based heartbeat function, an EC communication function, a positioning function, and a cloud reporting function required for IOT service; correspondingly, the registration threads in the embodiment may include registration threads corresponding to the heartbeat function, the EC communication function, the positioning function and the cloud reporting function.
Correspondingly, for the specific selection of the target registration thread in this embodiment, the designer may set the task operation period of the periodic communication function corresponding to the target registration thread as a unified "metronome" according to the practical scenario and the user requirement, i.e., the time interval of executing the corresponding task operation of the target registration thread is used as the most basic tick (beat), so that the task operation periods of all the periodic communication functions are aligned to the beat, i.e., the task operation periods of all the other periodic communication functions should be integer multiples of the beat. Therefore, the target registration thread in this embodiment may be the registration thread of the periodic communication function with the highest trigger frequency in all the periodic communication functions, that is, the registration thread of the periodic communication function with the most frequent activation in all the periodic communication functions; for example, the target registration thread may be a registration thread of an MQTT-based heartbeat function (e.g., the heartbeat thread in fig. 2).
The specific manner of acquiring the timer of the target registration thread in this embodiment may be set by a designer according to a practical scenario and a user requirement, for example, the processor may directly call the applied timer of the target registration thread in the operating system. The processor may also apply for a timer from the operating system for the target registration thread; for example, the processor may register a target registration thread with the operating system; after the target registration thread finishes registration, applying a timer for the target registration thread; the timing time of the timer is a preset beat time interval.
Correspondingly, the embodiment may further include a registration process of a registration thread (i.e. a non-target registration thread) other than the target registration thread, for example, after the processor applies for the timer for the target registration thread, the processor may register each non-target thread in the operating system and determine a preset beat number corresponding to each non-target thread; the triggering time interval of each non-target thread is the product of a preset beat time interval and a corresponding preset beat number. As shown in fig. 2, after the wireless communication module is powered on and started, the heartbeat thread (i.e. the target registration thread) with the heartbeat function can be preferentially registered in the operating system, and a timer is applied for the heartbeat thread; after that, the threads (i.e. non-target registered threads) with other periodic communication functions are registered, and the timers of the threads are not applied any more, but the same timer as the heartbeat thread is used as a common timer for periodically dispatching the threads.
Step 102: determining respective task trigger states of each registered thread according to a preset beat time interval by using a timer; the preset beat time interval is a trigger time interval of the target registration thread.
It can be understood that, in this embodiment, the processor may determine, by using the timing of the timer, the respective task trigger state of each registered thread according to the preset beat time interval, that is, determine whether each registered thread needs to trigger the task operation of the corresponding periodic communication function currently, so that the task operation period (i.e., the trigger time interval) of the periodic communication function corresponding to the registered thread may be an integer multiple of the preset beat time interval, and the start time is aligned to the time point corresponding to the preset beat time interval.
Correspondingly, the task trigger states of the target registration threads determined according to the preset beat time intervals can be trigger, namely, the preset beat time intervals are trigger time intervals of the target registration threads. The preset beat time interval may be greater than the execution time of the task operations of each registered thread.
Correspondingly, for the specific mode that the processor determines the respective task trigger states of each registered thread according to the preset beat time interval by using the timer in the embodiment, the specific mode can be set by a designer, for example, the processor can determine the respective task trigger states of each registered thread according to the respective preset beat number of each registered thread and the preset beat time interval by using the timer; the triggering time interval of each non-target thread is the product of the preset beat time interval and the corresponding preset beat number, and the preset beat number corresponding to the target registration thread can be 1. For example, the processor may wake up all registered threads at preset beat time intervals using a timer; detecting whether the current beat number can be divided by the corresponding preset beat number by utilizing each registration thread; the current beat number is the current wake-up times corresponding to a preset beat time interval, and the preset beat number is a positive integer greater than or equal to 1; if the current beat number can be divided by the preset beat number corresponding to the current registration thread, determining that the task trigger state of the current registration thread is trigger; and if the current beat number cannot be divided by the preset beat number corresponding to the current registration thread, determining that the task trigger state of the current registration thread is not triggered.
For example, as shown in fig. 2, when the target registration thread is a heartbeat thread, after the timer of the heartbeat thread is initialized, the timer wakes up all registration threads each time when completing the timing of one beat (i.e. a preset beat time interval), and the registration thread of each period communication function needs to determine whether the number of beats of the beat (i.e. a common multiple of the heartbeat period) is the number of beats required by the thread, for example, the positioning function needs to execute once every 3 beats, and each beat determines whether the number of beats of the beat can be divided by 3; if yes, the corresponding task operation is continued, and if not, the thread can be immediately suspended to wait for the next beat.
It should be noted that, for the specific time setting of the preset beat time interval in this embodiment, the designer may set the time setting according to the practical scenario and the user requirement, for example, the preset beat time interval may be 5 minutes, or may be other time intervals, for example, 3 minutes or 6 minutes, which is not limited in this embodiment.
Similarly, for the specific value of the preset beat number corresponding to each non-target registration thread, the specific value can be set by a designer according to a practical scene and a user requirement, for example, the registration threads comprise registration threads of a heartbeat function, an EC communication function, a positioning function and a cloud reporting function, when the registration threads of the heartbeat function are target registration threads, the preset beat number corresponding to the registration threads of the EC communication function can be 1, and the preset beat number corresponding to the registration threads of the positioning function and the cloud reporting function can be 3; for example, when the preset beat time interval is 5 minutes, the wireless communication module may use a heartbeat packet of the MQTT protocol once every 5 minutes as a base beat; the communication beats between the wireless communication module and the EC of the computer where the wireless communication module is positioned are aligned to 5 minutes; the GNSS positioning beats of the wireless communication module are set to 15 minutes, aligned to 5 minutes and are integer multiples of the 5 minute beats; the current state query and reporting action beats to the cloud end of the wireless communication module are set to 15 minutes, aligned to 5 minutes and are integer multiples of the 5 minutes beats.
Step 103: if the task trigger state of the current registration thread is trigger, executing corresponding task operation by the current registration thread through the wireless communication module; wherein the current registered thread is any registered thread.
It can be understood that, in this step, the processor may execute, by using the registration thread triggered by the task trigger state as a trigger, a corresponding task operation through the wireless communication module at each preset beat time interval, so as to implement periodic task operations of each periodic communication function of the wireless communication module.
Correspondingly, for the specific mode of executing the corresponding task operation by the wireless communication module by using the current registration thread in the step, that is, the specific operation content of the task operation executed by the wireless communication module can be set by a designer according to a practical scene and user requirements, for example, the task operation executed by the wireless communication module can be implemented in the same or similar mode as the task operation of each period of communication function of the wireless communication module in the prior art, for example, the task operation executed by the wireless communication module can include operations such as heartbeat packet transmission, data packet transmission, positioning, cloud reporting and the like. As shown in fig. 2, when the current registered thread is a registered thread (heartbeat thread) with a heartbeat function, in this step, a heartbeat packet may be sent to the cloud server by using the heartbeat thread through the wireless communication module; when the current registration thread is a registration thread of an EC communication function (EC communication function registration thread), in this step, an EC data packet may be sent through the wireless communication module by using the EC communication function registration thread; when the current registration thread is a registration thread of a positioning function (registration thread of the positioning function), the positioning can be finished by using the registration thread of the positioning function through the wireless communication module in the step; when the current registration thread is a registration thread of a cloud reporting function (cloud reporting function registration thread), in this step, cloud reporting can be completed by using the cloud reporting function registration thread through the wireless communication module.
It should be noted that, for the processing of the registration thread whose task trigger state is not triggered, the processing may be set by a designer, and in this embodiment, the method may further include suspending the current registration thread if the task trigger state of the current registration thread is not triggered, so as to wait for the task trigger state determination of the next preset beat time interval.
For example, when the wireless communication module adopts the conventional periodic communication manner shown in fig. 3, the three functions A, B and C each start three tasks according to their own beats, and the three tasks have respective execution time and execution interval; so that in 43 beat cycles, only 2 beat cycles have the opportunity to enter the low power consumption state because no task is performed, so that the power consumption savings that should be generated in the low power consumption state are not obvious. After the wireless communication module performs beat alignment by adopting the method provided by the embodiment, as shown in fig. 4, the wireless communication module has a 16/40 probability of entering a low power consumption state, and is greatly improved compared with the prior 2/43 in disordered state, so that the power consumption of the wireless communication module can be effectively reduced.
For example, the wireless communication module may use a heartbeat packet of MQTT protocol once every 5 minutes (i.e., a preset beat time interval) as a base beat; the communication beats between the wireless communication module and the EC of the computer where the wireless communication module is positioned are aligned to 5 minutes; the GNSS positioning beats of the wireless communication module are set to 15 minutes, aligned to 5 minutes and are integer multiples of the 5 minute beats; the current state query and reporting action beats to the cloud end of the wireless communication module are set to 15 minutes, aligned to 5 minutes and are integer multiples of the 5 minutes beats. With such an arrangement, the average current of the wireless communication module can be reduced from 39mA to 35mA, saving about 10% of power consumption.
In this embodiment, by determining the respective task trigger states of the registration threads according to the preset beat time interval by using the timer of the target registration thread, the embodiment of the invention can uniformly align and manage the task operations of all the periodic communication functions by taking the task operation period of one periodic communication function of the wireless communication module as a uniform metronome, so as to furthest create an operation behavior sequence meeting the low-power consumption trigger condition, improve the time of the wireless communication module entering the low-power consumption state, and effectively reduce the power consumption of the wireless communication module.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a control device of a wireless communication module, where the control device of a wireless communication module and the control method of a wireless communication module described below can be referred to correspondingly.
Referring to fig. 5, fig. 5 is a block diagram of a control device of a wireless communication module according to an embodiment of the invention. The apparatus may include:
an acquisition unit 10 for acquiring a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module;
a determining unit 20, configured to determine, by using a timer, respective task trigger states of each registered thread at preset beat time intervals; the preset beat time interval is the trigger time interval of the target registration thread;
the triggering unit 30 is configured to execute a corresponding task operation by using the current registered thread if the task triggering state of the current registered thread is triggering; wherein the current registered thread is any registered thread.
In some embodiments, the determining unit 20 may include:
a wake-up subunit, configured to wake up all registered threads by using a timer according to a preset beat time interval;
a detection subunit, configured to detect, by using each registration thread, whether the current beat number can be divided by the respective corresponding preset beat number; the current beat number is the current wake-up times corresponding to a preset beat time interval, and the preset beat number is a positive integer greater than or equal to 1;
the first determining subunit is configured to determine that the task trigger state of the current registered thread is trigger if the current beat number can be divided by the preset beat number corresponding to the current registered thread;
and the second determining subunit is configured to determine that the task trigger state of the current registered thread is not triggered if the current beat number cannot be divided by the preset beat number corresponding to the current registered thread.
In some embodiments, the target registration thread is a registration thread of a highest-triggering periodic communication function of the periodic communication functions.
In some embodiments, the target registration thread is a registration thread based on the heartbeat function of the message queue telemetry transport protocol MQTT.
In some embodiments, the apparatus may further comprise:
and the suspension unit is used for suspending the current registration thread if the task trigger state of the current registration thread is not triggered.
In some embodiments, the acquisition unit 10 may include:
a registration subunit, configured to register a target registration thread in the operating system;
the application subunit is used for applying a timer for the target registration thread after the target registration thread is registered; the timing time of the timer is a preset beat time interval;
accordingly, the apparatus may further include:
a registration determining subunit, configured to register each non-target thread in the operating system, and determine a preset beat number corresponding to each non-target thread; the triggering time interval of each non-target thread is the product of a preset beat time interval and a corresponding preset beat number.
In this embodiment, the determining unit 20 determines the respective task trigger states of the registration threads according to the preset beat time interval by using the timer of the target registration thread, so that the task operation period of one period communication function of the wireless communication module can be used as a unified metronome to perform unified alignment management on the task operation of all period communication functions, thereby creating an operation behavior sequence meeting the low power consumption trigger condition to the maximum extent, improving the time for the wireless communication module to enter the low power consumption state, and effectively reducing the power consumption of the wireless communication module.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a wireless communication module, and a wireless communication module described below and a control method of a wireless communication module described above may be referred to correspondingly.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a wireless communication module according to an embodiment of the invention. The wireless communication module may include:
a memory D1 for storing a computer program;
and the processor D2 is configured to implement the steps of the control method of the wireless communication module provided in the above method embodiment when executing the computer program.
Corresponding to the above method embodiment, the embodiment of the present invention further provides an electronic device, and the electronic device and the control method of the wireless communication module described above may be referred to correspondingly.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device may include: the wireless communication module D3, the memory D4 and the processor D5;
a memory D4 for storing a computer program;
and the processor D5 is configured to implement the steps of the control method of the wireless communication module provided in the method embodiment when executing the computer program.
In some embodiments, the electronic device provided in this embodiment may be a computer.
Corresponding to the above method embodiments, the embodiments of the present invention further provide a computer readable storage medium, where a computer readable storage medium described below and a control method of a wireless communication module described above may be referred to correspondingly.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the invention. The computer-readable storage medium 40 stores a computer program 41, which when executed by a processor, implements the steps of the control method of the wireless communication module provided in the above-described method embodiment.
The computer readable storage medium 40 may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, etc. which can store various program codes.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The method and apparatus for controlling a wireless communication module, the electronic device and the computer readable storage medium provided by the invention are described in detail. The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.

Claims (10)

1. A method for controlling a wireless communication module, comprising:
acquiring a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module;
determining respective task trigger states of the registered threads according to preset beat time intervals by using the timer; the preset beat time interval is a trigger time interval of the target registration thread;
if the task trigger state of the current registration thread is trigger, executing corresponding task operation by the current registration thread through the wireless communication module; wherein the current registered thread is any registered thread.
2. The method for controlling a wireless communication module according to claim 1, wherein determining, by using the timer, a task trigger state of each periodic communication function registration thread at a preset beat time interval includes:
waking up all the registered threads according to the preset beat time interval by using the timer;
detecting whether the current beat number can be divided by the corresponding preset beat number by utilizing each registration thread; the current beat number is the current wake-up times corresponding to the preset beat time interval, and the preset beat number is a positive integer greater than or equal to 1;
if the current beat number can be divided by the preset beat number corresponding to the current registration thread, determining that the task trigger state of the current registration thread is trigger;
and if the current beat number cannot be divided by the preset beat number corresponding to the current registration thread, determining that the task trigger state of the current registration thread is not triggered.
3. The method according to claim 1, wherein the target registration thread is a registration thread of a periodic communication function with a highest trigger frequency among the periodic communication functions.
4. A method of controlling a wireless communication module according to claim 3, wherein the target registration thread is a registration thread based on a heartbeat function of a message queue telemetry transport protocol MQTT.
5. The method for controlling a wireless communication module according to claim 1, wherein after determining the respective task trigger states of the registered threads at preset beat time intervals by using the timer, further comprises:
and if the task trigger state of the current registration thread is not triggered, suspending the current registration thread.
6. The control method of a wireless communication module according to any one of claims 1 to 5, wherein the timer for acquiring the target registration thread includes:
registering the target registration thread in an operating system;
after the target registration thread finishes registration, applying the timer for the target registration thread; the timing time of the timer is the preset beat time interval;
correspondingly, after the timer is applied for the target registration thread, the method further includes:
registering each non-target thread in the operating system, and determining the corresponding preset beat number of each non-target thread; the triggering time interval of each non-target thread is the product of the preset beat time interval and the corresponding preset beat number.
7. A control device for a wireless communication module, comprising:
an acquisition unit configured to acquire a timer of a target registration thread; the target registration thread is one of registration threads of communication functions of each period of the wireless communication module;
the determining unit is used for determining the respective task trigger state of each registered thread according to a preset beat time interval by using the timer; the preset beat time interval is a trigger time interval of the target registration thread;
the trigger unit is used for executing corresponding task operation by using the current registered thread if the task trigger state of the current registered thread is trigger; wherein the current registered thread is any registered thread.
8. A wireless communication module, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the control method of the wireless communication module according to any one of claims 1 to 6 when executing the computer program.
9. An electronic device, comprising: the device comprises a wireless communication module, a memory and a processor; wherein the memory is used for storing a computer program; the processor is configured to implement the steps of the control method of the wireless communication module according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, which when executed by a processor, implements the steps of the method of controlling a wireless communication module according to any one of claims 1 to 6.
CN202410070446.5A 2024-01-17 2024-01-17 Wireless communication module, control method and device thereof, electronic equipment and medium Pending CN117891329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410070446.5A CN117891329A (en) 2024-01-17 2024-01-17 Wireless communication module, control method and device thereof, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410070446.5A CN117891329A (en) 2024-01-17 2024-01-17 Wireless communication module, control method and device thereof, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117891329A true CN117891329A (en) 2024-04-16

Family

ID=90651794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410070446.5A Pending CN117891329A (en) 2024-01-17 2024-01-17 Wireless communication module, control method and device thereof, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117891329A (en)

Similar Documents

Publication Publication Date Title
US10912035B2 (en) Power management via coordination and selective operation of timer-related tasks
US10552216B2 (en) Application heartbeat period adjusting method and apparatus, and terminal
US6467042B1 (en) Method and/or apparatus for lowering power consumption in a peripheral device
CN112530056B (en) Method for reducing power consumption of intelligent door lock, intelligent door lock and storage medium
US10091307B2 (en) Application management method and terminal
US20020184288A1 (en) Method and apparatus for synchronization of periodic processes
US20020007387A1 (en) Dynamically variable idle time thread scheduling
US20080307248A1 (en) Cpu Clock Control Device, Cpu Clock Control Method, Cpu Clock Control Program, Recording Medium, and Transmission Medium
WO2013116751A1 (en) Dynamic power management in real-time systems
WO2013070425A2 (en) Conserving power through work load estimation for a portable computing device using scheduled resource set transitions
CN103345415A (en) Terminal energy-saving method and device for management timer
US20230113657A1 (en) Preemptive wakeup circuit for wakeup from low power modes
CN109429313B (en) Information interaction method, functional equipment, terminal, server and storage medium
WO2016195778A1 (en) Opportunistic waking of an application processor
KR20140026308A (en) Apparatus and method for managing power in multi-core system
CN109062624B (en) Processing method for interrupt wakeup of automobile electronic control unit
CN112987904B (en) Heartbeat control method and device
CN117891329A (en) Wireless communication module, control method and device thereof, electronic equipment and medium
CN110928586A (en) APP background keep-alive method and device
US20220229484A1 (en) Power management setting configuration
US20160224053A1 (en) Timer-based processing unit operational scaling employing timer resetting on idle process scheduling
CN110609712A (en) Network request discretization processing method
CN114003367B (en) Risk monitoring method, device, equipment and storage medium
US20230130826A1 (en) Real-time operating system with a cpu cycle time base
WO2023069180A1 (en) Real-time operating system with a cpu cycle time base

Legal Events

Date Code Title Description
PB01 Publication