Queuing method and queuing system for target operation
Through the combination of client encoding and server-side sorting, the conflict problem of target operation queuing in industrial systems is solved, efficient and scalable queuing processing is achieved, server-side operations are simplified and error rates are reduced.
Patent Information
- Application Number
- CN202211223479.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-08
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-10-08
AI Technical Summary
In industrial systems, due to service capabilities limitations, the main process unit cannot serve multiple slave process units at the same time, resulting in conflicts in target operations, and these target operations need to be queued. However, the queuing method of the prior art is high error rate and is not easy to expand, and when the queuing factors change, the server needs to make major changes.
Using a combination of client encoding and server sorting, the client generates queueing identifiers based on the type of target operation, request time and predetermined priority, etc. The server obtains the queueing identifier of the client at each predetermined time interval, and determines which client is the turn to perform its target operation through simple sorting logic.
It simplifies the operation of the server, reduces the error rate, and improves the scalability of the system. When the factors affecting queuing change, you only need to adjust the client's encoding, and there is no need for the server to make changes.
Smart Images

Figure CN115550453B_ABST
Abstract
Description
Technical Field
[0001] The present invention discloses a queuing method and a queuing system for target operation. Background Art
[0002] With the advancement of enterprise informatization, intelligent applications based on big data, machine learning, and artificial intelligence are increasingly being used in the industrial field. Process units in industrial systems are also increasingly controlled by computing devices such as programmable logic controllers (PLCs), computers, and intelligent devices to automatically and flexibly perform a large number of different target operations.
[0003] However, it is common that a master process unit is designed to serve two or more slave process units, but is limited by its service capacity and can only serve one slave process unit at the same time. When the target operations requested by these two or more slave process units conflict in implementation, it is necessary to queue these target operations. Summary of the invention
[0004] One aspect of the present disclosure provides a queuing method for a target operation. The method includes: generating an initial queuing identifier based on a predetermined priority of the client by each of a plurality of clients, and changing the queuing identifier based on the predetermined priority of the target operation and the time when the request is detected when a request for executing the target operation is detected; performing, at predetermined time intervals, the following operations by a server associated with each of the plurality of clients: obtaining the queuing identifier of the client from each of the clients, sorting the obtained queuing identifiers to generate a queuing response, the queuing response indicating the queuing identifier sorted to the first place, and broadcasting the queuing response to each of the clients; and identifying, by each of the plurality of clients, if its queuing identifier is not the initial queuing identifier, whether the client is the client corresponding to the queuing identifier sorted to the first place indicated by the queuing response, and controlling the execution of its target operation when it is identified that the client is the client corresponding to the queuing identifier sorted to the first place indicated by the queuing response.
[0005] According to another aspect of the present disclosure, a queuing system for target operations is provided. The queuing system includes: a plurality of clients, each of which is configured to generate an initial queuing identifier based on a predetermined priority of the client, and in the case of detecting a request for executing a target operation, change the queuing identifier based on the predetermined priority of the target operation and the time when the request is detected; and a server, configured to perform at every predetermined time interval: obtaining the queuing identifier of each of the plurality of clients associated with the server, sorting the obtained queuing identifiers to generate a queuing response, the queuing response indicating the queuing identifier sorted to the first place, and broadcasting the queuing response to each of the clients, wherein each of the clients further performs after changing the queuing identifier: identifying whether the client is the client corresponding to the queuing identifier sorted to the first place indicated by the queuing response, and in the case of identifying that the client is the client corresponding to the queuing identifier sorted to the first place indicated by the queuing response, controlling the execution of its target operation.
[0006] The queuing method and queuing system disclosed in the present invention adopt a method combining client encoding and server sorting. The client encodes the request for the target operation to generate a queuing identifier, and the server sorts the queuing identifier. In this way, the queuing influencing factors can be easily reflected in the queuing identifier through the encoding rules of the client, and the server only uses a simple sorting logic to sort the queuing identifier without considering these queuing influencing factors. When the queuing influencing factors change, only the client encoding needs to be adjusted without the server making any changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] The various aspects, features and advantages of the present disclosure will become clearer and easier to understand through the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0008] Figure 1 A queuing system and a schematic application scenario thereof according to an embodiment of the present disclosure are shown;
[0009] Figure 2 A schematic flow chart showing a queuing method according to an embodiment of the present disclosure; and
[0010] Figure 3 An example in which the queuing method according to an embodiment of the present disclosure is implemented is shown.
[0011] Specific embodiment
[0012] The present disclosure will be described in detail below with reference to exemplary embodiments of the present disclosure. However, the present disclosure is not limited to the embodiments described herein, and it can be implemented in many different forms. The described embodiments are only used to make the present disclosure thorough and complete, and to fully convey the concept of the present disclosure to those skilled in the art. The features of the various embodiments described can be combined or replaced with each other, unless explicitly excluded or should be excluded according to the context.
[0013] Figure 1 A queuing system and a schematic application scenario thereof according to an embodiment of the present disclosure are shown.
[0014] As mentioned above, it is common that a main process unit is designed to serve two or more slave process units, but is limited in its service capacity and can only serve one slave process unit at the same time.
[0015] refer to Figure 1 The main process unit T is designed to serve 6 slave process units A1, A2, A3 and B1, B2, B3. For example, the slave process units A1, A2, A3 are biofilters for nitrogen removal, and the slave process units B1, B2, B3 are biofilters for carbon removal. The main process unit T is equipped with a flushing water system for flushing each biofilter.
[0016] Clients C1, C2, C3, C4, C5, and C6 are computing devices such as PLCs, computers, and intelligent devices that respectively host process units A1, A2, A3 and B1, B2, and B3. For example, an administrator can start, pause, stop, set working parameters, and request target operations for biofilter A1 on client C1. Working parameter settings include, but are not limited to, setting the particle size and thickness of the working layer filler, the particle size and thickness of the supporting layer filler, and the like. Target operation requests include, but are not limited to, feed requests, discharge requests, flushing water requests, oxygen supply requests, drying requests, and the like. The following uses a flushing water system as an example to illustrate the present disclosure, and the target operations mentioned should be understood as flushing water-related target operations.
[0017] The server S is a computing device such as a PLC, a computer, or an intelligent device that hosts the main process unit T. The server S can communicate with each client C1-C6 via wired, wireless, or any other known communication method to receive data from and send data to the clients C1-C6. For example, the server S receives queue identifiers from the clients C1-C6 and sorts the queue identifiers (as described below). For another example, the server S collaborates with the clients C1-C6 to complete target operations related to flushing water.
[0018] The queuing method according to the prior art is mainly performed by the server S. The clients C1-C6 transmit their respective information about the requested target operation and about themselves to the server S. The server S considers various queuing influencing factors and uses complex sorting logic to sort the target small left. The queuing method has a high error rate, is not easy to expand, and when the queuing influencing factors change, the server needs to make major changes.
[0019] The queuing system according to the embodiment of the present disclosure includes a server S and multiple clients C1~C6. The server S and each client C1~C6 are combined to perform the queuing method according to the embodiment of the present disclosure. Each client C1~C6 generates a queuing identifier based on the queuing influencing factor encoding, and the priority of each queuing influencing factor is reflected in the queuing identifier. The server S obtains the queuing identifier of each client C1~C6 at every predetermined time interval, and sorts the queuing identifiers to determine which client is to perform its target operation. The queuing method is simple and has a low error rate. When the queuing influencing factors change, only the client's encoding needs to be adjusted without the server making any changes. The client's encoding rules can also be designed to be transparent, easy to read, and easy to modify and expand.
[0020] Although the queuing system according to the present disclosure is combined Figure 1 The flushing water system is used as an example for introduction, but the present disclosure is not limited to this. Without departing from the inventive concept and spirit of the present disclosure, the queuing system of the present disclosure is also applicable to other industrial scenarios after appropriate modification and adjustment.
[0021] Figure 2 A schematic flowchart of a queuing method according to an embodiment of the present disclosure is shown.
[0022] For ease of understanding, before explaining the queuing method, the queuing rules in the flushing water system are first introduced.
[0023] According to the process requirements of the flushing water system, each of the nitrogen removal biofilters A1, A2, and A3 may have no request or request one of the following target operations: forced flushing for nitrogen removal, flushing at the blocking value of nitrogen removal, and timed flushing for nitrogen removal. Each of the carbon removal biofilters B1, B2, and B3 may have no request or request one of the following target operations: forced flushing for carbon removal, flushing at the blocking value of carbon removal, and timed flushing for carbon removal. Among them, nitrogen removal target operations take precedence over nitrogen removal target operations, forced flushing target operations take precedence over blocking value flushing target operations, and blocking value flushing target operations take precedence over timed flushing target operations. Forced flushing refers to a flushing operation that may have serious negative consequences if not performed in time. Blockage value flushing refers to a flushing operation that needs to be performed when the blockage value reaches a certain level. Timed flushing refers to a flushing operation that is performed routinely, periodically (for example, flushing every few hours or days, etc.) or less urgent. Therefore, the predetermined priorities for the types of target operations are in the following order from high to low: forced flushing for nitrogen removal, forced flushing for carbon removal, flushing for nitrogen removal blocking value, flushing for carbon removal blocking value, timed flushing for nitrogen removal, timed flushing for carbon removal, and no request.
[0024] In practice, it may happen that several biofilters request the same target operation. In this case, it is expected that the target operation is performed on the corresponding biofilters in the order of the request. For example, in one example, biofilters A1 and A2 both request to perform nitrogen removal forced flushing, but biofilter A1 generates the request earlier in time, so it is expected that biofilter A1 will be performed nitrogen removal forced flushing first.
[0025] In practice, it may also happen that several biofilters request the same target operation at the same time. In this case, it is expected that the target operation is performed on the corresponding biofilter according to the predetermined priority of the biofilter established in advance. For example, the predetermined priorities formulated for the nitrogen removal biofilters A1, A2 and A3 are A1, A2, A3 in order from high to low, and the predetermined priorities formulated for the carbon removal biofilters B1, B2 and B3 are B1, B2, B3 in order from high to low. For example, in one example, biofilters A1, A2 and A3 all request to perform nitrogen removal timed flushing at the same time, and then nitrogen removal timed flushing is performed on biofilters A1, A2 and A3 in turn. In addition, nitrogen removal takes precedence over carbon removal, and A1, A2, A3 generally take precedence over B1, B2, B3. Since the client corresponds to the biofilter one-to-one, the predetermined priorities of the client are C1, C2, C3, C4, C5, C6 in order from high to low.
[0026] In summary, the queuing rules introduced above perform queuing by considering the type of target operation, the time of requesting the target operation, and the priority of the filter itself as queuing influencing factors.
[0027] refer to Figure 2 According to the embodiment of the present disclosure, the queuing method 200 includes steps S201 to S204. Steps S201, S202 and S204 are executed by one or more of the clients C1 to C6, and step S203 is executed by the server. The reference number S203 here does not mean that step S203 is executed after steps S201 and S202. In the present disclosure, step S203 is cyclically executed at a predetermined time interval ΔT throughout the entire queuing method.
[0028] In step S201, each of the multiple clients C1-C6 generates an initial queue identifier based on the predetermined priority of the client. For example, each client C1-C6 can generate an initial queue identifier when the corresponding biofilter A1, A2, A3, B1, B2, B3 is initialized (for example, when powered on). Since each biofilter A1-A3, B1-B3 has not yet generated a request to perform any target operation, the initial queue identifier only reflects the information of the client itself and does not reflect any target operation information. That is, the initial queue identifier indicates no request.
[0029] In step S202, each of the multiple clients C1 to C6, when detecting a request to perform a target operation, changes the queue identifier based on the predetermined priority of the target operation and the time when the request is detected. For example, client C1 detects that a request for forced flushing of nitrogen removal is generated for biofilter A1, and then generates a new queue identifier to replace the initial queue identifier based on the predetermined priority of forced flushing of nitrogen removal and the time when the request is detected. The request for the target operation can be generated, for example, by an administrator inputting a corresponding command on the client, generated in response to the value of a corresponding sensor of the biofilter (for example, a blockage value sensor), and so on. In addition to information about the client itself, the new queue identifier also contains type information of the target operation and time information when the request is detected. That is, the changed queue identifier indicates that a specific client requests to perform a specific target operation at a specific time.
[0030] In step S203, the server S executes at every predetermined time interval ΔT: obtaining the queue identifier of each client among the clients C1 to C6, sorting the obtained queue identifiers to generate a queue response, the queue response indicating the queue identifier sorted to the first place, and the server S broadcasts the queue response to each client.
[0031] As mentioned above, step S203 is executed cyclically at a predetermined time interval ΔT throughout the entire queuing method. The server S can start executing step S203 from the time it is initialized (for example, when powered on). Since the queue identifier of each client C1~C6 changes due to the generation of the target operation request and the generation of the request is irregular, the server S obtains the queue identifiers of all clients C1~C6 once every time interval ΔT, so that it can promptly know the generation of each client's request and make queues and processes in time. The predetermined time interval ΔT can be, for example, 0.5 seconds, 1 second, etc. In addition, in order to save computing power, the sorting logic of the server S can be designed to sort only the first queue identifier without generating a complete sorting queue.
[0032] In addition, in step S203, the server S sorts the obtained queue identifiers to generate a queue response, which may further include: comparing whether the obtained queue identifiers of each client are the same as the queue identifiers of the corresponding client obtained in the previous predetermined time interval, and re-sorting the obtained queue identifiers when the queue identifier of at least one client is different from the queue identifier in the previous predetermined time interval. In other words, re-sorting is performed only when it is found that the queue identifier of at least one client has changed. In this way, the computing power of the server S can be further saved, thereby avoiding repeated unnecessary sorting when the queue identifiers of all clients C1 to C6 remain unchanged for a long time.
[0033] In step S204, each of the multiple clients C1~C6, when its queue identifier is not the initial queue identifier, identifies whether the client is the client corresponding to the queue identifier ranked first indicated by the queue response, and controls the execution of its target operation when identifying that the client is the client corresponding to the queue identifier ranked first indicated by the queue response.
[0034] In this step, only the client whose queue identifier is no longer the initial queue identifier will identify whether the client is the client corresponding to the queue identifier that is ranked first as indicated by the queue response. In other words, only the client that has generated a request for the target operation will perform this identification operation. This is conducive to saving the computing power of clients C1~C6, because for clients without requests, there is no need to perform this identification operation. When all clients C1~C6 have no requests, the queue response generated by the server S is meaningless.
[0035] In this step, the client controls the target operation, including the client and the server cooperating to perform the target operation. For example, after the client identifies itself as the client corresponding to the queue identifier that is ranked first indicated by the queue response, it sends a token for performing the target operation to the server, and the token is included in the queue response and is designed to be decrypted only by the client corresponding to the queue identifier that is ranked first indicated by the queue response. After the server verifies the token, it performs a flushing water operation on the corresponding filter. During the flushing water process, the client monitors and feeds back the status of the filter to the server, and the server adjusts flushing parameters such as water flushing intensity and water flushing time according to the fed-back status.
[0036] Combine the following Figure 3 , the queuing method 200 is further illustrated using an example.
[0037] Figure 3 An example in which the queuing method according to an embodiment of the present disclosure is implemented is shown.
[0038] refer to Figure 3 The queuing method 200 starts to execute from a predetermined time interval ΔT1. During ΔT1, the clients C1-C6 are initialized and step S201 is executed, that is, initial queuing identifiers NR1-NR6 are generated based on their respective predetermined priorities. At this time, each client has not detected a request for the target operation, and NR1-NR6 all represent no request.
[0039] The server S is initialized and executes step S203, i.e., it obtains the queue identification NR1~NR6 of each client C1~C6 and sorts them. Since the initial queue identification NR1~NR6 is coded and generated by considering only the queue factor of the predetermined priority of each client, the sorting of NR1~NR6 is consistent with the sorting of the predetermined priority of each client. According to the aforementioned queueing rules, the predetermined priority of each client is C1, C2, C3, C4, C5, C6 from high to low, so the server S will determine through its sorting logic that NR1 is ranked first (such as Figure 3 If the sorting logic is designed to form a complete queue, the queue will be NR1, NR2, NR3, NR4, NR5, NR6. The server S generates a queue response indicating NR1 and broadcasts the queue response to each of the clients C1-C6.
[0040] Since the queue identifiers of clients C1-C6 are still the initial queue identifiers, that is, clients C1-C6 have not yet detected the request for the target operation, clients C1-C6 do not identify whether they are the clients corresponding to the queue identifier ranked first indicated by the queue response.
[0041] During the predetermined time interval ΔT2, all biofilters still do not generate a request for the target operation, and the queue identifiers of clients C1 to C6 remain unchanged at NR1 to NR6. NR1 is still ranked first (e.g. Figure 3 The queue response generated by the server S still indicates NR1. The clients C1 to C6 still do not perform the identification operation.
[0042] Alternatively, the server S may also compare the obtained queue identifiers NR1-NR6 with the queue identifiers NR1-NR6 obtained in the last predetermined time interval ΔT1. If the comparison shows that the queue identifiers of each client are unchanged, the sorting logic is not used for re-sorting to save computing power.
[0043] During the predetermined time interval ΔT3, target operation requests are generated for biofilters A2, A3 and B1. For example, biofilter A2 requests nitrogen removal timed flushing, biofilter A3 requests nitrogen removal blockage value flushing, and biofilter B1 requests carbon removal blockage value flushing.
[0044] Clients C2, C3 and C4 execute step S202, change the queue identifier based on the predetermined priority of the corresponding target operation and the time when the request is detected, and generate new queue identifiers R2, R3 and R4 to replace the initial queue identifiers NR2, NR3 and NR4 respectively.
[0045] The server S executes step S203 and obtains the queue identifiers of clients C1 to C6, which are NR1, R2, R3, R4, NR5, and NR6 in order. According to the above queue rules, the nitrogen removal blocking value flushing represented by R3 takes precedence over the carbon removal blocking value flushing represented by R4, the carbon removal blocking value flushing represented by R4 takes precedence over the nitrogen removal timing flushing represented by R2, and the nitrogen removal timing flushing represented by R2 takes precedence over no request. Therefore, the server S determines that the queue identifier R3 is sorted to the first place (such as Figure 3 If the ordering logic of the server S is designed to generate a complete queue, the queue will be R3, R4, R2, NR1, NR5, NR6. The server S generates a queue response indicating the queue identifier R3, and broadcasts the queue response to each of the clients C1-C6.
[0046] The queue identifiers of clients C2 to C4 are no longer the initial queue identifiers, and they will execute step S204 to identify whether they are the clients corresponding to the queue identifier R3 indicated by the queue response. For example, clients C2 to C4 can perform this identification by comparing whether the queue identifier R3 indicated by the received queue response is the same as their current queue identifier. Therefore, client C3 will identify itself as the client corresponding to the queue identifier R3 indicated by the queue response, thereby controlling its target operation (i.e., nitrogen removal blocking value flushing) to start execution. The execution of the target operation can be completed by the collaboration of client C3 and server S. In order to avoid blurring the present disclosure, this will not be described in detail. Clients C2 and C4 will identify themselves as not the clients corresponding to the queue identifier R3 indicated by the queue response, and continue to wait without taking any action.
[0047] Thus, according to the queuing method of the embodiment of the present disclosure, the client generates a queue identifier according to the type of target operation, the time when the request for the target operation is detected, the predetermined priority of the client, and other queue influencing factors. The server only obtains the queue identifier of the client once every predetermined time interval, and then uses a simple sorting logic to sort the queue identifiers. Compared with the prior art, the operation of the server is simplified. When a client changes, only the changed client needs to be adjusted accordingly without any change on the server.
[0048] Reference Figure 2 The queuing method 200 may further include steps S205 and S206.
[0049] In step S205, each of the multiple clients changes the queue identifier again once its target operation starts to be executed, so that the queue identifier after the change is sorted to the first place by the server.
[0050] Continue with Figure 3 An example is used to illustrate this step.
[0051] During the predetermined time interval ΔT3, once the client C3 starts to perform the nitrogen removal blocking value flushing, step S205 is executed, that is, a new queue identifier OR3 is generated to replace the queue identifier R3. The queue identifier OR3 is encoded so that it is ranked first after being obtained by the server S (e.g. Figure 3 The specific implementation method depends on the encoding rules of the clients C1 to C6 and the queuing logic of the server S, which will be explained with examples in the following text.
[0052] During the predetermined time interval ΔT4, the biofilter A1 requests to perform forced flushing for nitrogen removal. The client C1 detects the request and executes step S202 to generate a new queue identifier R1 to replace its initial queue identifier NR1.
[0053] The server S executes step S203 to obtain the queue identification of each client C1 to C6: R1, R2, OR3, R4, NR5, NR6. Since the queue identification OR3 is encoded to be ranked first by the server S (such as Figure 3 As shown in the middle circle), the queue response generated by the server S still indicates the queue identifier OR3. Therefore, the nitrogen removal blocking value flushing being performed by the client C3 will not be interrupted. Since the predetermined priority of the nitrogen removal forced flushing represented by R1 is higher than the predetermined priority of the carbon removal blocking value flushing represented by R4, if the sorting logic of the server S is designed to generate a complete queue, the queue will be: OR3, R1, R4, R2, NR5, NR6.
[0054] In this way, during the predetermined time interval ΔT5 to ΔTn-1, as long as the queue identification of the client C3 remains OR3, no matter how the queue identifications of other clients C1, C2, C4, and C5 change, the server S always determines the queue identification OR3 of the client C3 as the first (e.g. Figure 3 In this way, the nitrogen removal and flushing of the biofilter A3 will not be interrupted.
[0055] In step S206, each of the plurality of clients changes its queue identification back to the initial queue identification once its target operation is completed.
[0056] Continue with Figure 3 An example is used to illustrate this step.
[0057] At the predetermined time interval ΔTn, the flushing of the nitrogen removal blockage value of the biological filter A3 is completed, and the client C3 changes its queue identifier OR3 back to the initial queue identifier NR3.
[0058] The server S obtains the queue identifier of each client C1 to C6: R1, R2, NR3, R4, R5, and R6. The target operation types embodied by R5 and R6 are both nitrogen removal timed flushing, and the request time is 12:00 on September 20, 2022. According to the aforementioned queuing rules, the nitrogen removal forced flushing embodied by R1 takes precedence over the carbon removal blocking value flushing embodied by R4, the carbon removal blocking value flushing embodied by R4 takes precedence over the nitrogen removal timed flushing embodied by R2, and the nitrogen removal timed flushing embodied by R2 takes precedence over the nitrogen removal timed flushing embodied by R5 and R6. The request times of R5 and R6 are the same, but the priority of client C5 is higher than that of client C6. Therefore, the server S puts R1 first (such as Figure 3 ), and if the sorting logic of the server S is designed to generate a complete queue, the queue will be: R1, R4, R4, R5, R6, NR3. Then the client C1 performs its target operation to remove nitrogen and force flush.
[0059] Combination of the above Figure 3 The example describes the process of the queuing method 200 in detail, and the following describes an example encoding rule used by the client to generate a queuing identifier.
[0060] As an example, clients C1-C6 may use binary coding to generate a binary number as a queue identifier. The binary bits of the binary number include, from high to low, a first group of binary bits indicating whether the request is being executed, a second group of binary bits indicating the predetermined priority of the target operation, a third group of binary bits indicating the time when the request is detected, and a fourth group of binary bits indicating the predetermined priority of the client.
[0061] Table 1 below shows an example 64-bit binary encoding rule, where bit 62 is used as the first group of binary bits indicating whether the request is being executed, bit 42-bit 39 is used as the second group of binary bits indicating the predetermined priority of the target operation, bit 38-bit 32 and bit 27-bit 8 are used as the third group of binary bits indicating the time when the request was detected, bit 7-bit 0 is used as the fourth group of binary bits indicating the predetermined priority of the client, and the remaining bit 63, bit 61-bit 43, bit 31-bit 28 are used as reserved bits for future expansion.
[0062] Table 1
[0063]
[0064] The clients C1 to C6 use the encoding rule to encode the higher priority requests into smaller binary numbers, and the server S uses a sorting logic that sorts the binary numbers from small to large (for example, a bubble algorithm) to sort these binary numbers. However, the present disclosure is not limited to this. For example, the higher priority requests can also be encoded into larger binary numbers, and the server S accordingly uses a sorting logic that sorts the binary numbers from large to small. As a result, the queue identifier generated by the client with the highest priority request will be ranked first by the server S.
[0065] Table 2 below shows the corresponding encoding of the second group of binary bits bit42-bit39 representing the predetermined priority of the target operation.
[0066] Table 2
[0067]
[0068]
[0069] Table 3 below shows the corresponding encoding of the fourth group of binary bits representing the predetermined priority of the client.
[0070] Table 3
[0071] Client Corresponding filter Booking priority Bit7-bit0 C1 A1 0 00000000 C2 A2 1 00000001 C3 A3 2 00000010 C4 B1 3 00000011 C5 B2 4 00000100 C6 B3 5 00000101
[0072] Reference Figure 3 , apply the above encoding rules to Figure 3 In the example, during the predetermined time interval ΔT1, clients C1 to C6 are initialized, and the generated initial queue identifiers are generated. Specifically, the first group of binary bits and the second group of binary bits are encoded as the corresponding maximum values, and the fourth group of binary bits are encoded as the value representing the predetermined priority of the client. The initialization time is encoded as 00:00 on September 20, 2022, and the third group of binary bits bit38-bit32 and bit27-bit8 representing the time when the request was detected are encoded as 10110 and 1001-10100-00000-000000, respectively. For simplicity, the encoding results of the third group of binary bits representing time are omitted in Table 4.
[0073] Table 4
[0074]
[0075] The result of sorting the queue identifiers from small to large by the server S is: NR1, NR2, NR3, NR4, NR5, NR6. The queue response indication NR1 broadcast by the server S to the client.
[0076] During the predetermined time interval ΔT2, each queue identifier remains unchanged.
[0077] During the predetermined time interval ΔT3, clients C2, C3 and C4 respectively generate new queue identifiers R2, R3 and R4 based on the nitrogen removal timing flushing, nitrogen removal blocking value flushing and carbon removal blocking value flushing codes to replace NR2, NR3 and NR4 respectively. The codes of the queue identifiers of clients C1 to C6 are shown in Table 5. Compared with Table 4, each second group of binary bits is changed to a value representing the predetermined priority of the corresponding target operation, and each third group of binary bits is changed to a value representing the time when the corresponding request is detected. For simplicity, the coding result of the third group of binary bits representing time is omitted in Table 5.
[0078] Table 5
[0079]
[0080] The result of sorting the queue identifiers from small to large by the server S is: R3, R4, R2, NR1, NR5, NR6. The server S broadcasts the queue response indication R3 to the client.
[0081] During the predetermined time interval ΔT4, client C3 encodes the first group of binary bits bit 62 in its queue identifier as the minimum value 0 based on the target operation requested by the client C3 being executed, so as to generate a new queue identifier OR3 to replace the queue identifier R3. Client C1 generates a new queue identifier R1 to replace the queue identifier NR1 based on the nitrogen removal forced flushing encoding. The encoding of the queue identifiers of clients C1 to C6 is shown in Table 6. For simplicity, the encoding result of the third group of binary bits representing time is omitted in Table 6.
[0082] Table 6
[0083]
[0084] The result of sorting the six queue identifiers from small to large by the server S is: OR3, R1, R4, R2, NR5, NR6. The queue response indication OR3 broadcast by the server S to the client is.
[0085] During the predetermined time interval ΔT4 to ΔTn-1, client C5 generates queue identifier R5 based on the target operation carbon removal timing flushing and the request occurrence time, for example, 12:00 on September 20, 2022, to replace queue identifier NR5. Client C6 generates queue identifier R6 based on the same target operation carbon removal timing flushing and the same request occurrence time, 12:00 on September 20, 2022, as C4, to replace queue identifier NR6. However, no matter how the queue identifiers of these clients change, only the queue identifier OR3 of client C3 has bit 62 as 0, so OR3 is always the smallest binary number among all queue identifiers, and OR3 is always ranked first (such as Figure 3 The queue response broadcast by the server S to the client always indicates OR3.
[0086] Until the predetermined time interval ΔTn, client C3 changes its queue identifier from OR3 back to NR3 based on the completion of the target operation requested by it. The encoding of the queue identifiers of clients C1 to C6 is shown in Table 7. For simplicity, the encoding result of the third group of binary bits is omitted in Table 7.
[0087] Table 7
[0088]
[0089] The result of the server S sorting the queue identifiers from small to large is: R1, R4, R2, R5, R6, NR3. The server S broadcasts the queue response indication R1 to the client. Then the client C1 performs its target operation of nitrogen removal forced flushing.
[0090] The encoding rules described above are only examples, and any encoding rules for the client that can implement the queuing method 200 are possible. The above description of the sorting logic of the server S from small to large is also exemplary, and any sorting logic that can cooperate with the encoding rules of the client to implement the queuing method 200 is possible.
[0091] Those skilled in the art should understand that the above-mentioned specific embodiments are merely examples and not limitations, and various modifications, combinations, partial combinations and replacements may be made to the embodiments of the present disclosure according to design requirements and other factors. As long as they are within the scope of the attached claims or their equivalents, they belong to the scope of rights to be protected by the present disclosure.
Claims
1. A queuing method for target operation, comprising: generating, by each of the plurality of clients, an initial queue identifier based on a predetermined priority of the client, and, in the event of detecting a request to perform a target operation, changing the queue identifier based on the predetermined priority of the target operation and a time when the request was detected; The server associated with each of the plurality of clients performs, at every predetermined time interval: obtaining a queue identifier of the client from each of the clients, sorting the obtained queue identifiers to generate a queue response, the queue response indicating a queue identifier sorted to the first position, and broadcasting the queue response to each of the clients; as well as Each of the plurality of clients, when its queue identifier is not an initial queue identifier, identifies whether the client is a client corresponding to the queue identifier that is ranked first as indicated by the queue response, and when the client is identified as the client corresponding to the queue identifier that is ranked first as indicated by the queue response, controls the execution of its target operation, The queue identifier is a binary number, and the server sorting the obtained queue identifiers includes sorting the binary number.
2. The method according to claim 1, wherein: The server sorting the obtained queue identifiers to generate a queue response includes: The server compares the obtained queue identifiers of each client with the queue identifiers of the corresponding client obtained in the previous predetermined time interval to see whether they are the same, and reorders the obtained queue identifiers when the queue identifier of at least one client is different from the queue identifier in the previous predetermined time interval.
3. The method according to claim 1, further comprising: Each client changes the queue identifier again once its target operation starts to be executed, so that the queue identifier after being changed again will be sorted to the first place by the server.
4. The method according to claim 3, further comprising: Each client changes its queue identification back to the initial queue identification once its target operation is completed.
5. The method according to claim 4, wherein: The binary bits of the binary number include, from high to low, a first group of binary bits indicating whether the request is being executed, a second group of binary bits indicating a predetermined priority of the target operation, a third group of binary bits indicating a time when the request is detected, and a fourth group of binary bits indicating a predetermined priority of the client.
6. The method according to claim 5, wherein: The server sorting the obtained queue identifiers to generate a queue response includes sorting the obtained queue identifiers from small to large.
7. The method according to claim 6, wherein: The initial queue identification generated by each client includes: encoding the first group of binary bits and the second group of binary bits as corresponding maximum values respectively; The fourth set of bits is encoded as a value representing a predetermined priority level of the client.
8. The method according to claim 7, wherein: Changing the queue identifier by each client based on a predetermined priority of the target operation and a time when the request is detected, comprises: changing the second set of bits to a value representing a predetermined priority level of the target operation; The third set of bits is changed to a value representing the time at which the request was detected.
9. The method according to claim 8, wherein: By each of the clients, once the target operation begins to be executed, changing the queue indicator again comprises: By each of the clients, once the target operation begins to be executed, the first set of binary bits is changed to a corresponding minimum value.
10. A queuing system for target operations, comprising: a plurality of clients, each of which is configured to generate an initial queue identifier based on a predetermined priority of the client, and upon detecting a request to perform a target operation, change the queue identifier based on the predetermined priority of the target operation and a time when the request was detected; as well as The server is configured to perform, at every predetermined time interval: obtaining a queue identifier of each of the plurality of clients associated with the server, sorting the obtained queue identifiers to generate a queue response, the queue response indicating a queue identifier sorted first, and broadcasting the queue response to each of the clients, wherein, after changing the queue identifier, each client further performs: identifying whether the client is a client corresponding to the queue identifier that is ranked first and indicated by the queue response, and, if the client is identified as a client corresponding to the queue identifier that is ranked first and indicated by the queue response, controlling the execution of its target operation; The queue identifier is a binary number, and the server sorting the obtained queue identifiers includes sorting the binary number.
Citation Information
Patent Citations
Storage server task response method, client side, server and system thereof
CN106257893A