Queue congestion determination method and storage medium

By counting the waiting time and number of waiting processing of positioning information of the positioning equipment in the server, distinguishing between real blockage and false blockage, the problem of misjudgment in the existing technology is solved, and the accuracy of blockage judgment and server performance are improved.

CN113515424BActive Publication Date: 2024-12-31GUANGDONG BANGSHENG BEIDOU TECH SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110449088.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-25
Publication Date
2024-12-31
Estimated Expiration
2041-04-25

AI Technical Summary

Technical Problem

The prior art is prone to misjudging the server queue as false blockage when judging that it is blocked, resulting in unnecessary current limit or capacity expansion, affecting server performance.

Method used

By counting the waiting time of the positioning information sent by the positioning device within a certain period of time, we can judge whether it is true or false blockage based on the proportion of the number of devices, set the preset time and timeout thresholds to distinguish the two situations, and when the queue is blocked, we can judge whether it is true or false blockage. Perform current limiting processing.

Benefits of technology

It improves the accuracy of queue blockage judgment, avoids unnecessary current limits and capacity expansion, and ensures timely processing and performance optimization of the server in the case of real blockage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113515424B_ABST
    Figure CN113515424B_ABST
Patent Text Reader

Abstract

The present invention discloses a queue congestion judgment method and storage medium when a server communicates with multiple positioning devices. The method is specifically as follows: if among the various positioning devices, a preset number of positioning devices have a phenomenon that the waiting time for positioning information to be processed exceeds a preset time, then the server queue is judged to be in a congested state. The queue congestion judgment method determines that the server queue is in a congested state only when a preset number of positioning devices among the various positioning devices have a phenomenon that the waiting time for positioning information to be processed exceeds a preset time. Then, when a false congestion occurs in the server due to the supplementary transmission of positioning information, the server queue will not be judged as congested. In this way, the accuracy of congestion judgment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of server congestion processing, and in particular to a queue congestion judgment method and storage medium when a server communicates with multiple positioning devices. Background Art

[0002] As Beidou vehicle-mounted positioning devices become increasingly popular, the number of Beidou vehicle-mounted positioning devices connected to the server has increased dramatically. In order to improve the performance of Beidou vehicle-mounted positioning devices, the positioning information request between the server and the Beidou vehicle-mounted positioning device adopts an asynchronous response communication method. Specifically: after the server receives the positioning information sent by the Beidou vehicle-mounted positioning device, it first responds to the Beidou vehicle-mounted positioning device, and then puts the positioning information of the Beidou vehicle-mounted positioning device into the queue for waiting, and then processes the multiple positioning information in the queue in sequence. When there are too many Beidou vehicle-mounted positioning devices connected to the server, the server is prone to queue congestion due to too many positioning information waiting in line. When the server queue is congested, it is necessary to automatically limit the flow of positioning information or notify the development and operation personnel to expand the server.

[0003] At present, the funnel algorithm is generally used to judge whether the server queue is blocked: configure the queue upper threshold, and it is judged as blocked when it exceeds the queue upper threshold, so as to limit the flow of positioning information. Since the Beidou vehicle-mounted positioning equipment will temporarily store the positioning information when there is no signal, and then retransmit all the temporarily stored positioning information to the server when the signal is good, if the number of retransmitted positioning information is large, the number of positioning information in the queue will suddenly increase to exceed the queue upper threshold. In this case, the funnel algorithm will be judged as blocked, but the server is not actually blocked in the true sense, and the blockage can be eliminated by itself in a short time, without the need for flow limiting or capacity expansion. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for judging the congestion of a server queue, which has high judgment accuracy.

