Real-time detection method, device and equipment for macroscopic traffic flow and storage medium
By using linear segment detection and Monte Carlo method to process the spatiotemporal vibration response data in the macroscopic traffic flow detection method, the problem of the same vehicle being misjudged as two vehicles is solved, and the accuracy and reliability of the detection results are improved.
Patent Information
- Application Number
- CN202411916601.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
AI Technical Summary
The macroscopic traffic flow detection method based on spatiotemporal vibration response data in the prior art can easily identify the same vehicle as two vehicles, resulting in inaccurate detection results.
The linear segment detection method is used to extract the spatial and temporal vibration response data in a linear manner, and the initial linear segment is randomly sampled and merged with the Monte Carlo method. The position difference judgment is used to ensure that the same vehicle only corresponds to one trajectory.
The accuracy of macro traffic flow detection results is improved, and the same vehicle is avoided being misjudged as two vehicles, which enhances the reliability and universality of the detection results.
Smart Images

Figure CN119785584A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic flow detection, and in particular to a real-time detection method, device, equipment and storage medium for macroscopic traffic flow. Background Art
[0002] In the field of transportation, the running trajectory of vehicles can basically provide all the dynamic information needed for transportation. Real-time traffic flow monitoring, as an important part of intelligent traffic management, plays an important role in alleviating traffic congestion, optimizing traffic planning, and improving road use efficiency. At present, there are three main ways to identify and extract vehicle trajectories. One is to achieve it through traffic monitoring video or radar. Monitoring video involves the field of computer vision, and radar involves the field of point cloud processing. However, both monitoring video and radar have very limited detection distances, the cost of full coverage is too high, and the later processing is also relatively complicated, making it more difficult to achieve real-time and accurate vehicle detection and tracking. The other is a coil detector, which detects the presence of a vehicle by sensing the electromagnetic changes of a passing vehicle through a coil buried underground. The coil detector can provide real-time information such as vehicle flow, vehicle speed, and lane occupancy. However, due to the high cost of construction and maintenance, and certain destructiveness to the road surface, its application is subject to certain restrictions. The third is the global positioning system (GPS), which can provide accurate time and space location information. By analyzing the vehicle-mounted GPS data, parameters such as the vehicle's driving speed, route, and dwell time can be understood, and then traffic flow and congestion can be evaluated. GPS technology needs to be installed on the vehicle in advance or used with a mobile device.
[0003] In order to solve the shortcomings of the above-mentioned methods, the existing technology proposes to realize real-time detection of traffic flow based on optical fiber array sensing technology. A single channel of grating array sensing technology can integrate tens of thousands of sensor gratings, which is suitable for real-time monitoring of macro traffic flow. It is laid on the bottom layer of the road surface and is not affected by extreme weather. It can form high-quality multi-dimensional spatiotemporal vibration response data. However, it has the following technical problems: due to factors such as signal transmission quality or attenuation, when determining the vehicle trajectory based on spatiotemporal vibration response data, the trajectory of the same vehicle will be identified as two segments of trajectory, and then it will be regarded as two vehicles, resulting in inaccurate detection results of macro traffic flow.
[0004] Therefore, there is an urgent need to provide a real-time detection method, device, equipment and storage medium for macro traffic flow, so as to ensure that the same vehicle corresponds to only one trajectory and improve the accuracy of macro traffic flow detection results. Summary of the invention
[0005] In view of this, it is necessary to provide a real-time detection method, device, equipment and storage medium for macro traffic flow to solve the technical problem in the prior art that the same vehicle is easily identified as two vehicles, resulting in inaccurate macro traffic flow detection results.
[0006] On the one hand, in order to solve the above technical problems, the present invention provides a real-time detection method for macro traffic flow, comprising: Based on the straight line segment detection method, straight line extraction is performed on the spatiotemporal vibration response data within the time and region of interest to obtain multiple initial straight line segments; Randomly sampling the multiple initial straight line segments based on the Monte Carlo method to obtain a sampling set, wherein the sampling set includes a first initial straight line segment and a second initial straight line segment; determining a position difference between the first initial straight line segment and the second initial straight line segment, and when the position difference is less than a position difference threshold, merging the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment, and optimizing the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; When the number of random sampling times reaches a maximum number, a macroscopic traffic flow detection result is determined based on the plurality of optimized straight line segments.
[0007] In a possible implementation manner, determining the position difference between the first initial straight line segment and the second initial straight line segment includes: Acquire a plurality of first discrete point coordinates of a plurality of first discrete points in the first initial straight line segment in a preset coordinate system and a plurality of second discrete point coordinates of a plurality of second discrete points in the second initial straight line segment in a preset coordinate system; Determine a first coordinate average of the plurality of first discrete point coordinates and a second coordinate average of the plurality of second discrete point coordinates; The position difference is determined based on the first coordinate average and the second coordinate average.
[0008] In a possible implementation manner, the spatiotemporal vibration response data is spatiotemporal vibration response data corresponding to a single lane.
[0009] In a possible implementation manner, before extracting straight lines from the spatiotemporal vibration response data within the time and region of interest based on the straight line segment detection method, the method further includes: The spatiotemporal vibration response data are binarized and closed sequentially.
[0010] In a possible implementation, the macro traffic flow detection result includes the number of interval vehicles, interval vehicle speed, average passing time, average vehicle spacing, average time distance, lane space occupancy, lane time occupancy and cross-sectional flow in the area of interest: the macro traffic flow detection result is determined based on the multiple optimized straight line segments, including: Taking each of the optimized straight line segments as a vehicle and taking the slope of the optimized straight line segment as the vehicle speed; The total number of vehicles in the region of interest is taken as the number of vehicles; Taking the average of the vehicle speeds of the plurality of vehicles as the vehicle speed in the interval; The ratio of the interval distance of the region of interest to the interval vehicle speed is used as the average passing time; Taking the average vehicle distance between the plurality of vehicles as the average vehicle distance; Obtaining a location of interest, and determining a time difference between different vehicles passing through the location of interest within the time of interest, and taking an average of the time differences corresponding to a plurality of vehicles as the average time distance; Determine the vehicle occupation length in the region of interest at a certain moment, and use the ratio of the vehicle occupation length to the interval length of the region of interest as the lane space occupancy rate; Determine the time ratio of the accumulated time of the vehicle passing through a certain section of interest within the time of interest and the time of interest, and use the time ratio as the lane time occupancy rate; The total number of vehicles passing through the section of interest within the time of interest is taken as the section flow.
[0011] In a possible implementation manner, before determining the macroscopic traffic flow detection result based on the multiple optimized straight line segments, the method further includes: Obtaining the slope of each of the optimized straight line segments, and determining whether the slope is less than a threshold slope; When the slope is less than the threshold slope, the optimized straight line segment is eliminated.
[0012] In a possible implementation manner, before determining the macroscopic traffic flow detection result based on the multiple optimized straight line segments, the method further includes: Acquiring original vibration data corresponding to the optimized straight line segment; Determining the data volume of the original vibration data, and judging whether the data volume is less than a data volume threshold; When the data amount is less than the data amount threshold, the optimized straight line segment is eliminated.
[0013] On the other hand, the present invention also provides a macro traffic flow real-time detection device, comprising: A straight line segment extraction unit, used for performing straight line extraction on the spatiotemporal vibration response data within the time and region of interest based on a straight line segment detection method to obtain a plurality of initial straight line segments; A Monte Carlo sampling unit, configured to randomly sample the plurality of initial straight line segments based on a Monte Carlo method to obtain a sampling set, wherein the sampling set includes a first initial straight line segment and a second initial straight line segment; a straight line segment optimization unit, configured to determine a position difference between the first initial straight line segment and the second initial straight line segment, merge the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment when the position difference is less than a position difference threshold, and optimize the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; The macro traffic flow detection unit is used to determine the macro traffic flow detection result based on the multiple optimized straight line segments when the number of random sampling times reaches a maximum number.
[0014] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the real-time detection method of macro traffic flow described in any one of the possible implementations above.
[0015] On the other hand, the present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the real-time detection method of macroscopic traffic flow described in any of the above possible implementation methods.
[0016] The beneficial effects of the present invention are as follows: the real-time detection method for macroscopic traffic flow provided by the present invention, after extracting straight lines from spatiotemporal vibration response data based on a straight line segment detection method, randomly samples the obtained multiple initial straight line segments based on a Monte Carlo method to obtain a sampling set, and performs position difference judgment on the first initial straight line segment and the second initial straight line segment in the sampling set; when the position difference is less than a position difference threshold, it is determined that the first initial straight line segment and the second initial straight line segment are the same vehicle, and the first initial straight line segment and the second initial straight line segment are merged to avoid misjudging the same vehicle as two vehicles, thereby ensuring accurate determination of the vehicle, and further improving the accuracy of the detection results of the macroscopic traffic flow determined by the vehicle.
[0017] Furthermore, the present invention ensures the randomness of the obtained sampling set by randomly sampling multiple initial straight line segments based on the Monte Carlo method, avoids the dependence of the selection of initial straight line segments on the optimization results, and makes the optimization straight line segment results more reliable and universal. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A schematic diagram of a flow chart of an embodiment of a macroscopic traffic flow real-time detection method provided by the present invention; Figure 2 This is a schematic flow chart of an embodiment of determining the position difference between the first initial straight line segment and the second initial straight line segment in step S103 of the present invention; Figure 3 A schematic diagram of the macroscopic traffic flow detection result provided by the present invention; Figure 4 A schematic diagram of a flow chart of an embodiment of further optimizing an optimized straight line segment provided by the present invention; Figure 5 A schematic flow chart of another embodiment of further optimizing an optimized straight line segment provided by the present invention; Figure 6 A schematic diagram of the structure of an embodiment of a macroscopic traffic flow real-time detection device provided by the present invention; Figure 7 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] It should be understood that the schematic drawings are not drawn to scale. The flowchart used in the present invention shows the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present invention, can add one or more other operations to the flowchart, and can also remove one or more operations from the flowchart. Some of the block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0022] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0023] The present invention provides a macroscopic traffic flow real-time detection method, device, equipment and storage medium, which are respectively described below.
[0024] Figure 1 A flow chart of an embodiment of the macroscopic traffic flow real-time detection method provided by the present invention is as follows: Figure 1 As shown, the real-time detection method of macro traffic flow includes: S101, extracting straight lines from the spatiotemporal vibration response data within the time and region of interest based on a straight line segment detection method to obtain a plurality of initial straight line segments; S102, performing random sampling on a plurality of initial straight line segments based on a Monte Carlo method to obtain a sampling set, where the sampling set includes a first initial straight line segment and a second initial straight line segment; S103, determining a position difference between the first initial straight line segment and the second initial straight line segment, and when the position difference is less than a position difference threshold, merging the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment, and optimizing the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; S104. When the number of random sampling times reaches a maximum number, a macroscopic traffic flow detection result is determined based on a plurality of optimized straight line segments.
[0025] It should be understood that the spatiotemporal vibration response data in step S101 is obtained based on the collection of the grating array vibration sensor optical cable. The grating array vibration sensor optical cable can realize long-distance, all-weather vibration response data collection, is not affected by weather, and has strong anti-electromagnetic interference ability, which can further improve the accuracy of the macro traffic flow detection results.
[0026] The method of obtaining the spatiotemporal vibration response data within the time and region of interest can be: obtaining the spatiotemporal vibration response data of the entire time and domain, intercepting the spatiotemporal vibration response graph of the entire time and domain based on the time and region of interest, and then obtaining the spatiotemporal vibration response data within the time and region of interest. Alternatively, the method of obtaining the spatiotemporal vibration response data within the time and region of interest can be: directly obtaining the spatiotemporal vibration response data within the time and region of interest.
[0027] In a specific embodiment of the present invention, the straight line segment detection method in step S101 may be global probability Hough (HoughLinesP), which is specifically: mapping the straight line in the coordinate system of the spatiotemporal vibration response data to the parameter space, determining the straight line parameters according to the curve intersection points in the parameter space, and determining multiple initial straight line segments based on the straight line parameters.
[0028] It should be noted that: the sampling set in step S102 includes multiple initial straight line segments. For the sake of clarity and simplicity of explanation, the embodiment of the present invention uses the first initial straight line segment and the second initial straight line segment in the sampling set for illustration. In actual applications, it is necessary to perform position difference judgment on the initial straight line segments in pairs to determine whether all the initial straight line segments need to be merged to ensure the reliability of the obtained optimized straight line segments.
[0029] It should also be noted that: in step S103, when the position difference is greater than or equal to the position difference threshold, it means that the first initial straight line segment and the second initial straight line segment correspond to two vehicles respectively.
[0030] It should be further explained that in step S104, when the number of random sampling times does not reach the maximum number, multiple optimized straight line segments are used as multiple initial straight line segments, and the process returns to step S102, and steps S102 to S104 are executed until the number of random sampling times reaches the maximum number.
[0031] The position difference threshold and the maximum number of times can be set or adjusted according to actual application scenarios or experience values, and are not specifically limited here.
[0032] Compared with the prior art, the real-time detection method for macroscopic traffic flow provided by the embodiment of the present invention, after extracting straight lines from the spatiotemporal vibration response data based on the straight line segment detection method, randomly samples the obtained multiple initial straight line segments based on the Monte Carlo method to obtain a sampling set, and performs position difference judgment on the first initial straight line segment and the second initial straight line segment in the sampling set. When the position difference is less than the position difference threshold, it is determined that the first initial straight line segment and the second initial straight line segment are the same vehicle, and the first initial straight line segment and the second initial straight line segment are merged to avoid misjudging the same vehicle as two vehicles, thereby ensuring the accurate determination of the vehicle, and further improving the accuracy of the detection results of the macroscopic traffic flow determined by the vehicle.
[0033] Furthermore, the embodiment of the present invention ensures the randomness of the obtained sampling set by randomly sampling multiple initial straight line segments based on the Monte Carlo method, avoids the dependence of the selection of initial straight line segments on the optimization results, and makes the optimized straight line segment results more reliable and universal.
[0034] In some embodiments of the present invention, Figure 2 As shown, determining the position difference between the first initial straight line segment and the second initial straight line segment in step S103 includes: S201, obtaining a plurality of first discrete point coordinates of a plurality of first discrete points in a first initial straight line segment in a preset coordinate system and a plurality of second discrete point coordinates of a plurality of second discrete points in a second initial straight line segment in a preset coordinate system; S202, determining a first coordinate average of a plurality of first discrete point coordinates and a second coordinate average of a plurality of second discrete point coordinates; S203 , determining a position difference based on the first coordinate average and the second coordinate average.
[0035] Among them, the multiple first discrete points and the multiple second discrete points are all positions corresponding to the vibration sensing points in the optical fiber array vibration sensing cable.
[0036] The embodiment of the present invention improves the representativeness of the coordinates for the first initial straight line segment and the second initial straight line segment by taking the average coordinate value of multiple first discrete points and the average coordinate value of multiple second discrete points as the coordinates of the first initial straight line segment and the coordinates of the second initial straight line segment, thereby ensuring the accuracy and reliability of the determined position difference.
[0037] To improve traffic efficiency, a traffic road surface usually includes at least two lanes. When two different vehicles run parallel in two adjacent lanes, the position difference between the straight line segments of the trajectories formed by the two vehicles will also be smaller. To avoid this situation from affecting the traffic flow detection results, in some embodiments of the present invention, the spatiotemporal vibration response data is the spatiotemporal vibration response data corresponding to a single lane.
[0038] The embodiment of the present invention can avoid the adverse effect of parallel vehicles in two adjacent lanes on vehicle determination by acquiring and analyzing the spatiotemporal vibration response data corresponding to each lane, thereby further improving the accuracy of traffic flow detection results.
[0039] It should be noted that the grating array vibration sensor cable includes multiple channels, each channel corresponds to a lane, that is, by collecting the spatiotemporal vibration response data of different channels, the acquired spatiotemporal vibration response data can be obtained as the spatiotemporal vibration response data corresponding to a single lane.
[0040] In order to avoid the adverse effect of poor data quality of spatiotemporal vibration response data on the detection results, in some embodiments of the present invention, before step S101, the macroscopic traffic flow real-time detection method further includes: The spatiotemporal vibration response data are binarized and closed sequentially.
[0041] Among them, during the binarization processing, the binarization segmentation threshold can be determined based on the maximum inter-class difference method (OTSU), and the spatiotemporal vibration response data can be binarized based on the binarization segmentation threshold to obtain a binarized image.
[0042] Among them, the closing operation is to first dilate the binary image and then erode it, so as to achieve the purpose of closing small cracks in the binary image, and the vehicle trajectories in the spatiotemporal vibration response data are connected together to improve the accuracy of vehicle trajectory judgment.
[0043] It should be understood that corrosion processing and dilation processing are mature processing methods of image morphology and will not be described in detail here.
[0044] In order to improve the comprehensiveness of the detection of macro traffic flow, in some embodiments of the present invention, the macro traffic flow detection results include the number of interval vehicles, interval vehicle speed, average passing time, average vehicle spacing, average time distance, lane space occupancy, lane time occupancy and cross-sectional flow in the area of interest.
[0045] Specifically, some macro traffic flow detection results are as follows: Figure 3 As shown, the time headway is the time difference of vehicles passing through the same section, the vehicle spacing is the distance between two adjacent vehicles, and the section flow is the number of vehicles passing through a certain section within a certain period of time.
[0046] The embodiment of the present invention improves the comprehensiveness of the detection result by obtaining macro traffic flow detection results in multiple different dimensions.
[0047] Specifically, step S104 includes: Each optimized straight line segment is regarded as a vehicle, and the slope of the optimized straight line segment is regarded as the vehicle speed; The total number of vehicles in the area of interest is taken as the number of vehicles; The average of the speeds of multiple vehicles is used as the interval speed; The ratio of the interval distance and the interval speed in the area of interest is taken as the average passing time; The average vehicle distance between multiple vehicles is taken as the average vehicle distance; Obtain the location of interest, and determine the time difference between different vehicles passing the location of interest within the time of interest, and take the average of the time differences corresponding to multiple vehicles as the average time distance; Determine the vehicle occupation length in the region of interest at a certain moment, and take the ratio of the vehicle occupation length to the interval length of the region of interest as the lane space occupancy rate; Determine the time ratio of the accumulated time of the vehicle passing through a certain section of interest and the time of interest within the time of interest, and use the time ratio as the lane time occupancy rate; The total number of vehicles passing through the section of interest during the time of interest is taken as the section flow.
[0048] From the above description, it can be seen that the optimized straight line segment represents a vehicle. The accurate determination of the optimized straight line segment is crucial to the accuracy of the detection result of the macroscopic traffic flow. In order to further ensure the accuracy of the optimized straight line segment, in some embodiments of the present invention, Figure 4 As shown, before step S104, it also includes: S401, obtaining the slope of each optimized straight line segment, and determining whether the slope is less than a threshold slope; S402: When the slope is less than the threshold slope, the optimized straight line segment is eliminated.
[0049] Since the slope of the optimized straight line segment represents the speed of the vehicle, the speed of the vehicle traveling on the road should not be too small. When the speed is too small, it is considered not to be the vehicle trajectory. Based on this characteristic, by judging the slope of the optimized straight line segment, the trajectory with too small speed that does not conform to normal driving can be eliminated. In other words, the embodiment of the present invention retains the optimized straight line segment with higher confidence by judging the slope, thereby ensuring the accuracy and reliability of the optimized straight line segment.
[0050] It should be understood that the threshold slope can be set or adjusted according to actual scenarios and is not specifically limited here.
[0051] Since vehicle driving is continuous, the amount of data in the optimized straight line segment generated by vehicle driving should not be too small. When the amount of data is too small, this optimized straight line segment is not caused by vehicle driving. In order to avoid misjudging it as a vehicle when this happens, resulting in an error in the final macroscopic traffic flow detection result, in some embodiments of the present invention, such as Figure 5 As shown, before step S104, it also includes: S501, obtaining original vibration data corresponding to the optimized straight line segment; S502, determining the data volume of the original vibration data, and judging whether the data volume is less than a data volume threshold; S503: When the data volume is less than the data volume threshold, the optimized straight line segment is eliminated.
[0052] Based on the characteristic of continuous vehicle trajectories, the embodiment of the present invention removes optimized straight line segments when the data volume of the original vibration data is too small, so as to avoid misjudging them as vehicle trajectories, further improve the accuracy of vehicle trajectory judgment, and thus improve the accuracy of macro traffic flow detection results.
[0053] Among them, the data volume threshold can be set or adjusted according to the actual application scenario, which will not be elaborated here.
[0054] In summary, the real-time detection method for macro traffic flow proposed in the embodiment of the present invention realizes real-time and accurate detection of macro traffic flow, provides a reference for improving traffic efficiency, reducing traffic congestion and accidents, and optimizing traffic planning, and realizes real-time response to traffic incidents.
[0055] In order to better implement the real-time detection method for macroscopic traffic flow in the embodiment of the present invention, based on the real-time detection method for macroscopic traffic flow, the embodiment of the present invention also provides a real-time detection device for macroscopic traffic flow, such as Figure 6 As shown, the macro traffic flow real-time detection device 600 includes: A straight line segment extraction unit 601 is used to extract straight lines from the spatiotemporal vibration response data within the time and region of interest based on a straight line segment detection method to obtain a plurality of initial straight line segments; A Monte Carlo sampling unit 602 is used to randomly sample multiple initial straight line segments based on a Monte Carlo method to obtain a sampling set, where the sampling set includes a first initial straight line segment and a second initial straight line segment; A straight line segment optimization unit 603 is used to determine a position difference between the first initial straight line segment and the second initial straight line segment, and when the position difference is less than a position difference threshold, merge the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment, and optimize the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; The macro traffic flow detection unit 604 is used to determine the macro traffic flow detection result based on multiple optimized straight line segments when the number of random sampling times reaches a maximum number.
[0056] The macro-traffic flow real-time detection device 600 provided in the above embodiment can implement the technical solution described in the above embodiment of the macro-traffic flow real-time detection method. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above embodiment of the macro-traffic flow real-time detection method, which will not be repeated here.
[0057] like Figure 7 As shown, the present invention also provides an electronic device 700. The electronic device 700 includes a processor 701, a memory 702 and a display 703. Figure 7 Only some components of the electronic device 700 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0058] In some embodiments, the processor 701 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 702, such as the real-time detection method for macroscopic traffic flow in the present invention.
[0059] In some embodiments of the present invention, the processor 701 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 701 may be local or remote. In some embodiments, the processor 701 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0060] In some embodiments, the memory 702 may be an internal storage unit of the electronic device 700, such as a hard disk or memory of the electronic device 700. In other embodiments, the memory 702 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 700.
[0061] Furthermore, the memory 702 may include both an internal storage unit of the electronic device 700 and an external storage device. The memory 702 is used to store application software installed in the electronic device 700 and various data.
[0062] In some embodiments, the display 703 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 703 is used to display information of the electronic device 700 and to display a visual user interface. The components 701-703 of the electronic device 700 communicate with each other via a system bus.
[0063] In some embodiments of the present invention, when the processor 701 executes the macroscopic traffic flow real-time detection program in the memory 702, the following steps may be implemented: Based on the straight line segment detection method, straight line extraction is performed on the spatiotemporal vibration response data within the time and region of interest to obtain multiple initial straight line segments; Randomly sampling multiple initial straight line segments based on the Monte Carlo method to obtain a sampling set, where the sampling set includes a first initial straight line segment and a second initial straight line segment; Determine a position difference between the first initial straight line segment and the second initial straight line segment, and when the position difference is less than a position difference threshold, merge the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment, and optimize the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; When the number of random samplings reaches the maximum number, the macroscopic traffic flow detection result is determined based on multiple optimized straight line segments.
[0064] It should be understood that: when the processor 701 executes the macroscopic traffic flow real-time detection program in the memory 702, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0065] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 700 mentioned, and the electronic device 700 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices. It should also be understood that in some other embodiments of the present invention, the electronic device 700 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (such as a touch panel).
[0066] Accordingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions in the real-time detection method of macro traffic flow provided by the above-mentioned method embodiments can be implemented.
[0067] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0068] The above is a detailed introduction to a macroscopic traffic flow real-time detection method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A real-time detection method for macroscopic traffic flow, characterized in that: include: Based on the straight line segment detection method, straight line extraction is performed on the spatiotemporal vibration response data within the time and region of interest to obtain multiple initial straight line segments; Randomly sampling the multiple initial straight line segments based on the Monte Carlo method to obtain a sampling set, wherein the sampling set includes a first initial straight line segment and a second initial straight line segment; determining a position difference between the first initial straight line segment and the second initial straight line segment, and when the position difference is less than a position difference threshold, merging the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment, and optimizing the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; When the number of random sampling times reaches a maximum number, a macroscopic traffic flow detection result is determined based on the plurality of optimized straight line segments.
2. The real-time detection method for macroscopic traffic flow according to claim 1 is characterized in that: The determining the position difference between the first initial straight line segment and the second initial straight line segment comprises: Acquire a plurality of first discrete point coordinates of a plurality of first discrete points in the first initial straight line segment in a preset coordinate system and a plurality of second discrete point coordinates of a plurality of second discrete points in the second initial straight line segment in a preset coordinate system; Determine a first coordinate average of the plurality of first discrete point coordinates and a second coordinate average of the plurality of second discrete point coordinates; The position difference is determined based on the first coordinate average and the second coordinate average.
3. The real-time detection method for macroscopic traffic flow according to claim 1 is characterized in that: The spatiotemporal vibration response data is the spatiotemporal vibration response data corresponding to a single lane.
4. The real-time detection method for macroscopic traffic flow according to claim 1 is characterized in that: Before extracting straight lines from the spatiotemporal vibration response data within the time and region of interest based on the straight line segment detection method, the method further includes: The spatiotemporal vibration response data are binarized and closed sequentially.
5. The real-time detection method for macroscopic traffic flow according to claim 1 is characterized in that: The macro traffic flow detection result includes the number of interval vehicles, interval vehicle speed, average passing time, average vehicle spacing, average time distance, lane space occupancy, lane time occupancy and cross-sectional flow in the area of interest: The macro traffic flow detection result determined based on the multiple optimized straight line segments includes: Taking each of the optimized straight line segments as a vehicle and taking the slope of the optimized straight line segment as the vehicle speed; The total number of vehicles in the region of interest is taken as the number of vehicles; Taking the average of the vehicle speeds of the plurality of vehicles as the vehicle speed in the interval; The ratio of the interval distance of the region of interest to the interval vehicle speed is used as the average passing time; Taking the average vehicle distance between the plurality of vehicles as the average vehicle distance; Obtaining a location of interest, and determining a time difference between different vehicles passing through the location of interest within the time of interest, and taking an average of the time differences corresponding to a plurality of vehicles as the average time distance; Determine the vehicle occupation length in the region of interest at a certain moment, and use the ratio of the vehicle occupation length to the interval length of the region of interest as the lane space occupancy rate; Determine the time ratio of the accumulated time of the vehicle passing through a certain section of interest within the time of interest and the time of interest, and use the time ratio as the lane time occupancy rate; The total number of vehicles passing through the section of interest within the time of interest is taken as the section flow.
6. The real-time detection method for macroscopic traffic flow according to claim 1 is characterized in that: Before determining the macroscopic traffic flow detection result based on the multiple optimized straight line segments, the method further includes: Obtaining the slope of each of the optimized straight line segments, and determining whether the slope is less than a threshold slope; When the slope is less than the threshold slope, the optimized straight line segment is eliminated.
7. The real-time detection method for macroscopic traffic flow according to claim 1 is characterized in that: Before determining the macroscopic traffic flow detection result based on the multiple optimized straight line segments, the method further includes: Acquiring original vibration data corresponding to the optimized straight line segment; Determining the data volume of the original vibration data, and judging whether the data volume is less than a data volume threshold; When the data amount is less than the data amount threshold, the optimized straight line segment is eliminated.
8. A real-time detection device for macroscopic traffic flow, characterized in that: include: A straight line segment extraction unit is used to extract straight lines from the spatiotemporal vibration response data within the time and region of interest based on a straight line segment detection method to obtain a plurality of initial straight line segments; A Monte Carlo sampling unit, configured to randomly sample the plurality of initial straight line segments based on a Monte Carlo method to obtain a sampling set, wherein the sampling set includes a first initial straight line segment and a second initial straight line segment; a straight line segment optimization unit, configured to determine a position difference between the first initial straight line segment and the second initial straight line segment, merge the first initial straight line segment and the second initial straight line segment to obtain a merged straight line segment when the position difference is less than a position difference threshold, and optimize the multiple initial straight line segments based on the merged straight line segment to obtain multiple optimized straight line segments; The macro traffic flow detection unit is used to determine the macro traffic flow detection result based on the multiple optimized straight line segments when the number of random sampling times reaches a maximum number.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the real-time detection method of macro traffic flow as described in any one of claims 1 to 7 above.
10. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the real-time detection method for macroscopic traffic flow as described in any one of claims 1 to 7.