Efficient management method and device for congestion degree data, medium and product
By using segment trees and max-heap data structures, the problem of slow query response for large-scale and dynamic data in traffic monitoring systems is solved, enabling fast data updates and accurate query results, thus improving the efficiency of the traffic management system.
Patent Information
- Application Number
- CN202511736294.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-02-13
AI Technical Summary
Existing traffic monitoring systems suffer from long query response times and slow data processing speeds when handling large-scale or dynamic data, making them ineffective for interval queries and dynamic data updates.
Using segment tree and max-heap data structures, a max-heap is built by initializing the congestion level data of leaf nodes and intermediate nodes, which conforms to the data increment rule. In response to query requests, the query results are fed back using segment tree and max-heap.
It enables real-time data updates and rapid responses, improves the efficiency of data query processing, supports efficient interval queries and dynamic data updates, and enhances the real-time performance and accuracy of the traffic management system.
Smart Images

Figure CN121524451A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to an efficient management method, device, medium and product of congestion degree data. BACKGROUND
[0002] In recent years, with the rapid development of Internet technology, the real-time query demand of traffic monitoring data is becoming higher and higher. In modern traffic management systems, data processing and congestion monitoring usually rely on various algorithms and data structures to analyze and respond to real-time traffic conditions. Commonly used techniques include database queries, simple data aggregation methods, and basic priority queues or heap structures to identify key monitoring areas. The principle is to query the data of a specific road section through a database system, and use basic arithmetic operations for data aggregation. These methods perform well when dealing with small-scale or non-dynamic data. However, when the data size increases or the data update frequency increases, the response time of these methods will significantly increase, resulting in insufficient data processing speed to support real-time decision-making. In addition, they usually cannot effectively handle large-scale interval queries and dynamic data updates. SUMMARY
[0003] One object of the present application is to provide an efficient management method, device, medium and product of congestion degree data, at least to solve the problems of long query response time, slow data processing speed, and inability to effectively perform interval queries and dynamic data updates. In the present application, the congestion degree data of at least two monitoring target road sections is obtained; a line segment tree is established and initialized, so that the congestion degree data of each monitoring target road section is filled into each leaf node of the line segment tree; according to the congestion degree data recorded in each leaf node and the data superposition rule of the line segment tree, the congestion degree superposition data of the intermediate nodes and the root node is determined; a maximum heap is established and initialized, so that the congestion degree data of each monitoring target road section is filled into each node of the maximum heap; the position of each node in the maximum heap is adjusted to obtain a maximum heap that meets the data increasing rule; in response to a query request for congestion degree data, the query result is fed back according to the line segment tree and / or the maximum heap. By using the present solution, real-time data updating can be realized, and after receiving a query request, a fast response can be obtained and the query result can be accurately returned, improving the processing efficiency of data query.
[0004] To achieve the above object, some embodiments of the present application provide the following aspects:
[0005] In a first aspect, some embodiments of the present application further provide an efficient management method of congestion degree data, comprising:
[0006] obtaining congestion degree data of at least two monitoring target road sections;
[0007] establishing a line segment tree and initializing the line segment tree, so that the congestion degree data of each monitoring target road segment is filled in each leaf node of the line segment tree;
[0008] determining the congestion degree superposition data of the intermediate nodes and the root node according to the congestion degree data recorded in each leaf node and the data superposition rule of the line segment tree;
[0009] establishing a maximum heap and initializing the maximum heap, so that the congestion degree data of each monitoring target road segment is filled in each node of the maximum heap;
[0010] adjusting the position of each node in the maximum heap to obtain a maximum heap conforming to the data increasing rule;
[0011] in response to a query request for the congestion degree data, feeding back a query result according to the line segment tree and / or the maximum heap.
[0012] In a second aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions which, when executed, cause the processor to perform the steps of the method described above.
[0013] In a third aspect, some embodiments of the present application further provide a computer readable medium having stored thereon computer program instructions, which can be executed by a processor to implement the method described above.
[0014] In a fourth aspect, some embodiments of the present application further provide a computer program product comprising computer program / instructions which, when executed by a processor, implement the steps of the method described above.
[0015] Compared with the related art, in the scheme provided by the embodiments of the application, the congestion degree data of at least two monitoring target road segments is acquired; a line segment tree is established and initialized, so that the congestion degree data of each monitoring target road segment is filled in each leaf node of the line segment tree; according to the congestion degree data recorded in each leaf node and a data superposition rule of the line segment tree, congestion degree superposition data of intermediate nodes and a root node is determined; a maximum heap is established and initialized, so that the congestion degree data of each monitoring target road segment is filled in each node of the maximum heap; the position of each node in the maximum heap is adjusted to obtain a maximum heap conforming to a data increasing rule; in response to a query request for the congestion degree data, a query result is fed back according to the line segment tree and / or the maximum heap. By using the scheme, real-time updating of data can be realized, and after receiving a query request, a quick response can be obtained and an accurate query result can be returned, thereby improving the processing efficiency of data query. BRIEF DESCRIPTION OF DRAWINGS
[0016] One or more embodiments are illustrated by way of example in the figures that are part of this document, and which illustrate by way of example the principles of the embodiments. The embodiments are not limited to the examples of drawings. In the drawings, elements having the same reference numerals designate like elements throughout the several views. The figures in the drawings are not necessarily to scale, except if so expressly indicated.
[0017] Figure 1 An exemplary flowchart of a congestion degree data efficient management method according to some embodiments of the application;
[0018] Figure 2 A schematic diagram of a line segment tree according to some embodiments of the application;
[0019] Figure 3 A schematic diagram of a maximum heap according to some embodiments of the application;
[0020] Figure 4 A schematic diagram of a line segment tree update result according to some embodiments of the application;
[0021] Figure 5 A schematic diagram of a maximum heap update result according to some embodiments of the application;
[0022] Figure 6 An exemplary structural diagram of the electronic device is disclosed. DETAILED DESCRIPTION
[0023] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0024] First embodiment
[0025] The first embodiment of the present application relates to an efficient management method of congestion degree data. As shown in the figure, the method can include the following steps: Figure 1
[0026] Step S101, obtaining congestion degree data of at least two monitoring target road segments;
[0027] The monitoring target road segment can be multiple road segments of one road or multiple road segments of multiple roads, for example, all road segments in a region. The congestion degree data,
[0028] The congestion degree data can be relevant quantitative information for measuring the traffic congestion condition on the road, for example, time dimension-based data, which can include a travel time index (TTI), which refers to the ratio of the actual travel time through a road segment in a certain period to the free flow (i.e. the traffic is smooth and unobstructed) travel time. For example, it takes 10 minutes to drive through a road segment in free flow state, but it actually takes 30 minutes to pass through in the morning peak, so the travel time index of this period is 30 ÷ 10 = 3. The larger the value, the more serious the congestion. Generally, TTI between 1.2-1.5 indicates light congestion, 1.5-2 indicates moderate congestion, and above 2 indicates severe congestion. Use: intuitively reflects the additional time spent by vehicles due to congestion on the road, which is convenient for evaluating the impact of traffic at different times on travel efficiency, and is often used by traffic management departments for planning improvement measures and navigation software for users to estimate travel time. Delay time refers to the difference between the actual travel time of a vehicle on a road and the time it should take in an ideal state (without congestion and other interference). For example, a road normally takes 5 minutes to travel, but actually takes 10 minutes due to congestion and other reasons, so the delay time is 10-5 = 5 minutes. It can be counted per vehicle or aggregated to count the total delay time of all vehicles on a road segment within a certain time. From the perspective of time loss, it measures the impact of congestion on traffic participants, which is helpful for analyzing traffic bottlenecks and calculating the economic cost (such as increased transportation cost and time value loss) caused by congestion.
[0029] Based on the dimension of traffic flow data, such as vehicle flow (traffic flow), refers to the number of vehicles passing through a certain section of a road in a unit of time (usually in hours, days, etc.). For example, a certain intersection passed 1000 vehicles in an hour during the morning peak, and this 1000 vehicles is the vehicle flow of the intersection in that period. When the vehicle flow exceeds the design capacity of the road, congestion is often easy to occur. Saturation (V / C ratio), that is, the ratio of traffic flow to road capacity, which refers to the maximum number of vehicles that can pass through a certain section of a road in a unit of time under certain road and traffic conditions. For example, a certain road can pass 800 vehicles per hour (capacity), and actually 600 vehicles per hour, its saturation is 600÷800=0.75. Generally, when the saturation exceeds 0.8-0.9, the road will begin to appear congestion.
[0030] Based on the dimension of speed data, such as average speed, the average speed of vehicles passing through a certain section of road in a certain period of time. For example, for a 1-kilometer road, the speeds of 50 vehicles passing through in 10 minutes are counted, and then the average speed is calculated. If the average speed is very low, such as less than 20 kilometers per hour (different road types have different reference standards), it usually means that there is congestion on the road section. It is simple and intuitive to reflect the smoothness of road traffic, and is often used for real-time traffic broadcast and traffic state monitoring and analysis, helping drivers to understand the road conditions in advance and choose the right route, and facilitating the traffic department to grasp the overall efficiency of regional traffic. The standard deviation of vehicle speed reflects the dispersion of vehicle speed on a certain road section. If the standard deviation of vehicle speed is small, it means that the vehicle speed is close and the traffic flow is stable; if the standard deviation is large, it means that the vehicle speed is different, and there may be frequent acceleration and deceleration, and the traffic order is disorderly. It helps to judge the stability and orderliness of traffic flow, and helps the traffic management department to take targeted measures to maintain good traffic order, such as strengthening the control of lane changing and other behaviors.
[0031] Based on the dimension of queue length data, such as vehicle queue length, the length of the queue formed by vehicles stopped due to traffic congestion, signal control, etc. on the road, generally in meters, which can be counted by electronic monitoring devices on the road (such as video monitoring, geomagnetic sensor, etc.). For example, when waiting for the signal light at the intersection, the vehicle queue extends 200 meters from the stop line, and the 200 meters is the queue length at that time. It is important for analyzing the congestion degree of key nodes such as intersections and ramps and the rationality of traffic signal timing, and the traffic management department can adjust the signal light duration and other control strategies in time to alleviate local congestion.
[0032] Step S102, establish a line segment tree and initialize it, so that the congestion degree data of each monitoring target road segment is filled into each leaf node of the line segment tree;
[0033] The line segment tree can provide fast interval query function, making it possible to calculate the congestion sum in any specified interval, and support efficient data update. This is crucial for dynamic traffic data processing. The line segment tree can handle interval queries and updates in logarithmic time, greatly improving the ability to process large-scale data.
[0034] Each node of the line segment tree represents the congestion sum of an interval, which can quickly calculate the total congestion degree of any sub-interval. When the congestion degree of a road segment changes, the relevant node will be updated, and the affected parent nodes will also be updated accordingly.
[0035] Line segment tree initialization, the construction of line segment tree aims to provide fast interval query and update capability to cope with dynamic changes of traffic data. The following steps detail how to initialize the line segment tree:
[0036] Leaf node initialization, each leaf node represents a specific road segment and is directly initialized to the current congestion degree of that road segment.
[0037] Example data, there are five road segments, and the initial congestion degrees are 10, 20, 30, 40, and 50 respectively.
[0038] In the line segment tree, this relationship can be represented by the following mathematical formula:
[0039]
[0040] Where i ranges from 1 to 5, representing the five different road segments. Here, V represents the node array of the line segment tree, and n+i is the position of the leaf node in the array.
[0041] Step S103, according to the congestion degree data recorded in each leaf node and the data superposition rule of the line segment tree, determine the congestion degree superposition data of the intermediate nodes and the root node;
[0042] Figure 2 The schematic diagram of the line segment tree provided by some embodiments of the present application is shown in Figure 1. Figure 2 As shown in the figure, in the line segment tree, the value of the parent node is composed of the sum of the congestion degrees of its child nodes, and this process is recursively performed from the leaf node to the root node.
[0043] Calculation formula: for non-leaf node i, its value is calculated by
[0044]
[0045] Determine, where V[i] represents the sum of the congestion levels of all road segments covered by node i.
[0046] For example, the first non-leaf node may cover the first and second segments, so its value is 10 + 20 = 30.
[0047] Step S104: Establish a maximum heap and initialize the maximum heap so that the congestion level data of each monitored target road segment is filled into each node of the maximum heap;
[0048] The max-heap is used to track the most severe congestion in real time. The following are the detailed initialization steps and calculation methods:
[0049] Add heap elements, with the congestion level of each road segment added as an element to the max heap.
[0050] Elements are sorted by congestion level to ensure that the top element of the heap is always the most congested road segment.
[0051] Example: Add congestion levels 10, 20, 30, 40, and 50 to the heap.
[0052] Step S105: Adjust the position of each node in the max-heap to obtain a max-heap that conforms to the data increment rule;
[0053] Figure 3 This is a schematic diagram of a max-heap provided according to some embodiments of this application; such as Figure 3 As shown, a max-heap is constructed by adjusting the positions of elements in the heap to ensure that the value of a parent node is always greater than or equal to the value of its child nodes.
[0054] First, add all elements to the heap;
[0055] Adjust upwards starting from the last non-leaf node to satisfy the max-heap property;
[0056] Adjustment formula: If the value of a node is less than that of its child nodes, swap it with the largest child node, until all nodes satisfy the condition of a max-heap.
[0057] Step S106: In response to the query request for congestion level data, the query result is fed back based on the segment tree and / or the max heap.
[0058] In this solution, after receiving a query request for congestion level data, the solution can determine whether to query the relevant content from the segment tree or the max-heap based on the specific content of the query request, and then return the query result.
[0059] In a preferred embodiment, the method further includes:
[0060] If a change in the congestion level data of any monitored target road segment is detected, the segment tree is updated according to the changed congestion level data, and all intermediate nodes and / or root nodes of the leaf node where the changed monitored target road segment is located are updated.
[0061] Figure 4 This is a schematic diagram of the segment tree update result provided according to some embodiments of this application; such as Figure 4 As shown, segment tree updates are crucial because they ensure that all relevant interval data reflects the latest road conditions.
[0062] Assumption Update:
[0063] Assume the congestion level of the third road segment increases from 30 to 60.
[0064] Operating steps:
[0065] Leaf node update: First, locate the leaf node corresponding to the third road segment and update its value from 30 to 60.
[0066] Recursive update of parent nodes: Next, all affected parent nodes need to be updated to ensure that the aggregate value of the entire segment tree is up-to-date.
[0067] Calculation formulas and examples:
[0068] Let the leaf node index of the third path be i, then the update operation is as follows:
[0069] V[i]=60
[0070] Update its parent node. Assuming the parent node's index is i / 2, the new value of the parent node is:
[0071]
[0072] If the original value of the parent node is 70 (i.e., 30+40), it will become 60+40=100 after the update.
[0073] This update will recursively return to the root node, ensuring that the values of all relevant nodes reflect the latest data.
[0074] In a preferred embodiment, the method further includes:
[0075] When a change in the congestion level data of any monitored target road segment is detected, the maximum stack is updated based on the changed congestion level data, and the positions of each node in the maximum stack are adjusted based on the changed congestion level data to obtain the updated maximum stack.
[0076] Figure 5This is a schematic diagram illustrating the maximum heap update results provided according to some embodiments of this application; such as Figure 5 As shown, max-heap update is used to track the most severe congestion situation. The update operation needs to ensure that the heap structure still maintains the correct max-heap properties after the data changes.
[0077] Operating steps:
[0078] Locate and update: First, find the current congestion level (30) of the third road segment in the max heap, and update it to the new congestion level (60).
[0079] Heap adjustment: Because updated values may affect the structure of the heap, heap adjustment operations need to be performed.
[0080] Adjustment method:
[0081] Float up operation: If the updated value (60) is greater than the value of its parent node, then a float up operation is performed to maintain the max-heap property.
[0082] Sinking operation: If an update causes a node's value to be less than its child nodes, a sinking operation should be performed. This does not apply in the current example because the value is increasing.
[0083] Formulas and calculations:
[0084] Each node in the heap satisfies:
[0085]
[0086] After the update operation, if V[i] is greater than Then execute the following operation:
[0087] Repeat this operation until the heap properties are restored.
[0088] The solution provided in this application involves: acquiring congestion level data for at least two monitored target road segments; establishing a segment tree and initializing it so that the congestion level data for each monitored target road segment is filled into each leaf node of the segment tree; determining the congestion level superposition data for intermediate nodes and the root node based on the congestion level data recorded in each leaf node and the data superposition rules of the segment tree; establishing a max-heap and initializing it so that the congestion level data for each monitored target road segment is filled into each node of the max-heap; adjusting the positions of each node in the max-heap to obtain a max-heap that conforms to the data increment rule; and responding to a query request for congestion level data by providing query results based on the segment tree and / or the max-heap. By adopting this solution, real-time data updates can be achieved, and a rapid response and accurate return of query results can be obtained after receiving a query request, improving the processing efficiency of data queries.
[0089] In a preferred embodiment, in response to a query request for congestion level data, the query result is returned based on the segment tree and / or the max-heap, including:
[0090] When the query request is the sum of congestion level data from the i-th target road segment to the u-th target road segment, locate the root node covering all query target road segments;
[0091] Based on the overlap between the root node and the target road segment, a query rule is determined, and the query result is fed back based on the data retrieved from the segment tree.
[0092] Segment tree queries allow for the rapid summarization and querying of congestion levels within any given interval, making them ideal for dynamically assessing congestion across multiple road segments. It quickly calculates the sum of congestion levels for all road segments within a specified interval.
[0093] In a preferred embodiment, a query rule is determined based on the overlap between the root node and the target road segment, and the query result is fed back based on the data retrieved from the segment tree, including:
[0094] If the root node completely overlaps with the target road segment being queried, the query rule is determined to be a direct read rule;
[0095] The congestion level data recorded in the root node is directly read as the query result.
[0096] Query example: Query the total congestion level from the second to the fourth segment.
[0097] Execution steps and calculation formulas:
[0098] First, locate the relevant nodes:
[0099] Starting from the root node, recursively query all nodes covering the target range.
[0100] If the node's range completely overlaps with the query range, then the node value is used directly.
[0101] In a preferred embodiment, a query rule is determined based on the overlap between the root node and the target road segment, and the query result is fed back based on the data retrieved from the segment tree, including:
[0102] If the root node covers other road segments besides the target road segment, the query rule is determined to be a recursive reading rule;
[0103] Recursively read the data recorded in the leaf nodes and / or intermediate nodes where the target road segment is located, and sum them to obtain the query result.
[0104] If the node intervals partially overlap, recursively query the child nodes of that node.
[0105] The interval aggregation and merging operation is given by the following formula, where V[i] is the value of node i:
[0106]
[0107] Calculation example:
[0108] Suppose that the data in the second (20), third (60), and fourth (40) segments need to be merged.
[0109] The calculation formula is:
[0110] 20 + 60 + 40 = 120
[0111] This result represents the overall congestion level from the second to the fourth segment.
[0112] It should be noted that the time complexity of its query is O(n log n). , where n is the number of elements (segments). This is because a segment tree is a balanced binary tree, and each query only involves the path from the root to the leaf.
[0113] In a preferred embodiment, in response to a query request for congestion level data, the query result is returned based on the segment tree and / or the max-heap, including:
[0114] When the query request is for the most congested monitoring target road segment, the data recorded in the root node of the maximum heap is used as the feedback query result; wherein, the root node of the maximum heap records the number of the most congested monitoring target road segment and the congestion level data corresponding to the monitoring target road segment.
[0115] Max heaps are used to quickly identify the most congested road sections, making them ideal for scenarios requiring immediate response. They can quickly determine the maximum congestion value, thus identifying the most congested road section.
[0116] Operating steps:
[0117] Access the top element of the heap. The top element is the largest among all elements, so it can be read directly.
[0118] Example: If the top of the max-heap is 60, it means that the most severe congestion is currently occurring on the corresponding road segment.
[0119] The time complexity of a lookup operation (accessing the top element) in a max-heap is O(1). This is because the top element is always directly available without any additional computation.
[0120] The technical solution provided in this embodiment has the following effects:
[0121] Fast range query capability:
[0122] Segment trees enable the system to quickly calculate the sum of congestion levels within any specified road segment interval. This is crucial for assessing traffic conditions on specific road segments and for rapid response, especially during peak hours or in the event of an accident. This structure supports queries with O(log n) time complexity, significantly improving the processing speed for large amounts of data and making it more efficient than traditional methods.
[0123] Real-time monitoring and response to the most severe congestion: Utilizing a max-heap for rapid retrieval of the most congested road segment. The top element of the heap represents the most congested segment, enabling instant access with O(1) time complexity. This allows traffic management centers to make rapid scheduling decisions, such as reallocating traffic flow, adjusting traffic light timings, or dispatching emergency response teams to alleviate or prevent wider traffic congestion.
[0124] Dynamic Data Updates: The combination of segment trees and max heaps also supports efficient data update operations. When the congestion level of a road segment changes, the segment tree can be updated in O(log n) time, and the corresponding max heap adjustments can also be completed quickly, ensuring that all data is up-to-date. This dynamic update capability is particularly important for real-time traffic monitoring systems because it guarantees the real-time nature and accuracy of the data, ensuring that data queries at any given time reflect the latest traffic conditions.
[0125] Improving the efficiency of decision support systems: This efficient data structure design not only increases the speed of data querying and updating but also optimizes resource allocation and the effectiveness of traffic control measures, thereby enhancing the operational efficiency and effectiveness of the entire traffic management system. The system can make rapid decisions based on the most accurate and timely data, reducing the economic losses and environmental impacts caused by traffic congestion, and improving the overall sustainability of the urban transportation system and the quality of life for residents.
[0126] The core of this proposal lies in combining two efficient data structures, segment trees and max-heaps, to optimize data processing in traffic management systems. Segment trees enable fast interval queries and updates, while max-heaps quickly identify the most congested sections. Utilizing the segment tree structure, traffic data for any interval can be queried and aggregated rapidly, significantly reducing data processing time. Simultaneously, the use of max-heaps allows the system to respond instantly to the most urgent traffic congestion situations. The data structures in this proposal support efficient data update mechanisms, quickly reflecting changes in road conditions. This is crucial for modern transportation systems that require real-time updates and processing of large amounts of data. Through this data structure optimization, the performance of the entire traffic monitoring system is significantly improved, especially in terms of data processing speed and accuracy.
[0127] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0128] The electronic device includes: one or more processors; and a memory storing computer program instructions that, when executed, cause the processor to perform the steps of the methods provided in any one or more of the above embodiments. Figure 6 An exemplary structural diagram of the electronic device is disclosed. For example... Figure 6As shown, the electronic device includes one or more processors 601, a memory 602, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0129] The electronic device may further include an input device 603 and an output device 604. The processor 601, memory 602, input device 603, and output device 604 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0130] Input device 603 can receive input numerical or character information and generate signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 604 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0131] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0132] In this embodiment, a computer-readable medium stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in any one or more of the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into that device. The aforementioned computer-readable medium carries one or more computer-readable instructions.
[0133] The memory 602 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 601 executes various server functions and data processing by running the non-transitory software programs, instructions, and modules stored in the memory 602, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.
[0134] The memory 602 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 602 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 602 may optionally include memory remotely located relative to the processor 601, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0135] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0136] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0137] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0138] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, or similar devices. Furthermore, some steps or functions of this application can be implemented in hardware, for example, as circuitry that works with a processor to perform the various steps or functions.
[0139] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0140] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0141] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device in software or hardware. Terms such as "first," "second," etc., are used only for distinguishing descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.
[0142] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily made by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims, and the above embodiments should be regarded as exemplary and non-limiting.
Claims
1. An efficient management method for congestion level data, characterized in that, The method includes: Obtain congestion level data for at least two target road segments; Establish a segment tree and initialize the segment tree so that the congestion level data of each monitored target road segment is filled into each leaf node of the segment tree; Based on the congestion level data recorded in each leaf node and the data overlay rules of the segment tree, determine the congestion level overlay data of the intermediate nodes and the root node. A maximum heap is established and initialized so that the congestion level data of each monitored target road segment is filled into each node of the maximum heap; The positions of each node in the max-heap are adjusted to obtain a max-heap that conforms to the data increment rule; In response to a query request for congestion level data, the query result is returned based on the segment tree and / or the max-heap.
2. The method according to claim 1, characterized in that, The method further includes: If a change in the congestion level data of any monitored target road segment is detected, the segment tree is updated according to the changed congestion level data, and all intermediate nodes and / or root nodes of the leaf node where the changed monitored target road segment is located are updated.
3. The method according to claim 1, characterized in that, The method further includes: When a change in the congestion level data of any monitored target road segment is detected, the maximum stack is updated based on the changed congestion level data, and the positions of each node in the maximum stack are adjusted based on the changed congestion level data to obtain the updated maximum stack.
4. The method according to claim 1, characterized in that, In response to a query request for congestion level data, the query results are returned based on the segment tree and / or the max-heap, including: When the query request is the sum of congestion level data from the i-th target road segment to the u-th target road segment, locate the root node covering all query target road segments; Based on the overlap between the root node and the target road segment, a query rule is determined, and the query result is fed back based on the data retrieved from the segment tree.
5. The method according to claim 4, characterized in that, Based on the overlap between the root node and the target road segment, a query rule is determined, and the query results are fed back based on the data retrieved from the segment tree, including: If the root node completely overlaps with the target road segment being queried, the query rule is determined to be a direct read rule; The congestion level data recorded in the root node is directly read as the query result.
6. The method according to claim 4, characterized in that, Based on the overlap between the root node and the target road segment, a query rule is determined, and the query results are fed back based on the data retrieved from the segment tree, including: If the root node covers other road segments besides the target road segment, the query rule is determined to be a recursive reading rule; Recursively read the data recorded in the leaf nodes and / or intermediate nodes where the target road segment is located, and sum them to obtain the query result.
7. The method according to claim 1, characterized in that, In response to a query request for congestion level data, the query results are returned based on the segment tree and / or the max-heap, including: When the query request is for the most congested monitoring target road segment, the data recorded in the root node of the maximum heap is used as the feedback query result; wherein, the root node of the maximum heap records the number of the most congested monitoring target road segment and the congestion level data corresponding to the monitoring target road segment.
8. An electronic device, characterized in that, The electronic device includes: One or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as described in any one of claims 1 to 7.
9. A computer-readable medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.