[0005] After research, the inventor found that due to the supplementary transmission of positioning information by individual Beidou vehicle-mounted positioning devices, the number of positioning information in the queue may suddenly increase to exceed the upper limit threshold of the queue, and the funnel algorithm will be determined as congestion, thereby limiting the flow of positioning information or notifying the development and operation personnel to expand the server. However, in this case, the server is not actually blocked in the true sense, and the congestion can be eliminated by itself in a short time. It is a false congestion, and there is no need to limit the flow of positioning information or expand the capacity of the server. The Beidou vehicle-mounted positioning device will regularly generate positioning information containing the current location information of the machine and the current positioning time, and then send the positioning information to the server, so that the server can determine the driving trajectory of the vehicle based on the multiple positioning information reported by the Beidou vehicle-mounted positioning device. After receiving the positioning information, the server will put it into the queue to wait for processing. In the case of real congestion, the waiting time of the positioning information in the queue will be longer than the waiting time under normal circumstances. In this way, when the server processes the positioning information, the current time of the server is already much later than the positioning time of the positioning information. In the case of false congestion caused by poor communication signals, the positioning information will wait at the vehicle-mounted device until the signal is good before being sent to the server. In this way, when the server processes the positioning information, it will be much later than the positioning time. It can be seen that whether it is true congestion or false congestion, the current time when the server processes the positioning information will be much later than the positioning time. However, in a certain period of time, usually only a few Beidou vehicle-mounted positioning devices have poor communication signals. That is to say, in a certain period of time without true congestion, only a few Beidou vehicle-mounted positioning devices will send positioning information that will be processed by the server much later than the positioning time. This part of Beidou vehicle-mounted positioning devices accounts for a small proportion of the total number of Beidou vehicle-mounted positioning devices. In the case of true congestion, in a certain period of time, most of the positioning information sent by Beidou vehicle-mounted positioning devices need to wait in the queue for a long time before being processed by the server. In this way, most of the positioning information sent by Beidou vehicle-mounted positioning devices will be processed by the server much later than the positioning time. This part of Beidou vehicle-mounted positioning devices accounts for a large proportion of the total number of Beidou vehicle-mounted positioning devices. Therefore, the idea of ​​the present invention is to count the number of Beidou vehicle-mounted positioning devices that send out positioning information that is processed by the server much later than the positioning time within a certain time period, and then judge whether it is a false congestion or a real congestion based on the proportion of the number of these Beidou vehicle-mounted positioning devices in the total number of Beidou vehicle-mounted positioning devices.

[0006] In order to solve the above technical problems, the queue congestion judgment method of the present invention when the server communicates with multiple positioning devices determines that the server queue is in a congested state if the congestion conditions are met. The above congestion conditions include: among the various positioning devices, a preset number of positioning devices have positioning information waiting for processing exceeding a preset time.

[0007] Optionally, the above-mentioned congestion condition also includes that the number of positioning information in the queue exceeds the queue upper limit threshold. If a preset number of positioning devices have the above phenomenon and the number of positioning information in the queue exceeds the queue upper limit threshold, it is determined that the server queue is in a congested state.

[0008] Optionally, when taking positioning information out of the queue for processing, if it is determined that the generation time of the positioning information is earlier than the current time by more than a preset time, it is considered that the positioning device that sent the positioning information has been waiting for processing for more than a preset time.

[0009] Optionally, if it is determined that the server queue is in a blocked state and it is determined that the timeout number of the above positioning device exceeds a preset threshold, a flow limiting process is performed on the currently retrieved positioning information.

[0010] Optionally, as described above, the currently retrieved positioning information is subjected to flow limiting processing. Specifically, if the preset random condition is met, the currently retrieved positioning information is discarded and no processing is performed.

[0011] Optionally, the above-mentioned blocking condition is specifically: within a time interval of a preset length, among the various positioning devices, a preset number of positioning devices have the above phenomenon.

[0012] Optionally, it is determined at regular intervals whether the blocking condition is satisfied.

[0013] Optionally, if it is determined that the server queue is in a congested state, a congestion alarm message is issued.

[0014] Optionally, the preset number is reflected as a proportion of the total number of positioning devices.

[0015] A computer-readable storage medium stores an executable computer program, wherein the computer program is executed to implement the queue congestion judgment method when a server communicates with multiple positioning devices as described above.

