A multi-radio rule scheduling method, system and storage medium
By adopting the multi-radio frequency rule scheduling method in RFID readers and writers, scheduling of RF rules according to execution weights and priority, the problems of low efficiency and poor flexibility in the prior art are solved, and flexible processing of various application scenarios is realized. Priority distribution is fair.
Patent Information
- Application Number
- CN202411266070.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-09-11
AI Technical Summary
Existing RFID readers and writers are inefficient and have poor flexibility in multiple RF rule scheduling, unable to meet multiple start and end conditions, and cannot effectively deal with complex application scenarios with different priorities.
Using multi-radio frequency rule scheduling method, by receiving and analyzing RF rules, adding them to the sleep waiting queue, scheduling according to execution weights and priority, ensuring that only one RF rule is executed at the same time, and selecting the rules with the highest execution weights or the highest priority. Execute and retrieve the scheduling after execution is finished.
It realizes fair scheduling with different rules, reasonably occupies RF resources, applies to a variety of application scenarios, flexibly switch, strong ease of use, and good use effect.
Smart Images

Figure CN118780301B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of radio frequency rule management, and in particular to a multi-radio frequency rule scheduling method, system and storage medium. Background Art
[0002] An RFID reader is a device that can read and write RFID tag data. It communicates with RFID tags through radio frequency signals to read and write tag data. An RFID reader usually consists of a radio frequency module, a control unit, and an antenna. The radio frequency module is responsible for sending and receiving radio frequency signals, the antenna is used to transmit radio frequency signals, and the control unit is responsible for processing the communication protocol and data processing between the reader and the tag. There are different air interface communication protocols for the reader to communicate with different types of tags. Commonly used protocols include "EPC Class-1 Generation-2", "GB / T29768-2013", "GB / T35786-2017", etc.
[0003] When an RFID reader communicates with a tag using an air interface protocol, it can only use one communication protocol and a specified type of tag to communicate at the same time. To support multiple tags at the same time, multiple air interface protocols need to be polled, which requires the reader to implement multiple radio frequency rules. Most existing RFID readers do not implement this function, and the few RFID readers that implement multi-radio rule scheduling only use a simple polling method for scheduling during the scheduling process. This scheduling method is inefficient and has poor flexibility. It cannot meet the scenarios with multiple start and end conditions, nor can it meet the complex application scenarios with different priority levels of multiple radio frequency rules, and has poor usability. Summary of the invention
[0004] In view of the deficiencies in the prior art, an object of the present invention is to provide a multi-radio rule scheduling method, system and storage medium.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A multi-radio rule scheduling method comprises the steps of:
[0007] Addition of radio frequency rules: receiving radio frequency rules and parsing radio frequency rules.
[0008] Scheduling of radio frequency rules: adding the parsed radio frequency rules to the sleep waiting queue;
[0009] When the start condition of the RF rule in the sleep waiting queue is met, the corresponding RF rule enters the queue to be executed;
[0010] Calculate the execution weights of the RF rules in the queue to be executed, and transfer the RF rule with the highest execution weight to the execution queue;
[0011] Execution of radio frequency rules: Execute the corresponding radio frequency rules and receive the information returned by the tags. After the execution is completed, the scheduling of radio frequency rules is re-triggered.
[0012] In the present invention, preferably, the scheduling of the radio frequency rules further includes transferring the radio frequency rules that meet the termination condition in the to-be-executed queue to a sleep waiting queue.
[0013] In the present invention, preferably, the radio frequency rule includes a rule ID, a rule priority, a rule air interface protocol type, a rule start condition, an end condition and a pre-read tag area.
[0014] In the present invention, preferably, the execution of the radio frequency rule is performed according to a scheduling principle, and the scheduling principle includes:
[0015] Only one RF rule is executed at a time;
[0016] Select the RF rule with the highest execution weight in the current queue for execution;
[0017] When the execution weights are equal, the RF rule with the higher priority is executed first;
[0018] When the execution weight and rule priority are equal, the RF rule that is added to the queue to be executed first is executed first.
[0019] In the present invention, preferably, the execution weight is the sum of the radio frequency priority of the radio frequency rule and the number of scheduling waiting times of the radio frequency rule.
[0020] In the present invention, preferably, the specific steps of the scheduling operation of the radio frequency rule include:
[0021] The scheduler starts scheduling and determines whether there are currently any execution rules;
[0022] If there is an execution rule, the scheduling waiting times of all RF rules in the queue to be executed will be increased by 1;
[0023] If there is no execution rule, scan the RF rules in the queue to be executed and calculate the execution weight of the current RF rule;
[0024] The RF rule with the highest execution weight is selected, and the scheduling waiting times of other RF rules that have not been executed are increased by 1;
[0025] The scheduling waiting times of the selected radio rule are cleared, and the selected radio rule is converted to the execution queue.
[0026] In the present invention, preferably, the specific steps of executing the radio frequency rule include:
[0027] Select the corresponding air interface protocol type and pre-read tag area according to the radio frequency rules in the execution queue;
[0028] Control the radio frequency module to send air interface protocol;
[0029] Wait for the tag to return information;
[0030] Receive the returned success or failure information;
[0031] End this round of execution;
[0032] Trigger the scheduling of RF rules.
[0033] A multi-RF rule scheduling system comprises a scheduling module, a receiving module, a storage module and an execution module. The receiving module receives the RF rules issued by the background, and transmits the RF rules to the scheduling module. The scheduling module parses the RF rules, transfers them to queues of corresponding states according to the states of the RF rules, calculates the weights of the RF rules in the execution queue, selects the RF rules to be executed currently and sends them to the execution module, which executes them. The RF rules are stored in different queues of the storage module according to different states.
[0034] In the present invention, preferably, the states of the radio frequency rules include a sleep waiting state, a waiting state and an execution state.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The method of the present invention solves the problem that multiple radio frequency rules are difficult to schedule in an RFID reader, realizes a priority fair scheduling algorithm for different rules, enables different priority rules to reasonably occupy limited radio frequency resources, can be applied to a variety of application scenarios, can be flexibly switched under different start / end conditions, has strong ease of use, and has good use effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the state change of the radio frequency rule described in the present invention.
[0038] Figure 2 A flow chart is added to the radio frequency rules described in the present invention.
[0039] Figure 3 The figure is a schematic diagram of the scheduling operation flow of the present invention.
[0040] Figure 4 The figure is a schematic diagram of the execution flow of the radio frequency rules described in the present invention.
[0041] Figure 5 It is the actual scheduling operation proportion of radio frequency rules with different priorities in the specific embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0044] Please also see Figures 1 to 4 A preferred embodiment of the present invention provides a multi-RF rule scheduling method, which is mainly used in RFID readers to schedule multiple RF rules issued by the background, reasonably allocate RF resources, and efficiently run multiple different RF rules at the same time. The specific implementation steps include:
[0045] Addition of radio frequency rules: receiving radio frequency rules and parsing radio frequency rules.
[0046] Scheduling of radio frequency rules: adding the parsed radio frequency rules to the sleep waiting queue;
[0047] When the start condition of the RF rule in the sleep waiting queue is met, the corresponding RF rule enters the queue to be executed;
[0048] Calculate the execution weights of the RF rules in the queue to be executed, and transfer the RF rule with the highest execution weight to the execution queue;
[0049] Transferring the RF rules that meet the termination conditions in the waiting queue to the sleep waiting queue;
[0050] Execution of radio frequency rules: Execute the corresponding radio frequency rules and receive the information returned by the tags. After the execution is completed, the scheduling of radio frequency rules is re-triggered.
[0051] The RF rules include rule ID, rule priority, rule air interface protocol type, rule start condition, end condition and pre-read tag area. RF rules are divided into three states: sleep waiting state, waiting state and execution state.
[0052] Specifically, after the RF rule is added, the initial state is the sleep waiting state. The RF rules in this state are stored in the sleep waiting queue, and the scheduler is triggered to perform the scheduling operation. When the rule start condition of the RF rule is met, it changes from the sleep waiting state to the waiting state, and it is transferred from the sleep waiting queue to the waiting queue, and the scheduler triggers the scheduling operation. When the RF rule in the execution state is executed, the RF rule will return to the sleep waiting state, re-enter the sleep waiting queue, and trigger the scheduler scheduling operation. When the scheduler starts scheduling, it will select the RF rule with the highest execution weight in the waiting queue, change it from the waiting state to the execution state, and execute the RF rule. At this time, according to the air interface protocol type and pre-read tag area parameters corresponding to the RF rule, the RFID reader RF module will be called to perform specific RF operations. The start condition and end condition can be in various forms such as external trigger, timed trigger or unconditional trigger. The RF rules in the execution state will call the RF module of the RFID RF reader to perform specific RF operations. In the process, except for the forced deletion of this RF rule in the background, the RF operation will not stop anyway, thus preventing the incomplete implementation of the air interface protocol caused by the priority preemption operation.
[0053] Specifically, in the scheduling of the radio frequency rule, it is confirmed that the currently executed radio frequency rule is performed according to the scheduling principle, and the scheduling principle includes:
[0054] Only one RF rule is executed at a time;
[0055] Select the RF rule with the highest execution weight in the current queue for execution;
[0056] When the execution weights are equal, the RF rule with the higher priority is executed first;
[0057] When the execution weight and rule priority are equal, the RF rule that is added to the queue to be executed first is executed first.
[0058] The execution weight is the sum of the RF priority of the RF rule and the number of RF rule scheduling waiting times. The number of RF rule scheduling waiting times refers to the number of times the RF rule is not scheduled to be executed because other RF rules with high execution weights occupy RF module resources when the RF rule is in the waiting state.
[0059] For details, see Figure 3 The specific steps of the scheduling operation of the radio frequency rule include:
[0060] The scheduler starts scheduling and determines whether there are currently any execution rules;
[0061] If there is an execution rule, the scheduling waiting times of all RF rules in the queue to be executed will be increased by 1;
[0062] If there is no execution rule, scan the RF rules in the queue to be executed and calculate the execution weight of the current RF rule;
[0063] The RF rule with the highest execution weight is selected, and the scheduling waiting times of other RF rules that have not been executed are increased by 1;
[0064] The scheduling waiting times of the selected radio rule are cleared, and the selected radio rule is converted to the execution queue.
[0065] Specifically, after the scheduler starts scheduling, it first scans the execution queue for any RF rules being executed. If there are RF rules being executed, no new rules will be scheduled for execution at this time. The scheduling waiting times in the queue to be executed will be increased by 1, and this round of scheduling will end. If there are no RF rules being executed, the queue to be executed will be scanned, the execution weight will be calculated, and the RF rule with the highest execution weight will be selected. The scheduling waiting times of other unselected RF rules will be increased by 1, the scheduling waiting times of the selected RF rule will be cleared, and it will be converted to execution state for execution. When the execution weights are equal, the RF rule with the higher priority will be selected for execution first. When the execution weight and rule priority are equal, the RF rule that is first added to the queue to be executed will be selected for execution first.
[0066] For details, see Figure 4 The specific steps of executing the radio frequency rules include:
[0067] Select the corresponding air interface protocol type and pre-read tag area according to the radio frequency rules in the execution queue;
[0068] Control the radio frequency module to send air interface protocol;
[0069] Wait for the tag to return information;
[0070] Receive the returned success or failure information;
[0071] End this round of execution;
[0072] Trigger the scheduling of RF rules.
[0073] Specifically, in a specific embodiment, there are 5 RF rules with priorities 1, 5, 6, 7, and 5 respectively. The rule IDs corresponding to the 5 RF rules are ID1, ID2, ID3, ID4, and ID5 respectively. They are sent to the RFID reader through the background software in this order. It is assumed that the starting conditions of these 5 RF rules are always met and they are kept in the waiting state for a long time, that is, they are in the waiting queue waiting for scheduling by the scheduler.
[0074] Table 1:
[0075]
[0076] According to the scheduling principle, only one scheduling is allowed to be executed at the same time. When the scheduler triggers the scheduling for the first time, the execution weights of the 5 RF rules are: Rule ID1: 1+0, Rule ID2: 5+0, Rule ID3: 6+0, Rule ID4: 7+0, Rule ID5: 5+0. The highest execution weight of this scheduling is 7, which corresponds to Rule ID4, so the RF rule when Rule ID4 is executed for the first time is selected; when scheduling for the second time, except for the rule with Rule ID4: 7+0, the waiting times of other rules to be executed are increased by 1. The execution weights of the 5 RF rules at this time are: Rule ID1: 1+1, Rule ID2: 5+1, Rule ID3: 6+1, Rule ID4: 7+0, Rule ID5: 5+1. The highest execution weight is still 7, corresponding to the RF rule of Rule ID4, and so on.
[0077] When the fourth scheduling is performed, as can be seen in Table 1, the execution weights are: Rule ID1: 1+3, Rule ID2: 5+3, Rule ID3: 6+0, Rule ID4: 7+1, Rule ID5: 5+3. Although the execution weight values of Rule ID2: 5+3, Rule ID4: 7+1, and Rule ID5: 5+3 are all 8, Rule ID4: 7+1 has the highest priority, so Rule ID4 is executed first in this scheduling.
[0078] During the fifth scheduling, the execution weights are: Rule ID1:1+4, Rule ID2:5+4, Rule ID3:6+1, Rule ID4:7+0, Rule ID5:5+4. Although the weight values of Rule ID2:5+4 and Rule ID5:5+4 are both 9, Rule ID2:5+4 is added first, so Rule ID2:5+4 is executed first in this scheduling.
[0079] See also Figure 5 The scheduling execution statistics for the above five radio frequency rules after 342227 executions are as follows: ID1: 11% (priority 1), ID2: 17% (priority 5), ID3: 22% (priority 6), ID4: 33% (priority 7), ID5: 17% (priority 5). According to the radio frequency operation proportions of these five different priority rules, this algorithm can reasonably allocate radio frequency resources according to priority.
[0080] In some other preferred embodiments of the present invention, a multi-RF rule scheduling system is provided, characterized in that it includes a scheduling module, a receiving module, a storage module and an execution module. The receiving module receives the RF rules issued by the background and transmits the RF rules to the scheduling module. The scheduling module parses the RF rules and transfers them to the queue of the corresponding state according to the state of the RF rules, calculates the weight of the RF rules in the execution queue, selects the RF rules to be executed currently and sends them to the execution module, which is executed by the execution module. The RF rules are stored in different queues of the storage module according to different states.
[0081] Specifically, the conditions that trigger the scheduler to perform scheduling operations include:
[0082] ① After adding new rules in the background;
[0083] ② After the current execution state rules are executed;
[0084] ③ After the start / end condition occurs;
[0085] ④ After a rule is deleted.
[0086] Specifically, the scheduler follows the following scheduling principles during the scheduling process:
[0087] ① Only one rule is allowed to be executed at the same time
[0088] ② When the scheduling is triggered, scan all pending rules and select the rule with the highest execution weight to enter the execution state.
[0089] ③ When the execution weights are equal, the rule with higher priority will be executed first.
[0090] ④ When the execution weight and rule priority are equal, the rule that was added to the reader first will be executed first.
[0091] In some other preferred embodiments of the present invention, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the method described in the above embodiment.
[0092] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0093] The above description is a detailed description of the preferred feasible embodiments of the present invention, but the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modified changes completed under the technical spirit suggested by the present invention should fall within the patent scope covered by the present invention.
Claims
1. A multi-radio rule scheduling method, characterized in that: Includes steps: Determine whether the start condition of the radio frequency rules in the sleep waiting queue is met, and transfer the radio frequency rules that meet the start condition to the queue to be executed; Determine whether there is any radio frequency rule currently being executed. If not, schedule the radio frequency rules in the queue to be executed according to the scheduling principle. The scheduling principles include: Only one RF rule is selected for execution at a time; Select the RF rule with the highest execution weight in the current queue for execution; When the execution weights are equal, the RF rule with the higher priority is executed first; When the execution weight and rule priority are equal, the RF rule that is added to the queue to be executed first is executed first; The execution weight is the sum of the radio frequency priority of the radio frequency rule and the number of scheduling waiting times of the radio frequency rule.
2. A multi-radio rule scheduling method according to claim 1, characterized in that: The specific steps of the scheduling operation of the radio frequency rule include: The scheduler starts scheduling and determines whether there are currently any execution rules; If there is an execution rule, the scheduling waiting times of all RF rules in the queue to be executed will be increased by 1; If there is no execution rule, scan the RF rules in the queue to be executed and calculate the execution weight of the current RF rule; The RF rule with the highest execution weight is selected, and the scheduling waiting times of other RF rules that have not been executed are increased by 1; The scheduling waiting times of the selected radio rule are cleared, and the selected radio rule is converted to the execution queue.
3. A multi-radio rule scheduling method according to claim 1, characterized in that: The method also includes transferring the radio frequency rules that meet the termination condition in the to-be-executed queue to the sleep waiting queue.
4. A multi-radio rule scheduling method according to claim 3, characterized in that: The radio frequency rule includes a rule ID, a rule priority, a rule air interface protocol type, a rule start condition, an end condition and a pre-read tag area.
5. The multi-radio rule scheduling method according to claim 1, characterized in that: It also includes receiving the radio frequency rules sent by the background, parsing the radio frequency rules, and transferring the parsed rules into the sleep waiting queue.
6. A multi-radio rule scheduling method according to claim 1, characterized in that: Also includes enforcement of RF regulations: Select the corresponding air interface protocol type and pre-read tag area according to the radio frequency rules in the execution queue; Control the radio frequency module to send air interface protocol; Wait for the tag to return information; Receive the returned success or failure information; End this round of execution; Trigger the scheduling of RF rules.
7. The multi-radio rule scheduling method according to claim 1, characterized in that: The states of the radio frequency rules include a sleep waiting state, a waiting state and an execution state, and the radio frequency rules are scheduled to corresponding queues according to their states.
8. A system for implementing a multi-radio regular scheduling method according to any one of claims 1 to 7, characterized in that: It includes a scheduling module, a storage module and an execution module. The scheduling module receives the RF rules sent by the background and parses the RF rules, transfers them to the queue of the corresponding state according to the state of the RF rules, calculates the weights of the RF rules in the execution queue, selects the RF rules to be executed currently and sends them to the execution module, which is executed by the execution module. The RF rules are stored in different queues of the storage module according to different states.
9. A storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor executes the steps of a multi-radio rule scheduling method as described in any one of claims 1 to 7.
