A method, system, device and medium for processing command message queue
By maintaining the command message queue and status bit in the NB-IoT device, the problem of command loss in the narrowband Internet of Things is solved, the integrity and orderliness of the command are achieved, and the independence and processing efficiency between devices are improved.
Patent Information
- Application Number
- CN202211708771.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-12-29
AI Technical Summary
In the narrowband Internet of Things (NB-IoT), when multiple instructions are issued simultaneously, the network side only caches the last piece of information, causing other instructions to be discarded. As a result, the device receives incomplete instructions and causes unnecessary losses.
A method for processing a command message queue is provided. By receiving command messages sent by applications, writing them to the tail of the command issuance queue, and maintaining a status bit in the device process to ensure that commands are issued in order, the status bit is cleared after judging the response using device feedback messages, thereby achieving command integrity and orderliness.
It improves the integrity and speed of the instruction issuance process, reduces processing complexity, reduces performance consumption, and ensures the independence between devices and the orderliness of instructions.
Smart Images

Figure CN116155842B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things technology, and in particular to a method, system, device, and medium for processing an instruction message queue. Background Art
[0002] Narrowband Internet of Things (NB-IoT) is widely used in IoT scenarios due to its wide coverage and low power consumption. During network transmission, when multiple commands are sent simultaneously, the network only caches the last command and discards all other commands. This can result in incomplete commands being received by the device, causing unnecessary losses.
[0003] In summary, the problems existing in related technologies need to be solved urgently. Summary of the Invention
[0004] The purpose of this application is to solve one of the technical problems existing in the related art to at least a certain extent.
[0005] To this end, an object of embodiments of the present application is to provide a method, system, device and medium for processing an instruction message queue.
[0006] In order to achieve the above technical objectives, the technical solutions adopted in the embodiments of the present application include:
[0007] On the one hand, an embodiment of the present application provides a method for processing an instruction message queue, the method comprising:
[0008] Receive the command message sent by the application and write the command message to the end of the command sending queue;
[0009] When it is determined that the status bit in the device process is empty and the instruction can be issued, the target instruction message at the first position is taken out from the head of the instruction issuing queue;
[0010] Writing the target command message into the status bit and sending it to the device, and retaining the complete information of the target command message in the uplink and downlink interaction channels;
[0011] receiving a feedback message from a device, and determining whether the feedback message is a response message to the target instruction message;
[0012] If the feedback message is a response message to the target instruction message, the status bit is cleared, the channel corresponding to the target instruction message is closed in the uplink and downlink interaction channels, and the next instruction message is sent in the order of the instruction sending queue.
[0013] In addition, the method for processing an instruction message queue according to the above embodiment of the present application may also have the following additional technical features:
[0014] Furthermore, in one embodiment of the present application, the instruction message includes a device ID, instruction content, and a ttl cache time.
[0015] Furthermore, in one embodiment of the present application, the receiving the instruction message sent by the application and writing the instruction message to the tail of the instruction issuing queue includes:
[0016] Receive a command message sent by an application and generate a command ID corresponding to the command message; the command ID increases in the order in which the command message is received;
[0017] Generate a task ID corresponding to the instruction message according to the instruction ID and device ID corresponding to the instruction message;
[0018] The task ID is used as the key value and written into the tail of the instruction delivery queue of the device process dictionary according to the format.
[0019] Furthermore, in one embodiment of the present application, sending the target instruction message to the device includes:
[0020] After encoding, decoding and protocol conversion of the target instruction message, it is sent to the device in the form of a CON message.
[0021] Furthermore, in one embodiment of the present application, the receiving device's feedback message and determining whether the feedback message is a response message to the target instruction message include:
[0022] Receive feedback messages from devices;
[0023] According to the message ID and token specified in the protocol, search in the device process whether there is a target channel corresponding to the feedback message;
[0024] If there is a target channel corresponding to the feedback message, comparing the complete information of the instruction message retained in the target channel with the current status bit to see whether they are consistent;
[0025] If the complete information of the instruction message retained in the target channel is consistent with the current status bit, it is determined that the feedback message is a response message of the target instruction message.
[0026] Furthermore, in one embodiment of the present application, the method further includes:
[0027] If no feedback message from the device is received within a predetermined time threshold after the target instruction message is sent, the status bit is cleared and the channel corresponding to the target instruction message is closed in the uplink and downlink interaction channels.
[0028] Furthermore, in one embodiment of the present application, the method further includes:
[0029] Detect the power saving mode currently used by the device;
[0030] If the power saving mode used by the device is PSM, the sending of the command message is suspended until any uplink message of the device is received and the next command message is sent in the order of the command sending queue;
[0031] Alternatively, if the power saving mode used by the device is eDRX or DRX, the next instruction message is sent according to the order of the instruction sending queue.
[0032] On the other hand, an embodiment of the present application provides a system for processing an instruction message queue, the system comprising:
[0033] A receiving module, configured to receive a command message sent by an application and write the command message to the tail of a command issuing queue;
[0034] an extraction module, configured to extract the target instruction message at the head of the instruction issuing queue when it is determined that the status bit in the device process is empty and the instruction can be issued;
[0035] A sending module, configured to write the target command message into a status bit and then send it to the device, and retain the complete information of the target command message in the uplink and downlink interaction channels;
[0036] a judgment module, configured to receive a feedback message from a device and judge whether the feedback message is a response message to the target instruction message;
[0037] A processing module is used to clear the status bit if the feedback message is a response message to the target instruction message, close the channel corresponding to the target instruction message in the uplink and downlink interaction channels, and issue the next instruction message in the order of the instruction issuance queue.
[0038] In another aspect, an embodiment of the present application provides a computer device, including:
[0039] at least one processor;
[0040] at least one memory for storing at least one program;
[0041] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned method for processing an instruction message queue.
[0042] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which stores a program executable by a processor. When the program executable by the processor is executed, it is used to implement the above-mentioned method for processing an instruction message queue.
[0043] The advantages and benefits of this application will be partially given in the following description, and partially become apparent from the following description, or learned through practice of this application:
[0044] The embodiment of the present application discloses a method for processing an instruction message queue, the method comprising: receiving an instruction message sent by an application, writing the instruction message to the tail of an instruction dispatch queue; when it is determined that the status bit in the device process is empty and the instruction can be dispatched, taking out the target instruction message at the first position from the head of the instruction dispatch queue; writing the target instruction message to the status bit and sending it to the device, and retaining the complete information of the target instruction message in the uplink and downlink interaction channels; receiving a feedback message from the device, judging whether the feedback message is a response message to the target instruction message; if the feedback message is a response message to the target instruction message, clearing the status bit, closing the channel corresponding to the target instruction message in the uplink and downlink interaction channels, and dispatching the next instruction message in the order of the instruction dispatch queue. This method can improve the integrity of the instruction dispatch process, the high speed of instruction processing, and the orderliness of the queue, reduce the processing complexity of the instruction dispatch process, and reduce performance consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative work.
[0046] Figure 1 A schematic diagram of an implementation environment of a method for processing a command message queue provided in an embodiment of the present application;
[0047] Figure 2 A flowchart of a method for processing an instruction message queue provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a command message stored in a queue and a command issued in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of processing an instruction issuing queue after a device replies to a feedback message provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of processing a command issuing queue after a device reply timeout is provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of processing a command issuing queue during a device activation reply provided in an embodiment of the present application;
[0052] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be considered as limiting the present application. All other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0054] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0056] Narrowband Internet of Things (NB-IoT) is widely used in IoT scenarios due to its wide coverage and low power consumption. During network transmission, when multiple commands are sent simultaneously, the network only caches the last command and discards all other commands. This can result in incomplete commands being received by the device, causing unnecessary losses.
[0057] In view of this, a method for processing a command message queue is provided in an embodiment of the present application. The method queues and issues command messages to NB-IoT devices based on the device process queue and status bit, and can determine the logic of issuing subsequent commands and resuming the command queue issuance based on the power saving mode, etc. The overall technical solution does not need to rely on timers and databases. The device process queues are independent of each other and do not affect each other, which ensures the integrity of the command issuance process, the high speed of command processing, and the orderliness of the queue to the greatest extent. In high-concurrency scenarios, the efficient and stable operation of the platform can still be guaranteed. The method provided in the embodiment of the present application has a wide range of application scenarios and can be applied to the issuance of commands for NB-IoT devices in the field of the Internet of Things. It can be extended to scenarios such as scenarios where information interaction requires sequential processing, scenarios where the device message processing capabilities are weak, smart cities, smart homes, and other scenarios.
[0058] First, please refer to Figure 1 , Figure 1 This is a schematic diagram of an implementation environment of a method for processing a command message queue provided by an embodiment of the present application. Figure 1 The hardware and software components of the implementation environment mainly include a device 101 and a platform 102, and the device 101 is in communication with the platform 102. The method for processing the instruction message queue can be executed based on the interaction between the device 101 and the platform 102, or can be executed independently on the platform 102 side. The specific method can be appropriately selected based on the actual application situation, and this embodiment does not specifically limit this.
[0059] Among them, the device 101 may include a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and an in-vehicle terminal; the platform 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. A communication connection can be established between the device 101 and the platform 102 through a wireless network or a wired network. The wireless network or wired network uses standard communication technology and / or protocols. The network can be set to the Internet or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), any combination of mobile, wired or wireless networks, private networks or virtual private networks.
[0060] Please refer to Figure 2, Figure 2 This is a flowchart of a method for processing a command message queue provided by an embodiment of the present application, with reference to Figure 2 The processing method of the instruction message queue includes but is not limited to:
[0061] Step 110: Receive the instruction message sent by the application, and write the instruction message to the end of the instruction sending queue;
[0062] Step 120: When it is determined that the status bit in the device process is empty and the instruction can be issued, the target instruction message at the head of the instruction issuing queue is taken out;
[0063] Step 130: Write the target command message into the status bit and send it to the device, and retain the complete information of the target command message in the uplink and downlink interaction channels;
[0064] Step 140: Receive a feedback message from the device and determine whether the feedback message is a response message to the target instruction message.
[0065] Step 150: If the feedback message is a response message to the target instruction message, clear the status bit, close the channel corresponding to the target instruction message in the uplink and downlink interaction channels, and issue the next instruction message in the order of the instruction issuance queue.
[0066] In an embodiment of the present application, a method is provided for sequentially queuing and issuing command messages to NB-IoT devices based on the device process queue and status bits. Specifically, the method includes the process of queuing and issuing command messages: an application can send a command message to a platform, and upon receiving the command message, the platform can write it to the end of the command issuance queue.
[0067] In some embodiments, the instruction message may include a device ID, instruction content, and a ttl cache time.
[0068] The receiving the instruction message sent by the application and writing the instruction message to the tail of the instruction issuing queue includes:
[0069] Receive a command message sent by an application and generate a command ID corresponding to the command message; the command ID increases in the order in which the command message is received;
[0070] Generate a task ID corresponding to the instruction message according to the instruction ID and device ID corresponding to the instruction message;
[0071] Use the task ID as the key value and write it to the end of the instruction delivery queue of the device process dictionary in the format
[0072] Reference Figure 3 , Figure 3Schematic diagram of storing instruction messages in a queue and issuing instructions. In an embodiment of the present application, the application can carry key information such as device ID, instruction content, ttl cache time, etc. as an instruction message, and issue the instruction message to the platform. The platform receives the instruction message and can generate an instruction ID and a timestamp when receiving the instruction message. Then, the instruction ID can be combined with the device ID to form a task ID, and the task ID can be used as the key value and written into the tail of the instruction issuance queue of the device process dictionary in sequence according to the format. Here, it should be noted that the instruction ID is generated incrementally by the platform according to the order in which the instruction messages are received. Therefore, the instruction tasks in the process queue are sequential, and the device processes are independent of each other and do not affect each other.
[0073] When it is determined that the status bit in the device process is empty and the instruction can be issued, the platform can extract the first instruction message from the head of the instruction issuance queue, which is recorded as the target instruction message in this application, delete the target instruction message from the instruction issuance queue, and write the complete target instruction message into the status bit. At the same time, the target instruction message enters the issuance process, retains the complete information of the target instruction message in the uplink and downlink interaction channels, and after processing such as encoding and decoding and protocol conversion, the target instruction information required by the device is finally sent to the device in the form of a CON message.
[0074] The above process completes the issuance of a single instruction message, but the number of instruction messages included in a general instruction issuance queue is multiple. Therefore, in the embodiment of the present application, it is also necessary to continue to issue instructions in sequence according to the power saving mode and state machine of the device.
[0075] Specifically, it is understood that, generally speaking, after receiving a CON type command message, the device must return an ACK response to the platform according to the protocol requirements. Therefore, in the embodiment of the present application, the platform can receive the device's feedback message and determine whether the feedback message is a response message to the target command message.
[0076] Specifically, in some embodiments, receiving a feedback message from a device and determining whether the feedback message is a response message to the target instruction message includes:
[0077] Receive feedback messages from devices;
[0078] According to the message ID and token specified in the protocol, search in the device process whether there is a target channel corresponding to the feedback message;
[0079] If there is a target channel corresponding to the feedback message, comparing the complete information of the instruction message retained in the target channel with the current status bit to see whether they are consistent;
[0080] If the complete information of the instruction message retained in the target channel is consistent with the current status bit, it is determined that the feedback message is a response message of the target instruction message.
[0081] Reference Figure 4 , Figure 4 Schematic diagram of the processing of the instruction issuing queue after the device replies to the feedback message. In an embodiment of the present application, when the platform receives a feedback message from the device, it can find out whether there is a channel corresponding to the feedback message in the interactive channel of the existing device process according to the message id, token and other contents specified in the protocol. If the corresponding channel already exists for the feedback message, the complete information of the instruction message retained in the channel can be compared with the status bit at this time. If the comparison result is that the two are consistent, it means that the feedback message is a response message issued by the device for the instruction. At this time, the question-and-answer process of the target instruction message ends, and it can be confirmed that the device is in an activated state. Therefore, the status bit can be cleared next, and the channel corresponding to the target instruction message can be closed in the upstream and downstream interactive channels. Then CMD2 (that is, the next instruction message) can be issued in the order of the instruction issuing queue.
[0082] In other embodiments, if a comparison of the complete command message retained in the channel with the current status bit reveals a discrepancy, this indicates that the feedback message may be data or a heartbeat message proactively reported by the device, and the command issuance process has not yet completed. In this case, the status bit remains as the target command message, and the channel corresponding to the target command message in the uplink and downlink interaction channels remains open, awaiting a response message from the device or a platform timeout.
[0083] In some embodiments, the method further comprises:
[0084] If no feedback message from the device is received within a predetermined time threshold after the target instruction message is sent, the status bit is cleared and the channel corresponding to the target instruction message is closed in the uplink and downlink interaction channels.
[0085] Reference Figure 5 , Figure 5 This diagram illustrates the processing of the command dispatch queue after a device response timeout. In this embodiment, a predetermined time threshold can be set for the device's normal response cycle. If the platform does not receive a response message from the device after the target command message has been sent for more than the predetermined time threshold, the command dispatch queue is considered to have timed out. In this case, the platform can directly close the channel corresponding to the target command message in the device's upstream and downstream interaction channels and clear the status bit.
[0086] In some embodiments, the method further comprises:
[0087] Detect the power saving mode currently used by the device;
[0088] If the power saving mode used by the device is PSM, the sending of the command message is suspended until any uplink message of the device is received and the next command message is sent in the order of the command sending queue;
[0089] Alternatively, if the power saving mode used by the device is eDRX or DRX, the next instruction message is sent according to the order of the instruction sending queue.
[0090] In the embodiment of the present application, when a command is issued and a timeout occurs, the platform determines the timeout status by itself, rather than by the device. Therefore, the platform cannot know whether the device is currently in an active state. In this case, when the command process triggered by the timeout scenario ends, the platform can determine whether to continue issuing the next command message based on the power saving mode used by the device. If the platform determines that the power saving mode used by the device is PSM, it will stop the queue from issuing and wait for the device to return to an active state. If the platform determines that the power saving mode used by the device is eDRX / DRX, it will continue to issue the next command message in the order of the command issuance queue.
[0091] And, refer to Figure 6 In the case where the command sending queue is suspended due to entering PSM power saving mode, when any uplink message of the device (including but not limited to data reporting notify message, heartbeat message, etc.) arrives at the platform, it can be considered that the device is in the active state at this time, and the command queue resumes to be sent in sequence. Figure 6 This is a diagram of the processing of the command sending queue when the device activates the reply.
[0092] It is understandable that the current traditional IoT command issuance mostly adopts an immediate issuance mechanism, which cannot be flexibly issued according to the power saving mode or the status of the command queue. In NB-IoT scenarios, it is very easy to cause command loss, which has an unnecessary impact on the business process of the device; and most commands rely on database operations, or use scheduled tasks and timers to maintain the order of the command queue. In high-concurrency scenarios, it is very easy to cause slow queries, etc., affecting the platform performance, and it is impossible to ensure complete independence and decoupling between devices.
[0093] The processing method of the instruction message queue provided in the embodiment of the present application, for the NB-IoT scenario, relies on the device process to maintain the instruction issuance queue and issues it in sequence, ensuring the independence of the devices and the non-loss of instructions; utilizes the setting and comparison of the device process and status bits to achieve the integrity and normal flow of the instruction queue, avoiding the performance impact caused by frequent database operations or setting of scheduled tasks; by implementing different instruction queue processing mechanisms for different power saving modes and different instruction states, and based on the uplink and downlink channels maintained in the device process, there is no need to separately maintain the correspondence between the device and the uplink and downlink messages, thereby reducing the complexity of process processing and reducing performance consumption, and being able to achieve better technical effects than the existing technology.
[0094] The present application also provides a system for processing an instruction message queue, the system comprising:
[0095] A receiving module, configured to receive a command message sent by an application and write the command message to the tail of a command issuing queue;
[0096] an extraction module, configured to extract the target instruction message at the head of the instruction issuing queue when it is determined that the status bit in the device process is empty and the instruction can be issued;
[0097] A sending module, configured to write the target command message into a status bit and then send it to the device, and retain the complete information of the target command message in the uplink and downlink interaction channels;
[0098] a judgment module, configured to receive a feedback message from a device and judge whether the feedback message is a response message to the target instruction message;
[0099] A processing module is used to clear the status bit if the feedback message is a response message to the target instruction message, close the channel corresponding to the target instruction message in the uplink and downlink interaction channels, and issue the next instruction message in the order of the instruction issuance queue.
[0100] It is understandable that Figure 2 The contents of the embodiment of the processing method of the instruction message queue shown in the figure are applicable to the embodiment of the processing system of the instruction message queue of the present invention. The functions specifically implemented by the embodiment of the processing system of the instruction message queue of the present invention are similar to those of the embodiment of the processing method of the instruction message queue of the present invention. Figure 2 The processing method of the instruction message queue shown in the embodiment is the same as that of the embodiment shown in the embodiment, and the beneficial effects achieved are the same as those achieved in the embodiment shown in the embodiment. Figure 2 The beneficial effects achieved by the embodiment of the method for processing an instruction message queue shown are also the same.
[0101] Reference Figure 7 , the embodiment of the present application further discloses a computer device, including:
[0102] at least one processor 301;
[0103] At least one memory 302, configured to store at least one program;
[0104] When at least one program is executed by at least one processor 301, the at least one processor 301 implements the following Figure 2 An embodiment of a method for processing an instruction message queue is shown.
[0105] It is understandable that if Figure 2 The contents of the embodiment of the method for processing a command message queue shown in FIG. 1 are applicable to the embodiment of the computer device. The functions specifically implemented by the embodiment of the computer device are similar to those in FIG. Figure 2 The processing method of the instruction message queue shown in FIG. 1 is the same as that of FIG. 1 , and the beneficial effects achieved are the same as those of FIG. Figure 2 The beneficial effects achieved by the embodiment of the method for processing an instruction message queue shown are also the same.
[0106] The present application also discloses a computer-readable storage medium in which a program executable by a processor is stored. When the program is executed by the processor, it is used to implement the following Figure 2 An embodiment of a method for processing an instruction message queue is shown.
[0107] It is understandable that if Figure 2 The contents of the embodiment of the method for processing an instruction message queue shown in FIG. 1 are applicable to the embodiment of the computer-readable storage medium. The functions specifically implemented by the embodiment of the computer-readable storage medium are similar to those in FIG. Figure 2 The processing method of the instruction message queue shown in FIG. 1 is the same as that of FIG. 1 , and the beneficial effects achieved are the same as those of FIG. Figure 2 The beneficial effects achieved by the embodiment of the method for processing an instruction message queue shown are also the same.
[0108] In some optional embodiments, the functions / operations mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, the two boxes shown in succession may actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiments presented and described in the flow chart of the present application are provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logic flows presented herein. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.
[0109] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features can be integrated into a single physical system and / or software module, or one or more functions and / or features can be implemented in separate physical systems or software modules. It is also understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present application. More specifically, given the properties, functions, and internal relationships of the various functional modules in the system disclosed herein, the actual implementation of the module will be understood within the conventional skills of an engineer. Therefore, those skilled in the art can implement the present application as set forth in the claims using ordinary techniques without undue experimentation. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the appended claims and their equivalents.
[0110] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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 and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0111] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, system, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, system, or device). For purposes of this specification, a "computer-readable medium" can be any system that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, system, or device.
[0112] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic systems), a portable computer disk cartridge (magnetic systems), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic system, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0113] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0114] In the above description of this specification, reference to the terms "one embodiment / example," "another embodiment / example," or "certain embodiments / examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples.
[0115] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.
[0116] The above is a detailed description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
[0117] In the description of this specification, reference to the terms "one embodiment," "another embodiment," or "certain embodiments" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples.
[0118] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for processing an instruction message queue, characterized in that: The method comprises: Receive the command message sent by the application and write the command message to the end of the command sending queue; When it is determined that the status bit in the device process is empty and the instruction can be issued, the target instruction message at the first position is taken out from the head of the instruction issuing queue; Writing the target command message into the status bit and sending it to the device, and retaining the complete information of the target command message in the uplink and downlink interaction channels; receiving a feedback message from a device, and determining whether the feedback message is a response message to the target instruction message; If the feedback message is a response message to the target instruction message, the status bit is cleared, the channel corresponding to the target instruction message is closed in the uplink and downlink interaction channels, and the next instruction message is sent in the order of the instruction sending queue.
2. The method for processing a command message queue according to claim 1, wherein: The instruction message includes the device ID, instruction content and TTL cache time.
3. The method for processing a command message queue according to claim 2, wherein: The receiving the instruction message sent by the application and writing the instruction message to the tail of the instruction issuing queue includes: Receive a command message sent by an application and generate a command ID corresponding to the command message; the command ID increases in the order in which the command message is received; Generate a task ID corresponding to the instruction message according to the instruction ID and device ID corresponding to the instruction message; The task ID is used as the key value and written into the tail of the instruction delivery queue of the device process dictionary according to the format.
4. The method for processing a command message queue according to claim 1, wherein: Sending the target instruction message to the device includes: After encoding, decoding and protocol conversion of the target instruction message, it is sent to the device in the form of a CON message.
5. The method for processing a command message queue according to claim 1, wherein: The receiving device's feedback message, and determining whether the feedback message is a response message to the target instruction message, comprises: Receive feedback messages from devices; According to the message ID and token specified in the protocol, search in the device process whether there is a target channel corresponding to the feedback message; If there is a target channel corresponding to the feedback message, comparing the complete information of the instruction message retained in the target channel with the current status bit to see whether they are consistent; If the complete information of the instruction message retained in the target channel is consistent with the current status bit, it is determined that the feedback message is a response message of the target instruction message.
6. A method for processing a command message queue according to any one of claims 1 to 5, characterized in that: The method further comprises: If no feedback message from the device is received within a predetermined time threshold after the target instruction message is sent, the status bit is cleared and the channel corresponding to the target instruction message is closed in the uplink and downlink interaction channels.
7. A method for processing an instruction message queue according to claim 6, characterized in that: The method further comprises: Detect the power saving mode currently used by the device; If the power saving mode used by the device is PSM, the sending of the command message is suspended until any uplink message of the device is received and the next command message is sent in the order of the command sending queue; Alternatively, if the power saving mode used by the device is eDRX or DRX, the next instruction message is sent according to the order of the instruction sending queue.
8. A processing system for an instruction message queue, characterized in that: The system comprises: A receiving module, configured to receive a command message sent by an application and write the command message to the tail of a command issuing queue; an extraction module, configured to extract the target instruction message at the head of the instruction issuing queue when it is determined that the status bit in the device process is empty and the instruction can be issued; A sending module, configured to write the target command message into a status bit and then send it to the device, and retain the complete information of the target command message in the uplink and downlink interaction channels; a judgment module, configured to receive a feedback message from a device and judge whether the feedback message is a response message to the target instruction message; The processing module is used to clear the status bit if the feedback message is a response message to the target instruction message, close the channel corresponding to the target instruction message in the uplink and downlink interaction channels, and issue the next instruction message in the order of the instruction issuance queue.
9. A computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method for processing an instruction message queue according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement a method for processing an instruction message queue according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Asynchronous message processing system and method
CA2292450A1
Message pushing method and device and server
CN113127236A