[0016] The queue congestion judgment method determines that the server queue is in a congested state only when a preset number of positioning devices have positioning information waiting for processing for more than a preset time among various positioning devices. Therefore, when a false congestion occurs on the server due to the retransmission of positioning information, the server queue will not be judged as congested. In this way, the accuracy of congestion judgment is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a system block diagram of a vehicle positioning service system;

[0018] Figure 2 It is a schematic diagram of the process of the server processing positioning information;

[0019] Figure 3 This is a flowchart of how the server periodically determines whether it is blocked. DETAILED DESCRIPTION

[0020] The present invention is further described in detail below in conjunction with specific implementation methods.

[0021] like Figure 1 The vehicle positioning service system shown includes a server and a plurality of Beidou vehicle positioning devices that are communicatively connected to the server, and the Beidou vehicle positioning devices are respectively installed on different vehicles. The server includes a processor and a computer-readable storage medium, the computer-readable storage medium stores an executable computer program, and the processor executes the computer program to implement the functions of the server.

[0022] Each of the above-mentioned Beidou vehicle-mounted positioning devices will periodically generate positioning information containing the current location information of the machine and the current positioning time, and then send the positioning information to the server. After receiving the positioning information, the server will put it into the queue for processing. If too much positioning information is received and the server cannot process it, the queue will be blocked. In the event of congestion, the server needs to limit the flow or request the operation and maintenance personnel to expand the server to avoid the server crashing due to overload. Therefore, the server needs to make a congestion judgment.

[0023] The existing congestion judgment method is to set an upper threshold for the queue. Once the number of positioning information in the queue exceeds the upper threshold of the queue, it is judged as congestion. However, the inventor found that in actual scenarios, the vehicle may drive into some sections with poor communication signals during driving, making it impossible for the Beidou vehicle-mounted positioning device installed on the vehicle to send the positioning information to the server. During the period of poor communication signals, these Beidou vehicle-mounted positioning devices will temporarily store the positioning information generated during the period in the local machine and wait for the signal to recover before sending it to the server. Since the supplementary transmission of positioning information by individual Beidou vehicle-mounted positioning devices may cause the number of positioning information in the queue to suddenly increase to exceed the upper threshold of the queue, if the congestion judgment is made based solely on the congestion condition of the upper threshold of the queue, this situation will be judged as congestion. However, in this case, the server does not actually experience real congestion, and the congestion can be eliminated by itself in a short time. It is a false congestion, and there is no need to limit the flow of positioning information or expand the capacity of the server. After thinking, the inventors realized that, in a certain period of time, usually only a few Beidou vehicle-mounted positioning devices have poor communication signals, that is, in a certain period of time without real congestion, only a few Beidou vehicle-mounted positioning devices will send positioning information that will be processed by the server much later than the positioning time, which means that among all Beidou vehicle-mounted positioning devices, only a few Beidou vehicle-mounted positioning devices have positioning information that is waiting to be sent due to poor signals, resulting in a long waiting time for processing. In the case of real congestion, in a certain period of time, most of the positioning information sent by Beidou vehicle-mounted positioning devices need to wait in the queue for a long time before being processed by the server, so that most of the positioning information sent by Beidou vehicle-mounted positioning devices will be processed by the server much later than the positioning time, which means that among all Beidou vehicle-mounted positioning devices, most of the positioning information of Beidou vehicle-mounted positioning devices need to wait in the queue for processing, resulting in a long waiting time for processing. Therefore, the idea of ​​the present invention is to count the number of Beidou vehicle-mounted positioning devices that have a long waiting time for positioning information processing within a certain period of time, so as to distinguish whether it is a real congestion or a false congestion based on the proportion of the number of these Beidou vehicle-mounted positioning devices to the total number of Beidou vehicle-mounted positioning devices.

[0024] Based on the above ideas, it is necessary to count the number of Beidou vehicle-mounted positioning devices that have a long waiting time for positioning information processing. The specific statistical method is as follows:

[0025] like Figure 2As shown, after the server takes out the positioning information that is in the queue first, it extracts the positioning time of the positioning information and determines whether its positioning time is earlier than the current time by more than 30 minutes. If the positioning time is earlier than the current time by more than 30 minutes, it is considered that the Beidou vehicle-mounted positioning device that sends the positioning information has a phenomenon that the positioning information is waiting for processing for more than the preset time. A redis database is provided in the server. After determining that the Beidou vehicle-mounted positioning device has a phenomenon that the positioning information is waiting for processing for more than the preset time, the server queries the redis database for a key-value pair with the device number of the Beidou vehicle-mounted positioning device that sends the above positioning information as the key. If it does not exist, the server creates a corresponding key-value pair in the redis database, and the key-value pair uses the device number of the Beidou vehicle-mounted positioning device as the key, and the number of timeout events such as the positioning information of the Beidou vehicle-mounted positioning device waiting for processing for more than 30 minutes as the value. Although the positioning devices with poor signals are usually a minority, if the time length is long enough, each positioning device may have poor signals in an interlaced manner, and the statistics may exceed the preset number, but this situation is still just a false congestion. In the case of real congestion, most of the positioning devices will have the above phenomenon in a short period of time. Therefore, this embodiment adds a time length restriction condition to further ensure that false congestion will not be judged as true congestion. This embodiment adds a time length restriction condition by setting an expiration time of 30 minutes for the above key-value pair. If the key value of the key-value pair has not been updated for more than 30 minutes, the server deletes the key-value pair. In this way, the redis database will only save the key-value pairs updated within 30 minutes from the current time. When counting the number of key-value pairs, the key-value pairs updated within 30 minutes are counted, thereby avoiding the statistics of positioning devices that have experienced the above phenomenon a long time ago. If there is a key-value pair in the redis database with the device number of the Beidou vehicle-mounted positioning device that sends the above positioning information as the key, the key value of the key-value pair is increased by 1. The number of Beidou vehicle-mounted positioning devices that have the phenomenon of waiting for positioning information to be processed for more than a preset time is counted by means of key-value pairs.

[0026] After counting the number of Beidou vehicle-mounted positioning devices with the above phenomenon, the server can make corresponding congestion judgments. In this embodiment, the congestion judgment process is timed triggering, while in other embodiments, it can be changed to trigger the congestion judgment process when processing positioning information if the positioning time of the positioning information is earlier than the current time of the server by more than 30 minutes of the preset duration. The reason why the congestion judgment process is set to be timed triggering instead of triggering when processing positioning information in this embodiment is that the key-value pair quantity scanning is a relatively time-consuming operation. Although the congestion judgment process can be triggered more timely when processing positioning information, in the case of a large number of congestion or positioning information retransmissions, the probability that the positioning time of the positioning information processed by the server is earlier than the current time by more than 30 minutes of the preset duration will increase, so the key-value pair quantity scanning will be frequently performed, which will greatly increase the load on the server and affect the service processing of the server. The congestion judgment process is set to be timed triggering. In the worst case, the queue congestion is detected only after the set interval time is later than when the congestion occurs. As long as the time interval is not long, it will not have a great impact on the service processing of the server.

[0027] like Figure 3 As shown, the congestion judgment process is triggered every 3 minutes. Specifically: the server first determines whether the number of key-value pairs in the redis database accounts for more than 10% of the total number of Beidou vehicle-mounted positioning devices. If so, it means that the congestion condition "among each Beidou vehicle-mounted positioning device, a preset number of positioning devices have positioning information waiting for processing for more than a preset time" is met. The server then determines whether the number of positioning information in the queue exceeds the queue upper limit threshold, which is set according to the processing capacity of the server. If so, it is determined that the server queue is currently in a congested state, so the global congestion flag is set to true, and a congestion alarm message is sent to the operation and maintenance personnel.

[0028] When the server queue is in a blocked state, flow limiting can be performed to reduce the processing pressure of the server, so that the queue can return to normal as soon as possible. In this embodiment, the server executes the flow limiting process before processing the positioning information, and determines whether to process the current positioning information normally according to the execution result of the flow limiting process. The flow limiting process is as follows: Figure 2As shown, after the Beidou vehicle-mounted positioning devices with the phenomenon of waiting for processing of positioning information exceeding the preset time length are counted, the server determines whether the global blocking flag is true, and if so, further determines whether the key value of the key-value pair (the key value is equal to the timeout number of the Beidou vehicle-mounted positioning device corresponding to the key-value pair) exceeds the preset number threshold of 1000. When the key value of the key-value pair exceeds 1000, it means that the number of positioning information of this Beidou vehicle-mounted positioning device is large. In order to allow the queue to return to normal as soon as possible, for this Beidou vehicle-mounted positioning device with too much positioning information, the server randomly abandons its positioning information, so that the workload of the server will be reduced accordingly, so that the processing efficiency of the positioning information in the queue is correspondingly improved, so that the queue can return to normal as soon as possible. The random abandonment process is specifically: if the key value exceeds the preset number threshold of 1000, the server randomly generates a random number from 0 to 99, and if the random number is less than 49, it means that it meets the preset random conditions, abandons the positioning information, and does not process it, otherwise the positioning information is processed normally.

[0029] The above is only an implementation method of the invention, and does not limit the scope of patent protection. Those skilled in the art can make non-substantial changes or substitutions based on the invention, which still fall within the scope of patent protection.

Claims

1. A queue congestion judgment method when a server communicates with multiple positioning devices. If the congestion condition is met, the server queue is judged to be in a congested state. Its characteristics are: The above-mentioned congestion conditions include: among each positioning device, a preset number of positioning devices have a phenomenon that the positioning information waiting for processing exceeds a preset time; the above-mentioned congestion conditions are specifically: within a preset time interval, among each positioning device, a preset number of positioning devices have the above phenomenon; the above-mentioned congestion conditions also include that the number of positioning information in the queue exceeds the queue upper limit threshold. If a preset number of positioning devices have the above phenomenon and the number of positioning information in the queue exceeds the queue upper limit threshold, it is determined that the server queue is in a congested state.

2. The queue congestion determination method when a server communicates with a plurality of positioning devices according to claim 1, characterized in that: When taking out positioning information from the queue for processing, if it is determined that the generation time of the positioning information is earlier than the current time by more than a preset time, it is considered that the positioning device that sent the positioning information has a positioning information waiting for processing for more than a preset time.

3. The queue congestion determination method when a server communicates with a plurality of positioning devices as claimed in claim 2, characterized in that: If it is determined that the server queue is in a blocked state and it is determined that the timeout times of the above positioning device exceed the preset threshold, the current fetched positioning information is subjected to flow limiting processing.

4. The queue congestion judgment method when a server communicates with multiple positioning devices as described in claim 3 is characterized in that, as described above, the currently retrieved positioning information is subjected to flow limiting processing. Specifically, if it meets the preset random conditions, the currently retrieved positioning information is discarded and no processing is performed.

5. The queue congestion determination method when a server communicates with a plurality of positioning devices according to claim 1, characterized in that: It is determined at regular intervals whether the blocking condition is satisfied.

6. The queue congestion determination method when a server communicates with a plurality of positioning devices according to claim 1, characterized in that: If it is determined that the server queue is in a congested state, a congestion alarm message is issued.

7. The queue congestion determination method when a server communicates with a plurality of positioning devices according to claim 1, characterized in that: The preset number is reflected as a proportion of the total number of positioning devices.

8. A computer-readable storage medium having an executable computer program stored thereon, characterized in that: The computer program is executed to implement the queue congestion determination method according to any one of claims 1 to 7 when the server communicates with a plurality of positioning devices.