Traffic volume data detection method and device, electronic equipment and storage medium
By acquiring and analyzing motion trajectories within a set area and calculating traffic data, the problem of low accuracy of traffic data in the existing technology is solved, and accurate traffic calculation between different starting points and ending points is achieved.
Patent Information
- Application Number
- CN202310281537.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, traffic data are usually obtained through empirical settings or by detecting the number of vehicles and pedestrians passing by a certain location, resulting in reduced data accuracy, and only the traffic volume at a certain location can be detected, and different starting points cannot be accurately calculated. The amount of traffic to and from the termination point.
By obtaining multiple set starting points and ending points from the set area, obtain and analyze multiple motion trajectories of the moving object, find the starting point and ending point corresponding to each trajectory, and calculate the traffic volume data, including each set of starting points. The amount of traffic between the terminal and the terminal point.
It improves the accuracy of traffic data, can accurately calculate the traffic between different starting points and ending points, and enhances the reflection of the movement process of moving objects.
Smart Images

Figure CN118692228A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and more specifically, to a method and device for detecting traffic data, an electronic device, a storage medium, and a program product. Background Art
[0002] In application scenarios such as road planning and traffic simulation experiments, it is necessary to obtain traffic volume data of moving objects such as vehicles and pedestrians, so as to carry out road planning and traffic simulation experiments based on the traffic volume data.
[0003] However, in the related art, traffic volume data is usually set by relevant personnel based on experience, or the number of vehicles and pedestrians passing a certain location is detected by a detection device, thereby reducing the accuracy of the traffic volume data. Summary of the invention
[0004] The embodiments of the present application provide a traffic data detection method and device, an electronic device, a storage medium, and a program product, which can improve the accuracy of traffic data.
[0005] According to one aspect of an embodiment of the present application, a method for detecting traffic volume data is provided, the method comprising:
[0006] Acquire multiple set starting points and multiple set ending points from the set area respectively;
[0007] Acquire multiple motion trajectories of the moving objects in the set area;
[0008] From the plurality of set starting points and the plurality of set ending points, respectively searching for a set starting point and a set ending point corresponding to each motion track;
[0009] The traffic volume data in the set area is calculated according to the set starting points and the set ending points respectively corresponding to the multiple motion trajectories; wherein the traffic volume data includes the traffic volume corresponding to each group of the set starting points and the set ending points among the multiple set starting points and the multiple set ending points.
[0010] According to one aspect of an embodiment of the present application, a traffic volume data detection device is provided, the device comprising:
[0011] An acquisition module is configured to respectively acquire a plurality of set starting points and a plurality of set ending points from a set area;
[0012] A detection module, configured to obtain multiple motion trajectories of the moving object in the set area;
[0013] A search module, configured to search for a set starting point and a set ending point corresponding to each motion track from the plurality of set starting points and the plurality of set ending points;
[0014] A calculation module is configured to calculate the traffic volume data in the set area according to the set starting points and the set ending points respectively corresponding to the multiple motion trajectories; wherein the traffic volume data includes the traffic volume corresponding to each group of the set starting points and the set ending points among the multiple set starting points and the multiple set ending points.
[0015] In an exemplary embodiment, the search module is configured to: obtain the position information of each of the multiple set starting points and the multiple set ending points, and search for the road reference line information of the road to which each set point belongs from the map data according to the position information of each set point; calculate the reference line of each set point according to the position information of each set point and the road reference line information of the road to which it belongs; search for a set starting point from the multiple set starting points where the corresponding reference line has an intersection with each of the motion trajectories, and search for a set ending point from the multiple set ending points where the corresponding reference line has an intersection with each of the motion trajectories.
[0016] In an exemplary embodiment, under the condition that each of the motion trajectories includes multiple trajectory segments, the search module is configured to: compare the multiple trajectory segments with the reference lines of the multiple set starting points in sequence until a starting trajectory segment that has an intersection with the reference line of any set starting point among the multiple set starting points is found; compare the multiple trajectory segments with the reference lines of the multiple set ending points in sequence until a terminating trajectory segment that has an intersection with the reference line of any set ending point among the multiple set ending points is found; obtain a set starting point at which a corresponding reference line has an intersection with the starting trajectory segment, and a set ending point at which a corresponding reference line has an intersection with the terminating trajectory segment.
[0017] In an exemplary embodiment, the search module is configured to: calculate a linear expression corresponding to any trajectory segment among the multiple trajectory segments based on the position information of the starting point and the end point of the any trajectory segment; compare the linear expression corresponding to any trajectory segment with the linear expressions corresponding to the reference lines of the multiple set starting points respectively; if there is no intersection between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of each of the multiple set starting points, calculate the linear expression corresponding to the next trajectory segment among the multiple trajectory segments until the starting trajectory segment is found.
[0018] In an exemplary embodiment, the search module is further configured to: in the process of comparing the multiple trajectory segments with the reference lines of the multiple set end points in sequence, if the starting trajectory segment is found, obtain the starting time corresponding to the starting point of the starting trajectory segment; from the multiple trajectory segments, filter out the trajectory segments whose starting time is later than the starting time of the starting trajectory segment; and compare the filtered trajectory segments with the reference lines of the multiple set end points in sequence until the ending trajectory segment is found.
[0019] In an exemplary embodiment, the search module is further configured to: obtain the starting time corresponding to the starting point of each of the multiple trajectory segments; and compare the multiple trajectory segments with the reference lines of the multiple set starting points in order from front to back according to the corresponding starting times until a terminal trajectory segment that intersects with the reference line of any of the multiple set ending points is found.
[0020] In an exemplary embodiment, the detection module is configured to: periodically detect the position information corresponding to multiple moving objects in the set area to obtain a position information sequence of each moving object; generate a trajectory segment corresponding to each moving object based on adjacent position information in the position information sequence of each moving object; and generate a motion trajectory corresponding to each moving object based on the trajectory segment corresponding to each moving object.
[0021] In an exemplary embodiment, the calculation module is configured to: obtain the entry time of each motion trajectory into the corresponding set starting point, and search for a calculation cycle that matches the entry time of each motion trajectory from multiple calculation cycles; calculate the traffic volume data corresponding to each calculation cycle in the multiple calculation cycles according to the set starting points, set ending points and calculation cycles respectively corresponding to the multiple motion trajectories.
[0022] In an exemplary embodiment, under the condition that each motion trajectory contains multiple trajectory segments, the calculation module is configured to: obtain the intersection between each motion trajectory and the reference line of the set starting point corresponding to each running trajectory, and the starting trajectory segment to which the intersection belongs; calculate the distance between the starting point and the end point of the starting trajectory segment, and the distance between the starting point and the intersection; calculate the time corresponding to the intersection based on the distance between the starting point and the end point, the distance between the starting point and the intersection, and the time corresponding to the starting point and the end point respectively; and use the time corresponding to the intersection as the entry time corresponding to each motion trajectory.
[0023] In an exemplary embodiment, the calculation module is further configured to: obtain a set time interval, and search for multiple target calculation cycles that match the set time interval from the multiple calculation cycles; obtain traffic data corresponding to the multiple target calculation cycles respectively, and fuse the obtained traffic data to obtain the traffic data corresponding to the set time interval.
[0024] In an exemplary embodiment, the calculation module is configured to: obtain the moving object corresponding to each motion trajectory, and search for an object type that matches the moving object corresponding to each motion trajectory from a plurality of object types; and calculate the traffic data corresponding to each object type in the plurality of object types according to the set starting points, set ending points and object types respectively corresponding to the plurality of motion trajectories.
[0025] In an exemplary embodiment, the calculation module is configured to: construct a traffic data matrix based on the multiple set starting points and the multiple set ending points; the elements in the traffic data matrix represent the traffic; and update the values of the elements contained in the traffic data matrix based on the set starting points and the set ending points respectively corresponding to the multiple motion trajectories.
[0026] According to one aspect of an embodiment of the present application, there is provided an electronic device, including:
[0027] one or more processors;
[0028] The storage device is used to store one or more computer programs. When the one or more computer programs are executed by the one or more processors, the electronic device implements the traffic data detection method as described above.
[0029] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device implements the traffic data detection method as described above.
[0030] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the traffic data detection method as described above is implemented.
[0031] In the technical solution provided in the embodiments of the present application, after obtaining multiple set starting points and multiple set ending points from the set area respectively, and obtaining multiple motion trajectories of the moving object in the set area, the set starting points and the set ending points corresponding to each motion trajectory are searched from the multiple set starting points and the multiple set ending points respectively, and then, the traffic data in the set area is calculated according to the set starting points and the set ending points corresponding to the multiple motion trajectories respectively; wherein the traffic data includes the traffic corresponding to each group of set starting points and the set ending points among the multiple set starting points and the multiple set ending points. Compared with the related technology, the motion trajectory can better reflect the motion process of the moving object. Therefore, calculating the traffic data according to the motion trajectory can improve the accuracy of the traffic data, and can also calculate the traffic between different starting points and ending points.
[0032] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a schematic diagram of an implementation environment shown in an exemplary embodiment of the present application;
[0034] Figure 2 is a flow chart of a method for detecting traffic data shown in an exemplary embodiment of the present application;
[0035] Figure 3 is a road schematic diagram shown in another exemplary embodiment of the present application;
[0036] Figure 4 is a schematic diagram of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0037] Figure 5 is a reference line schematic diagram shown in another exemplary embodiment of the present application;
[0038] Figure 6 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0039] Figure 7 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0040] Figure 8 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0041] Fig. 9 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0042] Fig.10 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0043] Fig.11 is a schematic diagram of a motion trajectory shown in another exemplary embodiment of the present application;
[0044] Fig.12 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0045] Fig.13 is a schematic diagram of a method for detecting traffic data according to an exemplary embodiment of the present application;
[0046] Fig.14 is a flow chart of a method for detecting traffic data shown in an exemplary embodiment of the present application;
[0047] Fig.15 is a schematic diagram of a starting trajectory segment and a reference line for setting a starting point shown in an exemplary embodiment of the present application;
[0048] Fig.16 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0049] Fig.17 is a flow chart of a method for detecting traffic data according to another exemplary embodiment of the present application;
[0050] Fig.18 is a motion trajectory preprocessing flow chart shown in an exemplary embodiment of the present application;
[0051] Fig.19 is a motion trajectory preprocessing flow chart shown in an exemplary embodiment of the present application;
[0052] Fig. 20 is a flow chart of traffic data calculation shown in an exemplary embodiment of the present application;
[0053] Fig.21 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0054] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0055] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0056] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0057] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0058] The following is a detailed introduction to the technical solutions of the embodiments of the present application:
[0059] In the related art, traffic volume data is usually set by relevant personnel based on experience, or the number of vehicles and pedestrians passing a certain location is detected by a detection device. For the first method of obtaining traffic volume data, the accuracy of the traffic volume data is reduced. For the second method of obtaining traffic volume data, not only the accuracy of the traffic volume data is reduced, but also the traffic volume at a certain location can only be detected. Based on this, the embodiments of the present application provide a traffic volume data detection method and device, electronic device, storage medium, and program product, which can improve the accuracy of traffic volume data and calculate the traffic volume between different starting points and end points.
[0060] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment involved in the present application, which includes a traffic data detection device 110 and multiple moving objects 120.
[0061] The traffic volume data detection device 110 may be a terminal device, or a server, or a system composed of terminal devices or servers. The terminal devices may include but are not limited to smart phones, tablets, laptops, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, devices for payment, etc. The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The specific forms of terminal devices and servers are not limited here.
[0062] A moving object refers to any object that can move, including but not limited to vehicles, pedestrians, etc. Transportation includes vehicles, ships, trains, airplanes, etc. Vehicles include motor vehicles (for example, cars, buses, motorcycles, etc.) and non-motor vehicles (for example, bicycles, etc.).
[0063] It should be noted that Figure 1 The number of traffic data detection devices 110 and moving objects 120 in the figure is only for illustration, and any number of traffic data detection devices 110 and moving objects 120 may be provided according to actual needs.
[0064] In an exemplary embodiment, after obtaining multiple set starting points and multiple set ending points from a set area and obtaining multiple motion trajectories of a moving object in the set area, the traffic volume data detection device respectively searches for the set starting points and set ending points corresponding to each motion trajectory from the multiple set starting points and multiple set ending points, and then calculates the traffic volume data in the set area according to the set starting points and set ending points corresponding to the multiple motion trajectories; wherein the traffic volume data includes the traffic volume corresponding to each set starting point and set ending point in the multiple set starting points and multiple set ending points. Compared with related technologies, since the motion trajectory is real and can better reflect the motion process of the moving object, calculating the traffic volume data according to the motion trajectory can improve the accuracy of the traffic volume data, and can calculate the traffic volume between different starting points and ending points.
[0065] It should be noted that the traffic volume data detection method provided in the embodiments of the present application can be applied to any scenario where traffic volume needs to be detected, for example, it can be applied to traffic simulation experiment scenarios, and the traffic volume data detection method can be deployed in traffic simulation software. The embodiments of the present application involve user-related data such as motion trajectories. When the method of the present application is applied to specific products or technologies, the user's permission or consent is obtained, and the extraction, use and processing of relevant data comply with local safety standards and local laws and regulations.
[0066] See also Figure 2 , Figure 2 is a flow chart of a method for detecting traffic volume data shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0067] like Figure 2 As shown, in an exemplary embodiment, the traffic volume data detection method may include steps S210 to S240, which are described in detail as follows:
[0068] Step S210: acquiring a plurality of set starting points and a plurality of set ending points from a set area respectively.
[0069] The set area refers to any area where the traffic volume of moving objects needs to be counted, which can be an area set manually. Among them, the moving object refers to any object that can move, including but not limited to vehicles, pedestrians, etc., vehicles include vehicles, ships, trains, airplanes, etc., vehicles include motor vehicles (for example, cars, buses, motorcycles, etc.), non-motor vehicles (for example, bicycles, etc.). For example, in order to count the traffic volume of vehicles in area a, area a can be set as the set area.
[0070] An area usually contains multiple locations. In order to count the traffic between different locations, you can set the starting point and the ending point. The starting point refers to the starting point of the location where the traffic needs to be counted, and the ending point refers to the end point of the location where the traffic needs to be counted. For example, see Figure 3 As shown, Figure 3 is a section of expressway, including intersections 0-6, where intersections 0, 1, and 3 are the intersections for entering the expressway, and intersections 2, 4, 5, and 6 are the intersections for exiting the expressway. In order to count the traffic volume between different intersections in this section of expressway, intersections 0, 1, and 3 can be set as the set starting points, and intersections 2, 4, 5, and 6 can be set as the set ending points.
[0071] In an optional embodiment, in order to count the traffic volume on different roads, the process of obtaining multiple set starting points and multiple set ending points from a set area can be: receiving a road selection instruction, thereby selecting multiple roads from the set area according to the road selection instruction, and taking the starting point of each of the multiple roads as the set starting point, and the end point of each road as the set ending point. Optionally, the road selection instruction can include road identification information, and the road identification information refers to an identification that can uniquely distinguish the road, such as the road number, so that multiple roads can be selected from the set area according to the road selection instruction; or, the road selection instruction can also include the type of road, wherein the type of road includes but is not limited to motor vehicle roads, non-motor vehicle roads, sidewalks, etc., so as to select at least one type of road from the specified area according to the road selection instruction, so as to count the traffic volume on the at least one type of road.
[0072] In another optional embodiment, the process of respectively obtaining a plurality of set starting points and a plurality of set ending points from a set area may be: receiving a location selection instruction, and selecting a plurality of set starting points and a plurality of set ending points from the set area according to the location selection instruction; wherein the location selection instruction may include a starting point selection instruction and an ending point selection instruction, so that the set starting point is selected according to the starting point selection instruction, and the set ending point is selected according to the ending point selection instruction. For example, in one example, a map of the set area may be displayed, and the user may click on a certain location in the map, thereby triggering the location selection instruction, and using the clicked location as the set starting point or the set ending point. Optionally, considering that a moving object usually moves on a road, the set starting point and the set ending point may be selected from the roads included in the set area according to the location selection instruction, that is, the set starting point and the set ending point are located on the road.
[0073] Step S220: Acquire multiple motion trajectories of the moving objects in the set area.
[0074] The motion trajectory refers to the route that a moving object takes during the motion process, which includes the position of the moving object at different time points. In one example, the motion trajectory may include the identification information of the moving object, the position information sequence, and the time corresponding to each position information in the position information sequence (i.e., the time when the position information is detected).
[0075] Among them, the specific method of obtaining multiple motion trajectories of moving objects in a set area can be flexibly set according to actual needs. In an optional implementation, a terminal device with a positioning function will be deployed on the moving object, and the terminal device can detect the motion trajectory of the moving object. Therefore, the motion trajectory of the moving object sent by the terminal device deployed on the moving object can be received. For example, if the moving object is a vehicle, the motion trajectory of the vehicle sent by the vehicle-mounted terminal can be received. In another optional implementation, various types of sensors such as cameras and radars will be deployed in an area. For example, cameras will be deployed in roadside units. Therefore, the multiple motion trajectories of moving objects in the set area can be detected by sensors deployed in the set area; optionally, the multiple motion trajectories of moving objects in the set area can also be detected by various types of sensors deployed in the set area, so as to combine the data detected by various types of sensors to verify and complement each other, thereby improving the accuracy of the motion trajectory.
[0076] Step S230 , searching for a set starting point and a set ending point corresponding to each motion track from among the multiple set starting points and the multiple set ending points.
[0077] The set starting point corresponding to the motion trajectory refers to the set starting point passed by the motion trajectory during the movement process, and the set ending point corresponding to the motion trajectory refers to the set ending point passed by the motion trajectory during the movement process.
[0078] In order to determine the traffic volume data between the set starting point and the set ending point according to the motion trajectory, the set starting point corresponding to each motion trajectory can be found from multiple set starting points, and the set ending point corresponding to each motion trajectory can be found from multiple set ending points.
[0079] The specific method of finding the set starting point and the set ending point corresponding to each motion track can be flexibly set according to actual needs.
[0080] In an optional embodiment, a set starting point with the shortest distance from the starting point of each motion trajectory can be searched from multiple set starting points, and the found set starting point is used as the set starting point corresponding to the motion trajectory. Correspondingly, a set ending point with the shortest distance from the end point of the motion trajectory can be searched from multiple set ending points, and the found set ending point is used as the set ending point corresponding to the motion trajectory. For example, assuming that the starting point of a motion trajectory is q, the set starting points include d1-d3, wherein the distance between q and d1 is less than the distance between q and d2 and less than the distance between q and d3, therefore, d1 is used as the set starting point corresponding to the motion trajectory.
[0081] In another optional implementation, the set starting point with the smallest distance from each motion track can be found from multiple set starting points, and the found set starting point is used as the set starting point corresponding to the motion track. Correspondingly, the set ending point with the smallest distance from the motion track can be found from multiple set ending points, and the found set ending point is used as the set ending point corresponding to the motion track. It should be understood that a set starting point is equivalent to a point, and a motion track is equivalent to a line. The specific method of calculating the distance from the set starting point to the motion track is similar to the specific method of calculating the distance from a point to a line.
[0082] Optionally, in order to avoid the situation where the motion trajectory does not pass through the set starting point and the set ending point, after searching for the set starting point and the set ending point corresponding to each motion trajectory, it can be determined whether the distance between the found set starting point and the motion trajectory is less than or equal to the set distance threshold, and whether the distance between the found set ending point and the motion trajectory is less than or equal to the set distance threshold; if the distance between the found set starting point and the motion trajectory, and the distance between the found set ending point and the motion trajectory are both less than or equal to the set distance threshold, it indicates that the motion trajectory belongs to motion trajectories corresponding to multiple set starting points and multiple set ending points, and therefore, the motion trajectory is retained; if the distance between the found set starting point and the motion trajectory is greater than the set distance threshold, or the distance between the found set ending point and the motion trajectory is less than the set distance threshold, it indicates that the motion trajectory does not belong to motion trajectories corresponding to multiple set starting points and multiple set ending points, and therefore, the motion trajectory can be discarded. Among them, the set distance threshold can be 1 meter, 2 meters, etc. Considering that different types of moving objects have different positioning accuracy and movement amplitude, different set distance thresholds can be set according to the type of moving object. For example, if the moving object is a person, the corresponding set distance threshold can be 1 meter, and the moving object is a vehicle, and the corresponding set distance threshold can be 2 meters.
[0083] Step S240, calculating the traffic volume data in the set area according to the set starting points and the set ending points corresponding to the multiple motion trajectories respectively; wherein the traffic volume data includes the traffic volume corresponding to each group of the set starting points and the set ending points among the multiple set starting points and the multiple set ending points.
[0084] The traffic volume data is used to describe the traffic volume corresponding to each set of the set starting points and the set ending points among multiple set starting points and multiple set ending points. For example, assuming that the set starting points include q1 and q2, and the set ending points include z1, z2, and z3, the traffic volume data includes the traffic volume from q1 to z1, the traffic volume from q1 to z2, the traffic volume from q1 to z3, the traffic volume from q2 to z1, the traffic volume from q2 to z2, and the traffic volume from q2 to z3. The traffic volume data can be embodied in the form of a matrix, a chart, or a text description.
[0085] After determining the set starting point and the set ending point corresponding to each motion trajectory, the traffic volume data in the set area can be calculated according to the set starting points and the set ending points corresponding to the multiple motion trajectories. For example, continuing the above example, assuming that there are 10 motion trajectories, of which 3 motion trajectories correspond to q1 and z1, 2 motion trajectories correspond to q2 and z2, and 5 motion trajectories correspond to q2 and z3, the traffic volume data includes: the traffic volume from q1 to z1 is 3, the traffic volume from q1 to z2 is 0, the traffic volume from q1 to z3 is 0, the traffic volume from q2 to z1 is 0, the traffic volume from q2 to z2 is 2, and the traffic volume from q2 to z3 is 5.
[0086] Optionally, after each set starting point and set ending point corresponding to a motion trajectory are determined, the traffic volume data may be updated according to the set starting point and set ending point corresponding to the motion trajectory; or, after the set starting point and set ending point corresponding to multiple motion trajectories are determined, the traffic volume data may be calculated according to the set starting point and set ending point corresponding to the multiple motion trajectories.
[0087] exist Figure 2 In the illustrated embodiment, the traffic volume corresponding to each set of set starting points and set ending points is calculated based on the set starting points and set ending points corresponding to the motion trajectory, which can improve the accuracy of the traffic volume data, and the traffic volume between the starting point and the ending point can be calculated.
[0088] In an exemplary embodiment, see Figure 4 , Figure 4 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0089] like Figure 4 As shown, the method includes steps S210 to S220, steps S410 to S430, and step S240, wherein steps S410 to S430 are described in detail as follows:
[0090] Step S410, obtaining the position information of each of the plurality of set starting points and the plurality of set ending points, and searching the map data for the road reference line information of the road to which each of the set points belongs according to the position information of each of the set points.
[0091] The set point refers to each point among the plurality of set start points and the plurality of set end points. The road to which the set point belongs refers to the road where the position of the set point is located.
[0092] A road reference line refers to a line that can characterize the shape and direction of a road, such as a road centerline, a dividing line between roads, etc. Road reference line information refers to information used to describe a road reference line, which may include location information of the road reference line, or a linear expression corresponding to the road reference line, etc.
[0093] Map data refers to data used to describe geographical features of different regions, including road reference line information of different roads. Optionally, the map data may be data corresponding to a high-precision map.
[0094] The road reference line information of the road to which each set starting point belongs can be found from the map data according to the position information of each set starting point, and the road reference line information of the road to which each set ending point belongs can be found from the map data according to the position information of each set ending point.
[0095] Step S420 , calculating a reference line of each set point according to the position information of each set point and the road reference line information of the road to which it belongs.
[0096] The reference line of the set point refers to a straight line or line segment passing through the set point and used to identify the set point, wherein the reference line corresponding to the set starting point refers to the starting line corresponding to the set starting point, which passes through the set starting point; the reference line corresponding to the set ending point refers to the ending line corresponding to the set ending point, which passes through the set ending point.
[0097] It should be understood that the motion trajectory will pass through the starting line of the corresponding set starting point and the ending line of the corresponding set ending point. The moving object usually moves on the road. Therefore, the starting line of the set starting point is related to the road to which the set starting point belongs, and the ending line of the set ending point is related to the road to which the set ending line belongs. In order to determine the starting line of the set starting point and the ending line of the set ending point passed by the motion trajectory, the reference line of each set point can be calculated, that is, the starting line of each set starting point is calculated according to the position information of each set starting point and the road reference line information of the road to which it belongs, and correspondingly, the ending line of each set ending point is calculated according to the position information of each set ending point and the road reference line information of the road to which it belongs.
[0098] The specific method of calculating the reference line of each set point can be flexibly set according to actual needs. In an optional embodiment, the reference line of the set point can be a reference line that is at a set angle to the road reference line of the road to which it belongs. Therefore, the linear expression corresponding to the reference line of the set point can be calculated based on the linear expression corresponding to the road reference line of the road to which the set point belongs, the set angle, and the position information of the set point. The set angle can be flexibly set according to actual needs, for example, it can be set to 80 degrees, 70 degrees, 90 degrees, etc. In one example, the reference line of the set point can be perpendicular to the road reference line of the road to which it belongs, for example, see Figure 5 As shown, the reference line 511 corresponding to the starting point 510 is set to be perpendicular to the road reference line 520 of the road to which it belongs, and the reference line 531 corresponding to the ending point 530 is set to be perpendicular to the road reference line 520 of the road to which it belongs; under this condition, if the linear expression corresponding to the road reference line of the set point is: B2·x-A2·y+C2'=0; then the linear expression corresponding to the reference line of the set point is A 2· x+B 2· y+C2=0; Since the reference line of the set point passes through the set point, C2 can be calculated by the following formula: C2=-A 2· x p -B 2· y p . Among them, (x, y) represents the location information, for example, x, y can be longitude and latitude respectively, and the parameters A2, B2 and C2' can be found from the map data. p ,y p ) is the position information of the set point.
[0099] Optionally, since the width of the road is not infinite, after calculating the reference line corresponding to each set point, the value range of the position information of the reference line corresponding to each set point can also be determined according to the coverage of the road to which the set point belongs. For example, A can be limited to 2· x+B 2· In y+C2=0, the value range of x and y, that is, the reference line corresponding to the set point is a line segment.
[0100] Step S430, searching for a set starting point where the corresponding reference line intersects each motion track from a plurality of set starting points, and searching for a set ending point where the corresponding reference line intersects each motion track from a plurality of set ending points.
[0101] It should be understood that if the motion trajectory passes through a reference line corresponding to a set starting point, there is an intersection between the motion trajectory and the reference line corresponding to the set starting point. Correspondingly, if the motion trajectory passes through a reference line corresponding to a set ending point, there is an intersection between the motion trajectory and the reference line corresponding to the set ending point. For example, see Figure 5 As shown, there is an intersection between the motion trajectory 541 and the reference line 511 corresponding to the set starting point 510, there is an intersection between the motion trajectory 542 and the reference line 511 corresponding to the set starting point 510, and there is an intersection between the motion trajectory 543 and the reference line 531 corresponding to the set ending point 530. Therefore, each motion trajectory can be compared with the reference line corresponding to each set starting point, so as to find out the set starting point that has an intersection with the motion trajectory, and the found set starting point is used as the starting point corresponding to the motion trajectory; correspondingly, each motion trajectory is compared with the reference line corresponding to each set ending point, so as to find out the set ending point that has an intersection with the motion trajectory, and the found set ending point is the set ending point corresponding to the motion trajectory.
[0102] It should be noted that Figure 4 The specific implementation details of steps S210-S220 and step S240 shown in FIG. Figure 2 Steps S210 to S220 and step S240 are shown and will not be described in detail here.
[0103] exist Figure 4 In the illustrated embodiment, since the moving object usually travels on the road, the reference line corresponding to each set starting point is calculated based on the position information of each set starting point and the road reference line information of the road to which it belongs, and the reference line corresponding to each set ending point is calculated based on the position information of each set ending point and the road reference line information of the road to which it belongs, so that the accuracy of the reference line can be improved. Then, the set starting point corresponding to each motion trajectory is searched based on whether there is an intersection between the motion trajectory and the reference line corresponding to the set starting point, and the set ending point corresponding to the motion trajectory is searched based on whether there is an intersection between the motion trajectory and the reference line corresponding to the set ending point, so that the accuracy of the found set starting point and set ending point can be improved.
[0104] In an exemplary embodiment, see Figure 6 , Figure 6 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0105] like Figure 6As shown, under the condition that each motion trajectory contains multiple trajectory segments, the method includes steps S210-step S220, steps S410-step S420, steps S610-step S630, and step S240, wherein steps S610-step S630 are described in detail as follows:
[0106] Step S610 , comparing the plurality of trajectory segments with the reference lines of the plurality of set starting points in sequence until a starting trajectory segment having an intersection with the reference line of any of the plurality of set starting points is found.
[0107] The starting trajectory segment refers to a trajectory segment that has an intersection with a reference line of any set starting point, that is, a trajectory segment from which the set starting point is found.
[0108] Under the condition that each motion trajectory contains multiple trajectory segments, the positions and directions of the multiple trajectory segments are different, for example, see Figure 5 As shown, the positions and directions of the multiple trajectory segments in the motion trajectories 541-543 are different; therefore, the multiple trajectory segments contained in each motion trajectory can be compared with the reference lines of the multiple set starting points in turn until the starting trajectory segment corresponding to the motion trajectory is found, that is, firstly, one of the multiple trajectory segments is compared with the reference lines of the multiple set starting points. If the comparison result indicates that the trajectory segment is not the starting trajectory segment (that is, the set starting point is not found from the trajectory segment), then the next trajectory segment is compared with the reference lines of the multiple set starting points, and the cycle is repeated until the starting trajectory segment is found.
[0109] The specific method of comparing the multiple track segments of each motion track with the reference lines of the multiple set starting points in sequence can be flexibly set according to actual needs. In an optional embodiment, the reference time of each track segment can be obtained, and the multiple track segments can be compared with the reference lines of the multiple set starting points in sequence according to the reference time from front to back; wherein the reference time of the track segment can be the starting time corresponding to the starting point of the track segment, or it can also be the end time corresponding to the end point of the track segment, or it can also be the middle value between the starting time and the end time of the track segment; for example, the track segment 1 with a reference time of 9:00 can be compared with the reference lines of the multiple set starting points first, if the track segment is not the starting track segment, then the track segment with a reference time of 9:10 can be compared with the reference lines of the multiple set starting points. In another optional embodiment, a track segment can also be randomly extracted from the multiple track segments, and the extracted track segment can be compared with the reference lines of the multiple set starting points. If the extracted track segment is not the starting track segment, then the next track segment is randomly extracted from the multiple track segments until the starting track segment is found.
[0110] Step S620 , sequentially comparing the plurality of trajectory segments with the reference lines of the plurality of set end points, until a termination trajectory segment having an intersection with the reference line of any of the plurality of set end points is found.
[0111] The termination trajectory segment refers to a trajectory segment that has an intersection with any reference line of a set termination point, that is, a trajectory segment from which the set termination point is found.
[0112] Among them, the specific method of sequentially comparing the multiple track segments of each motion track with the multiple reference lines of the set end points can be flexibly set according to actual needs. In an optional embodiment, the multiple track segments can be sequentially compared with the multiple reference lines of the set end points in the order from back to front of the corresponding reference time. In another optional embodiment, a track segment can also be randomly extracted from the multiple track segments, and the extracted track segment can be compared with the multiple reference lines of the set end points. If the extracted track segment is not the end track segment, the next track segment is randomly extracted from the multiple track segments until the end track segment is found.
[0113] Optionally, step S610 and step S620 can be performed separately. Alternatively, step S610 and step S620 can also be combined. In one example, the multiple track segments contained in each motion trajectory can be compared with the reference lines of multiple set starting points and the reference lines of multiple set ending points in turn until the starting track segment and the ending track segment corresponding to the motion trajectory are found; that is, a track segment can be extracted from the multiple track segments contained in each motion trajectory, and the extracted track segment can be compared with the reference lines of multiple set starting points and the reference lines of multiple set ending points. If the comparison result indicates that the track segment is the starting track segment, the ending track segment is found from the remaining track segments; if the track segment is the ending track segment, the starting track segment is found from the remaining track segments; if the track segment is neither the starting track segment nor the ending track segment, the next track segment is extracted from the multiple track segments, and the next track segment is compared with the reference lines of multiple set starting points and the reference lines of multiple set ending points until the starting track segment and the ending track segment are found.
[0114] Step S630, obtaining a set starting point where the corresponding reference line intersects with the starting trajectory segment, and a set ending point where the corresponding reference line intersects with the ending trajectory segment.
[0115] After finding the starting trajectory segment and the ending trajectory segment corresponding to each motion trajectory, the set starting point that intersects with the starting trajectory segment is the set starting point corresponding to the motion trajectory, and the set ending point that intersects with the ending trajectory segment is the set ending point corresponding to the motion trajectory.
[0116] It should be noted that Figure 6 In the embodiment, the example of executing step S610 first and then executing step S620 is used for explanation. In other embodiments, step S620 may be executed first and then step S610, or step S610 and step S620 may be executed in parallel.
[0117] It should be noted that Figure 6 The specific implementation details of steps S210-S220 and step S240 shown in FIG. Figure 2 Steps S210 to S220, and step S240 are shown. Figure 6 The specific implementation details of steps S410 to S420 shown in FIG. Figure 4 Steps S410 to S420 shown are not repeated here.
[0118] exist Figure 6 In the illustrated embodiment, under the condition that each motion trajectory includes multiple trajectory segments, the multiple trajectory segments are sequentially compared with multiple set starting points and multiple set ending points to find out the starting trajectory segment and the ending trajectory segment, and the set starting point that has an intersection with the starting trajectory segment is used as the set starting point corresponding to the motion trajectory, and the set ending point that has an intersection with the ending trajectory segment is used as the set ending point corresponding to the motion trajectory, thereby improving the accuracy of the set starting point and the set ending point corresponding to the motion trajectory.
[0119] In an exemplary embodiment, see Figure 7 , Figure 7 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0120] like Figure 7 As shown, the method includes steps S210-step S220, steps S410-step S420, steps S710-step S730, steps S620-step S630, and step S240, wherein steps S710-step S730 are described in detail as follows:
[0121] Step S710: Calculate a linear expression corresponding to any trajectory segment according to the position information of the starting point and the ending point of any trajectory segment among the multiple trajectory segments.
[0122] Any trajectory segment contains a starting point and an end point. According to the position information of the starting point and the end point, the linear expression corresponding to any trajectory segment can be calculated. For example, suppose the linear expression corresponding to any trajectory segment is A 1· x+B 1· y+C1=0, then A1, B1, C1 can be calculated by the following formula:
[0123] -A1 / B1=(y1-y2) / (x1-x2)
[0124] -C1 / B1=(x 1· y2-x 2· y1) / (x1-x2)
[0125] C1=-A 1· x1-B 1· y1
[0126] Among them, (x1, y1) is the position information corresponding to the starting point of any trajectory segment, and (x2, y2) is the position information corresponding to the end point of any trajectory segment.
[0127] Optionally, since the value range of the trajectory segment is limited, after calculating the linear expression corresponding to any trajectory segment, the value range of the position information in the linear expression (i.e., the value range of x and y) can be limited, where if x1 is less than x2 and y1 is less than y2, then the value range of x can be [x1, x2] and the value range of y can be [y1, y2]; if x1 is greater than x2 and y1 is greater than y2, then the value range of x can be [x2, x1] and the value range of y can be [y2, y1].
[0128] Step S720 , comparing the linear expression corresponding to any trajectory segment with the linear expressions corresponding to the reference lines of the set starting points.
[0129] The linear expression corresponding to any track segment is compared with the linear expression corresponding to each set starting point's reference line, so as to determine whether there is an intersection between the linear expression corresponding to any track segment and the linear expression corresponding to each set starting point's reference line.
[0130] Among them, it is assumed that the linear expression corresponding to any trajectory segment is A 1· x+B 1· y+C1=0, the linear expression corresponding to the reference line of any set starting point is A 2· x+B 2·y+C2=0, then the position information of the intersection point between the two (x0, y0) can be calculated by the following formula:
[0131] x0=(B1·C2-B2·C1) / (B2·A1-B1·A2), y0=(A1·C2-A2·C1) / (B1·A2-B2·A1)
[0132] If there is an intersection between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of any set starting point, it is determined that there is an intersection between the trajectory segment and the reference line of the set starting point; if there is no intersection between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of any set starting point, it is determined that there is no intersection between the trajectory segment and the reference line of the set starting point.
[0133] Optionally, since the road to which the set starting point belongs does not extend infinitely, after calculating the intersection position information between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of any set starting point, it is possible to first determine whether the position information of the intersection belongs to the value range of the position information corresponding to the linear expression of the set starting point, and whether the position information of the intersection belongs to the value range of the position information corresponding to the linear expression of the trajectory segment; if so, it is determined that there is an intersection between the trajectory segment and the reference line of the set starting point; if not, it is determined that there is no intersection between the trajectory segment and the reference line of the set starting point. For example, assuming that the value range of the position information corresponding to the linear expression of a trajectory segment is x∈[1,5], y∈[2,10], and the value range of the position information corresponding to the linear expression of a reference line of a set starting point is x∈[3,5], y∈[6,10], if the intersection point between the linear expression of the trajectory segment and the linear expression of the reference line of the set starting point is (2,5), since x=2 does not belong to the value range of the position information corresponding to the linear expression of the reference line of the set starting point, there is no intersection between the trajectory segment and the reference line of the set starting point.
[0134] It should be noted that steps S710-S720 introduce a specific method for determining whether there is an intersection between a trajectory segment and a reference line corresponding to a set starting point, and a specific method for determining whether there is an intersection between a trajectory segment and a reference line corresponding to a set ending point corresponds to this method and will not be repeated here.
[0135] Step S730: if there is no intersection between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of each of the multiple set starting points, calculate the linear expression corresponding to the next trajectory segment in the multiple trajectory segments until the starting trajectory segment is found.
[0136] If there is no intersection between the linear expression corresponding to any trajectory segment in each motion trajectory and the linear expression corresponding to the reference line of each set starting point in multiple set starting points, then any trajectory segment is determined to be a non-starting trajectory segment. Therefore, the next trajectory segment can be extracted from the multiple trajectory segments of the motion trajectory, and the linear expression corresponding to the next trajectory segment can be calculated to find the starting trajectory segment in the motion trajectory; that is, after determining that any trajectory segment is not the starting trajectory segment, the process can return to step S710 to loop until the starting trajectory segment in the motion trajectory is found.
[0137] It should be noted that Figure 7 The specific implementation details of steps S210-S220 and step S240 shown in FIG. Figure 2 Steps S210 to S220, and step S240 are shown. Figure 7 The specific implementation details of steps S410 to S420 shown in FIG. Figure 4 Steps S410 to S420 are shown. Figure 7 The specific implementation details of steps S620 to S630 shown in FIG. Figure 6 Steps S620 to S630 shown are not repeated here.
[0138] exist Figure 7 In the illustrated embodiment, whether there is an intersection between the trajectory segment and the reference line of the set starting point is determined based on the linear expression corresponding to the trajectory segment and the linear expression corresponding to the reference line of the set starting point, thereby improving the accuracy of the determination.
[0139] In an exemplary embodiment, see Figure 8 , Figure 8 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0140] like Figure 8 As shown, the method includes steps S210-step S220, steps S410-step S420, steps S610-step S630, steps S810-step S830, and step S240, wherein steps S810-step S830 are described in detail as follows:
[0141] Step S810 , in the process of sequentially comparing the plurality of trajectory segments with the plurality of reference lines with set end points, if a starting trajectory segment is found, a starting time corresponding to the starting point of the starting trajectory segment is obtained.
[0142] The start time of a track segment refers to the time corresponding to the starting point of the track segment.
[0143] In the process of comparing the multiple trajectory segments with the reference lines of the multiple set end points in turn, the multiple trajectory segments are also compared with the reference lines of the multiple set starting points in turn to find the starting trajectory segment. In this process, if the starting trajectory segment is found first, the starting time corresponding to the start of the starting trajectory segment can be obtained.
[0144] Step S820: Filter out, from the plurality of trajectory segments, trajectory segments whose start time is later than the start time of the start trajectory segment.
[0145] Since the start time of the terminating trajectory segment is later than the start time of the starting trajectory segment, in order to improve the efficiency of finding the terminating trajectory segment, the trajectory segment whose start time is later than the start time of the starting trajectory segment can be screened out from multiple trajectory segments, so as to find the terminating trajectory segment from the trajectory segments whose start time is later than the start time of the starting trajectory segment.
[0146] Step S830 , sequentially comparing the selected trajectory segments with a plurality of reference lines with set end points until the end trajectory segment is found.
[0147] The trajectory segments whose start time is later than the start time of the start trajectory segment are sequentially compared with a plurality of reference lines with set end points to find out the end trajectory segment.
[0148] In another optional embodiment, in the process of comparing multiple trajectory segments with multiple reference lines of set ending points in sequence, and comparing multiple trajectory segments with multiple reference lines of set starting points in sequence, if the ending trajectory segment is found first, then trajectory segments whose starting time is earlier than the starting time of the ending trajectory segment can be screened out from the multiple trajectory segments, and the screened trajectory segments can be compared with the reference lines of the multiple set starting points in sequence until the starting trajectory segment is found.
[0149] It should be noted that Figure 8 The specific implementation details of steps S210-S220 and step S240 shown in FIG. Figure 2 Steps S210 to S220, and step S240 are shown. Figure 8 The specific implementation details of steps S410 to S420 shown in FIG. Figure 4 Steps S410 to S420 are shown. Figure 8 The specific implementation details of steps S610 to S630 shown in FIG. Figure 6 Steps S610 to S630 shown are not repeated here.
[0150] exist Figure 8 In the illustrated embodiment, if the starting trajectory segment of the motion trajectory is found first, the ending trajectory segment of the motion trajectory is found from the trajectory segments whose starting time is later than the starting time of the starting trajectory segment, thereby improving the search efficiency.
[0151] In an exemplary embodiment, see Fig. 9 , Fig. 9 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0152] like Fig. 9 As shown, the method includes steps S210-step S220, steps S410-step S420, steps S910-step S920, steps S620-step S630, and step S240, wherein steps S910-step S920 are described in detail as follows:
[0153] Step S910, obtaining a start time corresponding to a starting point of each of the plurality of trajectory segments.
[0154] The start time of a track segment refers to the time corresponding to the starting point of the track segment.
[0155] Step S920, comparing the plurality of trajectory segments with the reference lines of the plurality of set starting points in order of the corresponding starting times from front to back, until a termination trajectory segment having an intersection with the reference line of any of the plurality of set ending points is found.
[0156] In order to improve the efficiency of finding the starting trajectory segment, the multiple trajectory segments contained in each motion trajectory can be sorted in order from the start time to the end, and then the multiple trajectory segments are sequentially compared with the reference lines of multiple set starting points until the starting trajectory segment is found.
[0157] It should be noted that Fig. 9 The specific implementation details of steps S210-S220 and step S240 shown in FIG. Figure 2 Steps S210 to S220, and step S240 are shown. Fig. 9 The specific implementation details of steps S410 to S420 shown in FIG. Figure 4 Steps S410 to S420 are shown. Fig. 9 The specific implementation details of steps S620 to S630 shown in FIG. Figure 6Steps S620 to S630 shown are not repeated here.
[0158] exist Fig. 9 In the embodiment shown, multiple trajectory segments are compared with multiple set starting reference lines in order from front to back according to the corresponding starting time, until a terminal trajectory segment that has an intersection with the reference line of any set ending point among the multiple set ending points is found, which can improve the search efficiency.
[0159] In an exemplary embodiment, see Fig.10 , Fig.10 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0160] like Fig.10 As shown, the method includes step S210, step S1010-step S1030, step S410-step S420, step S610-step S630, and step S240, wherein the detailed description of step S1010-step S1030 is as follows:
[0161] Step S1010: periodically detect position information corresponding to a plurality of moving objects in a set area to obtain a position information sequence of each moving object.
[0162] The set area contains multiple moving objects. During the movement of each moving object, the position information of the moving object can be periodically detected to obtain a position information sequence of each moving object. The position information sequence includes multiple position information sorted according to the detection time, and the position information sequence can also include the identification information of the moving object corresponding to the motion trajectory, the time corresponding to each position information, etc.
[0163] The detection period can be flexibly set according to actual needs. For example, it can be set to detect once every 1 second, once every 2 seconds, once every 10 milliseconds, etc.
[0164] Step S1020: Generate a trajectory segment corresponding to each moving object according to adjacent position information in the position information sequence of each moving object.
[0165] After obtaining the position information sequence of each moving object, the trajectory segment corresponding to each moving object can be generated according to the adjacent position information, wherein two adjacent position information correspond to one trajectory segment, and the two adjacent position information can be connected by a straight line to form a trajectory segment, for example, see Fig.11As shown, after detecting multiple position information of a moving object, the first position information 1111 and the second position information 1112 can be connected by a straight line to obtain a first trajectory segment 1121, and the second position information 1112 and the third position information 1113 can be connected by a straight line to obtain a second trajectory segment 1122, and so on.
[0166] Step S1030: generating a motion trajectory corresponding to each moving object according to the trajectory segments corresponding to each moving object.
[0167] After obtaining the trajectory segments corresponding to each moving object, the trajectory segments corresponding to each moving object may be combined according to time, so as to obtain the motion trajectory corresponding to each moving object.
[0168] It should be noted that Fig.10 The specific implementation details of step S210 and step S240 shown in FIG. Figure 2 Step S210 and step S240 shown in FIG. Fig.10 The specific implementation details of steps S410 to S420 shown in FIG. Figure 4 Steps S410 to S420 are shown. Fig.10 The specific implementation details of steps S610 to S630 shown in FIG. Figure 6 Steps S610 to S630 shown are not repeated here.
[0169] exist Fig.10 In the illustrated embodiment, the position information corresponding to a plurality of moving objects in a set area is periodically detected to obtain a position information sequence of each moving object. Then, a trajectory segment corresponding to each moving object is generated based on adjacent position information in the position information sequence of each moving object. Then, a motion trajectory corresponding to each moving object is generated based on the trajectory segment corresponding to each moving object, thereby improving the accuracy of the motion trajectory.
[0170] In an exemplary embodiment, see Fig.12 , Fig.12 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0171] like Fig.12 As shown, the method includes steps S210 to S230, and steps S1210 to S1220, wherein steps S1210 to S1220 are described in detail as follows:
[0172] Step S1210, constructing a traffic volume data matrix according to a plurality of set starting points and a plurality of set ending points; the elements in the traffic volume data matrix represent the traffic volume.
[0173] The traffic data can be expressed in the form of a matrix. Therefore, a traffic data matrix can be constructed first, wherein the initial value of the elements in the traffic data matrix is 0, and the traffic data matrix contains multiple set starting points and multiple set ending points, and the traffic between each set starting point and set ending point.
[0174] In an optional implementation, in order to reduce the amount of data in the traffic data matrix, a traffic data matrix is created with each set starting point as a row and each set ending point as a column. That is, assuming that there are N1 set starting points and N2 set ending points, a traffic data matrix of size N1*N2 is created (i.e., the number of rows in the matrix is N1 and the number of columns is N2), each row represents a set starting point, each column represents a set ending point, and each element represents the traffic between the set starting point corresponding to the row and the set ending point corresponding to the column (i.e., the element a in the i-th row and j-th column in the matrix is ij Characterizes the traffic volume from the i-th set starting point to the j-th set ending point).
[0175] Optionally, a traffic volume data matrix can be created with each set starting point as a column and each set ending point as a row. That is, assuming that there are N1 set starting points and N2 set ending points, a traffic volume data matrix of size N2*N1 is created, and the element a in the i-th row and j-th column of the matrix is ij The specific creation method of representing the traffic volume from the j-th set starting point to the i-th set ending point is similar to the above and will not be repeated here.
[0176] In another optional embodiment, a throughput data matrix is created with each of the multiple set starting points and the multiple set ending points as a row and each set point as a column, thereby obtaining a square matrix, wherein the row represents the starting point and the column represents the ending point; that is, assuming that there are N1 set starting points and N2 set ending points, a throughput data matrix of size (N1+N2)*(N1+N2) is created, wherein each row represents a set point and each column represents a set point, and the element a in the i-th row and j-th column of the matrix is ij Characterizes the flow from the i-th set point to the j-th set point.
[0177] Optionally, in the throughput data matrix created with each set point as a row and each set point as a column, the rows can also represent the end point and the columns can represent the starting point. Correspondingly, the element a in the i-th row and j-th column of the matrix is ij Characterizes the flow from the jth set point to the i-th set point.
[0178] Step S1220, updating the values of the elements included in the traffic volume data matrix according to the set starting points and the set ending points respectively corresponding to the plurality of motion trajectories.
[0179] After obtaining the set starting point and the set ending point corresponding to each motion trajectory, the values of the elements included in the traffic volume data matrix can be updated according to the set starting point and the set ending point corresponding to each motion trajectory.
[0180] It should be noted that Fig.12 The specific implementation details of steps S210 to S230 shown in FIG. Figure 2 Steps S210 to S230 shown are not repeated here.
[0181] exist Fig.12 In the illustrated embodiment, the traffic data is in the form of a matrix, thereby improving the readability and intuitiveness of the traffic data, and performing related processing based on the traffic data in the matrix form can also improve processing efficiency.
[0182] In an exemplary embodiment, see Fig.13 , Fig.13 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0183] like Fig.13 As shown, the method includes steps S210 to S230, and steps S1310 to S1320, wherein steps S1310 to S1320 are described in detail as follows:
[0184] Step S1310, obtaining the entry time of each motion trajectory into the corresponding set starting point, and searching for a calculation cycle matching the entry time of each motion trajectory from multiple calculation cycles.
[0185] The entry time of a motion trajectory refers to the time when the moving object of the motion trajectory enters the corresponding set starting point, that is, the time corresponding to the intersection between each motion trajectory and the reference line of the set starting point.
[0186] In order to calculate the traffic volume corresponding to each set of set starting points and set ending points in different calculation cycles, the entry time of each motion track can be obtained, so as to find the calculation cycle to which each motion track belongs from multiple calculation cycles according to the entry time. The time interval corresponding to the calculation cycle can be set according to actual needs, for example, the time interval can be 1 minute, 1 hour, 1 week, etc.
[0187] Among them, the specific method of obtaining the entry time corresponding to each motion trajectory can be flexibly set according to actual needs. In an optional implementation, under the condition that each motion trajectory contains multiple trajectory segments, the intersection between each motion trajectory and the reference line of the corresponding set starting point refers to the intersection between the starting trajectory segment of the motion trajectory and the reference line of the corresponding set starting point. The distance between the intersection and the starting point and the terminal of the starting trajectory segment is relatively close. Therefore, the time corresponding to the starting point of the starting trajectory segment or the time corresponding to the terminal of the starting trajectory segment can be used as the time of the intersection (that is, the entry time corresponding to the motion trajectory); or, the point with the smallest distance from the intersection can be found from the starting point and the terminal of the starting trajectory segment, and the time corresponding to the found point can be used as the entry time corresponding to the motion trajectory.
[0188] Optionally, after determining the set starting point, set ending point and entry time corresponding to each motion track, the identification information of the moving object corresponding to each motion track, the set starting point, set ending point and entry time can be stored in association. For example, in one example, the storage can be performed in the following manner:
[0189] Movement trajectory 1: orig = 0, dest = 5, t0 = 8:00:05
[0190] Movement trajectory 2: orig = 1, dest = 6, t0 = 8:00:15
[0191] Among them, motion trajectory 1 and motion trajectory 2 are identification information, orig is the set starting point corresponding to the motion trajectory, dest is the set ending point corresponding to the motion trajectory, t0 is the entry time, orig=0 indicates that the set starting point corresponding to motion trajectory 1 is the 0th set point, and dest=5 indicates that the set ending point corresponding to motion trajectory 1 is the 5th set point.
[0192] Step S1320, calculating the traffic volume data corresponding to each calculation cycle in a plurality of calculation cycles according to the set starting points, the set ending points and the calculation cycles respectively corresponding to the plurality of motion trajectories.
[0193] After obtaining the set starting point, set ending point and calculation cycle corresponding to each motion trajectory, the traffic volume data corresponding to each calculation cycle can be calculated, wherein the traffic volume data corresponding to each calculation cycle includes the traffic volume corresponding to each group of set starting points and set ending points within the calculation cycle.
[0194] Optionally, the traffic volume data can be in the form of a matrix. Correspondingly, a traffic volume data matrix corresponding to each calculation cycle can be created according to each set starting point and set ending point, so as to find the corresponding traffic volume data matrix according to the calculation cycle corresponding to each motion trajectory, and then update the values of the elements in the found traffic volume data matrix according to the set starting point and set ending point corresponding to the motion trajectory. The specific method of creating the traffic volume data matrix can be found in the above example and will not be repeated here.
[0195] In an optional implementation, under the condition that the traffic data is embodied in the form of a matrix, a traffic data matrix corresponding to each calculation cycle can be created in advance to obtain multiple traffic data matrices, and then the values of the elements contained in each traffic data matrix are updated according to the following code:
[0196] While (There are motion trajectories among multiple motion trajectories that have not been processed by the following process) do Select a motion trajectory that has not been processed by the following process
[0197] {
[0198] While (there are traffic data matrices that have not been matched with the selected motion trajectory in multiple traffic data matrices) do Get a traffic data matrix that has not been matched
[0199] {
[0200] If (the t0 of the selected motion trajectory matches the calculation period corresponding to the acquired traffic data matrix) / / The entry time of the selected motion trajectory is within the calculation period corresponding to the traffic data matrix
[0201] {
[0202] i=orig; / / The row i corresponding to the selected motion trajectory is the set starting point of the motion trajectory
[0203] j = dest; / / The column j corresponding to the selected motion trajectory is the set end point of the motion trajectory
[0204] a ij =a ij +1; / / Find the element a corresponding to the selected motion trajectory from the acquired traffic data matrix ij , add 1 to its value
[0205] }
[0206] }
[0207] }
[0208] It should be noted that Fig.13 The specific implementation details of steps S210 to S230 shown in FIG. Figure 2 Steps S210 to S230 shown are not repeated here.
[0209] exist Fig.13 In the illustrated embodiment, traffic volume data corresponding to different calculation cycles may be calculated, thereby improving the diversity of traffic volume data.
[0210] In an exemplary embodiment, see Fig.14 , Fig.14 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0211] like Fig.14 As shown, under the condition that each motion trajectory contains multiple trajectory segments, the method includes steps S210 to S230, steps S1410 to S1450, and step S1320, wherein steps S1410 to S1450 are described in detail as follows:
[0212] Step S1410, obtaining the intersection point between each motion trajectory and the reference line of the set starting point corresponding to each running trajectory, and the starting trajectory segment to which the intersection point belongs.
[0213] The specific method for determining the intersection between each motion trajectory and the corresponding reference line of the set starting point, as well as the specific schematic diagram of the starting trajectory segment have been described in detail in the above embodiments and will not be repeated here.
[0214] Step S1420, calculating the distance between the starting point and the end point of the starting trajectory segment, and the distance between the starting point and the intersection point.
[0215] It should be understood that the intersection between each motion trajectory and the reference line corresponding to the set starting point refers to the intersection between the starting trajectory segment and the reference line corresponding to the set starting point, and the time corresponding to the intersection is related to the distance between the intersection and the starting point of the starting trajectory segment. Therefore, the distance between the starting point and the end point of the starting trajectory segment, as well as the distance between the starting point and the intersection, can be calculated, and the time of the intersection can be inferred from the calculated distance.
[0216] The distance between the starting point and the end point of the starting trajectory segment can be calculated based on the location information of the starting point and the end point; the distance between the starting point and the intersection point can be calculated based on the location information of the starting point and the location information of the intersection point. Fig.15 As shown, the starting trajectory segment 1501 is a straight line segment. Assume that the position information of the starting point of the starting trajectory segment is (x m1,y m1 ), the location information of the end point is (x m2 ,y m2 ), the position information of the intersection 1502 is (x m0 ,y m0 ), then the distance D between the starting point and the end point 12 , the distance D between the intersection and the starting point 01 It can be calculated by the following formula, where m represents the starting trajectory segment:
[0217] D 12 =√[(x m1 -x m2 )^2+(y m1 -y m2 )^2]
[0218] D 01 =√[(x m1 -x m0 )^2+(y m1 -y m0 )^2]
[0219] In an optional embodiment, in order to reduce the amount of calculation, before step S1420, it is also possible to determine whether the intersection point coincides with the starting point or the end point of the starting trajectory segment. If so, the time corresponding to the coincident point is used as the time of the intersection; if not, step S1420 can be executed.
[0220] Step S1430, calculating the time corresponding to the intersection point according to the distance between the starting point and the end point, the distance between the starting point and the intersection point, and the time corresponding to the starting point and the end point respectively.
[0221] Optionally, the speed of the moving object in the starting trajectory segment can be calculated based on the distance between the starting point and the end point of the starting trajectory segment, and the time difference between the time of the starting point and the time of the end point; the time duration of the moving object from the starting point to the intersection point can be calculated based on the speed and the distance between the starting point and the intersection point, and then the time of the intersection point can be calculated based on the time duration and the time corresponding to the starting point. In an example, see Fig.15 As shown, assuming that the time corresponding to the starting point of the starting trajectory segment is t m1 , the time corresponding to the end point of the starting trajectory segment is t m2 , the time t0 corresponding to the intersection 1502 can be calculated by the following formula:
[0222] t0=t1+D 01 / D 12 ·(t m2 -t m1 )
[0223] Step S1440: taking the time corresponding to the intersection as the entry time corresponding to each motion trajectory.
[0224] The time corresponding to the intersection of each motion trajectory and the reference line of the set starting point can be used as the entry time corresponding to the motion trajectory.
[0225] Step S1450, searching for a calculation cycle that matches the entry time of each motion trajectory from multiple calculation cycles.
[0226] After obtaining the entry time corresponding to each motion trajectory, the calculation cycle matching the entry time of the motion trajectory can be found, so as to facilitate calculation of the corresponding traffic volume data according to the calculation cycle.
[0227] It should be noted that Fig.14 The specific implementation details of steps S210 to S230 shown in FIG. Figure 2 Steps S210 to S230 are shown. Fig.14 The specific implementation details of step S1320 shown in FIG. Fig.13 The step S1320 shown is not repeated here.
[0228] exist Fig.14 In the embodiment shown, the time corresponding to the intersection is calculated based on the distance between the starting point and the end point of the starting trajectory segment, the distance between the starting point and the intersection point (the intersection point between the starting trajectory segment and the reference line corresponding to the set starting point), and the time corresponding to the starting point and the end point respectively, so that the data corresponding to the intersection point is used as the entry time of the motion trajectory, thereby improving the accuracy of the entry time.
[0229] In an exemplary embodiment, see Fig.16 , Fig.16 is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0230] like Fig.16 As shown, the method includes steps S210 to S230, steps S1310 to S1320, and steps S1610 to S1620, wherein steps S1610 to S1620 are described in detail as follows:
[0231] Step S1610, obtaining a set time interval, and searching for multiple target computing cycles matching the set time interval from multiple computing cycles.
[0232] The set time interval refers to the time period for which the corresponding traffic volume data needs to be counted. The specific value can be flexibly set according to actual needs. In order to ensure that the corresponding traffic volume data can be obtained, the time interval of the set time interval is greater than the time interval corresponding to each calculation cycle.
[0233] After the traffic volume data corresponding to the multiple calculation cycles are calculated, in order to obtain the traffic volume data corresponding to the set time interval, multiple target calculation cycles belonging to the set time interval may be searched from the multiple calculation cycles.
[0234] Step S1620, obtaining the traffic volume data corresponding to the multiple target calculation cycles respectively, and fusing the obtained traffic volume data to obtain the traffic volume data corresponding to the set time interval.
[0235] By fusing the traffic volume data corresponding to multiple target calculation cycles, the traffic volume data corresponding to the set time interval can be obtained. For example, in one example, assuming that the specified time period is 8:00-9:00, with 1 minute as the calculation cycle, the traffic volume data is in the form of a matrix, the total number of set starting points and set ending points is 7, and the traffic volume data matrix is a matrix of size 7*7, each row represents a set point in the set starting point and set ending point, each column represents a set point, and the element aij in the traffic volume data matrix represents the traffic volume from the i-th set point to the j-th set point. If the calculation cycle T = 8:00-8:01 corresponds to The traffic volume data is shown in Table 1 below, which indicates that within one minute from 8:00 to 8:01, 25 moving objects go from the first set point (the first row of the matrix) to the third set point (the third column), 5 moving objects go to the fifth set point (the fifth column), 10 moving objects go to the sixth set point (the sixth column), and 40 moving objects go to the seventh set point (the seventh column); if the traffic volume data corresponding to the calculation period T = 8:01-8:02 can be shown in Table 2 below, it indicates that at 8:01 -8:02 In this minute, from the first set point (the first row of the matrix), 21 moving objects go to the third set point (the third column), 3 moving objects go to the fifth set point (the fifth column), 11 moving objects go to the sixth set point (the sixth column), 42 moving objects go to the seventh set point (the seventh column), and so on, to obtain the corresponding traffic volume data matrix for each minute from 8:00 to 9:00; for the calculation period T = 8:00-8:01 and the calculation period T = 8:01-8 By fusing the traffic volume data corresponding to 8:00-8:02, we can obtain the traffic volume data corresponding to the set time interval T=8:00-8:02 as shown in Table 3 below, which indicates that within the two minutes from 8:00 to 8:02, 46 moving objects go from the first set point (the first row of the matrix) to the third set point (the third column), 3 moving objects go to the eighth set point (the fifth column), 11 moving objects go to the 21st set point (the sixth column), and 82 moving objects go to the seventh set point (the seventh column).
[0236] 0 0 25 0 5 10 40 0 0 1 0 1 1 5 0 0 0 0 0 0 0 0 0 0 0 2 2 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0237] Table 1
[0238] 0 0 21 0 3 11 42 0 0 2 0 1 3 6 0 0 0 0 0 0 0 0 0 0 0 1 2 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0239] Table 2
[0240] 0 0 46 0 8 21 82 0 0 3 0 2 4 11 0 0 0 0 0 0 0 0 0 0 0 3 4 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0241] Table 3
[0242] In an optional embodiment, in step S220, multiple motion trajectories of moving objects in a set area within a specified time period can be obtained, so that in step S1320, the traffic data corresponding to each calculation cycle within the specified time period can be calculated; wherein, the specified time period can be flexibly set according to actual needs. For example, assuming that the traffic data is in the form of a matrix and the calculation cycle is 1 minute, if the specified time period is 8:00-9:00, it is necessary to create 60 traffic data matrices to record the traffic data corresponding to each minute from 8:00 to 9:00; if the specified time period is 1 day, 1440 minutes are in 1 day, therefore, it is necessary to create 1440 traffic data matrices to record the traffic data corresponding to each minute within 1 day.
[0243] Among them, the specific method of obtaining multiple motion trajectories of moving objects in a set area within a specified time period includes but is not limited to at least one of the following methods: the first method is to obtain multiple motion trajectories in the set area and whose entry time belongs to the specified time period; the second method is to obtain multiple motion trajectories in the set area and whose departure time belongs to the specified time period, wherein the departure time of the motion trajectory refers to the time when the motion trajectory moves to its corresponding set end point, that is, the time corresponding to the intersection between the motion trajectory and the corresponding set end line, and the calculation method of the departure time of the motion trajectory is similar to the calculation method of the entry time of the motion trajectory, which will not be repeated here; the third method is to obtain multiple motion trajectories in the set area and whose entry time and departure time both belong to the specified time period.
[0244] Optionally, the number of designated time periods may be multiple, and in step S1320, the traffic volume data corresponding to each calculation cycle in each designated time period may be calculated. Under this condition, in order to improve the accuracy of the traffic volume data corresponding to the set time interval, multiple target time periods may be selected from multiple designated time periods, and multiple target calculation cycles matching the set time interval may be obtained from multiple calculation cycles included in each target time period, and the traffic volume data corresponding to multiple target calculation cycles in each target time period may be fused to obtain the traffic volume data of the set time interval in each target time period, and then, based on the traffic volume data corresponding to the set time interval in multiple target time periods, the average traffic volume data of the set time interval in multiple target time periods may be calculated, thereby improving the reliability and accuracy of the traffic volume data. For example, assuming that the specified time period is every day in June and the calculation cycle is hours, in order to obtain the average traffic data for the Monday evening peak time period (17:00-19:00) in June, the traffic data corresponding to 17:00-18:00 and 18:00-19:00 of each Monday in June can be obtained, and the traffic data corresponding to 17:00-18:00 and 18:00-19:00 of each Monday can be merged to obtain the traffic data for the evening peak time period of each Monday, and then the traffic data for the evening peak time period of multiple Mondays in June are averaged to obtain the average traffic data for the Monday evening peak time period in June.
[0245] Among them, in order to facilitate searching, the traffic data corresponding to each calculation cycle in multiple specified time periods can be classified and stored. For example, the traffic data corresponding to each calculation cycle in multiple specified time periods can be classified and stored according to year, month, day, time period, etc.
[0246] It should be noted that Fig.16 The specific implementation details of steps S210 to S230 shown in FIG. Figure 2 Steps S210 to S230 are shown. Fig.16 The specific implementation details of steps S1310 to S1320 shown in FIG. Fig.13 Steps S1310 to S1320 shown are not repeated here.
[0247] exist Fig.16 In the illustrated embodiment, the traffic data corresponding to each of the plurality of calculation cycles can be fused to obtain the traffic data corresponding to any set time interval, thereby improving the diversity of the traffic data.
[0248] In an exemplary embodiment, see Fig.17 , Fig.17is a flow chart of a method for detecting traffic volume data shown in another exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown, which can be Figure 1 The traffic data detection device 110 in the illustrated implementation environment is executed.
[0249] like Fig.17 As shown, the method includes steps S210 to S230, and steps S1710 to S1720, wherein steps S1710 to S1720 are described in detail as follows:
[0250] Step S1710: acquiring the moving object corresponding to each moving trajectory, and searching for an object type matching the moving object corresponding to each moving trajectory from multiple object types.
[0251] The types of moving objects include but are not limited to trucks, cars, buses, etc. In order to count the traffic data corresponding to different object types, for example, counting the traffic of trucks between different locations, counting the traffic of cars between different locations, multiple object types can be pre-set, and then the object type to which the moving object of each motion trajectory belongs can be determined.
[0252] Step S1720, calculating the traffic volume data corresponding to each of the multiple object types according to the set starting points, the set ending points and the object types respectively corresponding to the multiple motion trajectories.
[0253] After obtaining the set starting point, the set ending point and the object type corresponding to each motion trajectory, the traffic data corresponding to each object type can be calculated, wherein the traffic data corresponding to each object type includes the traffic volume of the moving objects corresponding to the object type between each set starting point and the set ending point. For example, the traffic data corresponding to trucks includes the traffic volume of trucks between each set starting point and the set ending point, and the traffic data corresponding to buses includes the traffic volume of buses between each set starting point and the set ending point.
[0254] Optionally, the traffic data matrix can be in the form of a matrix. Correspondingly, a traffic data matrix corresponding to each object type can be created according to each set starting point and set ending point, so as to find the corresponding traffic data matrix according to the object type corresponding to each motion trajectory, and then update the values of the elements in the found traffic data matrix according to the set starting point and set ending point corresponding to the motion trajectory. The specific method of creating the traffic data matrix can be found in the above example and will not be repeated here.
[0255] In an optional embodiment, the traffic volume data can also be calculated in combination with the calculation cycle and the object type. For example, the set starting point, the set end point, the calculation cycle and the object type can be respectively corresponding to multiple motion trajectories, and the traffic volume data of each object type in each calculation cycle can be calculated. For example, the traffic volume data of trucks in calculation cycle 1, the traffic volume data of trucks in calculation cycle 2, the traffic volume data of buses in calculation cycle 1, and the traffic volume data of buses in calculation cycle 2 are calculated.
[0256] It should be noted that Fig.17 The specific implementation details of steps S210 to S230 shown in FIG. Figure 2 Steps S210 to S230 shown are not repeated here.
[0257] exist Fig.17 In the illustrated embodiment, traffic data corresponding to different object types can be calculated, thereby improving the diversity of traffic data.
[0258] In an exemplary embodiment, the traffic data detection method may include a motion trajectory preprocessing process and a traffic data calculation process. Fig.18 As shown, the motion trajectory preprocessing process includes steps S1801 to S1816, which are described in detail as follows:
[0259] Step S1801, obtaining a plurality of set starting points and a plurality of set ending points from a set area, and calculating a linear expression of a reference line corresponding to each set point.
[0260] Optionally, the user may set a set area in the map data, and select a set starting point and multiple set ending points from the set area.
[0261] The specific method of calculating the linear expression of the reference line corresponding to the set point can be found in the above record and will not be repeated here.
[0262] Step S1802, obtaining multiple motion trajectories from a set area, and creating a data field corresponding to each motion trajectory; the data field corresponding to each motion trajectory includes an orig field, a dest field, and a t0 field.
[0263] The orig field is used to record the set starting point corresponding to the motion trajectory, the dest field is used to record the set ending point corresponding to the motion trajectory, and the t0 field is used to record the entry time of the motion trajectory.
[0264] Step S1803, determine whether there is a motion trajectory that has not been preprocessed among the multiple motion trajectories; if so, go to step S1804; if not, go to step S1816.
[0265] The motion trajectory that has not been preprocessed refers to a motion trajectory for which the corresponding set starting point and set ending point have not been found.
[0266] Step S1804, select a motion trajectory that has not been preprocessed, and assign Flag_O=0; Flag_D=0.
[0267] The initial values of Flag_O and Flag_D corresponding to the selected motion trajectory are both assigned to 0, wherein Flag_O=0 indicates that the set starting point corresponding to the motion trajectory has not been found, and Flag_D=0 indicates that the set ending point corresponding to the motion trajectory has not been found.
[0268] Step S1805 , determining whether there are unprocessed trajectory segments in the selected motion trajectory; if so, proceeding to step S1806 ; if not, proceeding to step S1803 .
[0269] Each motion trajectory includes a plurality of trajectory segments, and the unpreprocessed trajectory segments refer to trajectory segments for which the corresponding set starting points and set ending points have not been found.
[0270] Step S1806: extract a trajectory segment that has not been preprocessed from the selected motion trajectory, and assign Flag_1=0.
[0271] The initial value of Flag_1 corresponding to the extracted trajectory segment is assigned to 0. Flag_1=0 indicates that there is no intersection between the trajectory segment and the reference line segment corresponding to the set starting point, that is, the set starting point corresponding to the trajectory segment is not found.
[0272] Step S1807, determine if Flag_O=0, and there are set starting points among the multiple set starting points that have not been compared with the extracted trajectory segment. If Flag_O=0, and there are set starting points among the multiple set starting points that have not been compared with the extracted trajectory segment, go to step S1808; if Flag_O=1, or there are no set starting points among the multiple set starting points that have not been compared with the extracted trajectory segment, go to step S1811.
[0273] Step S1808, obtaining a set starting point from the plurality of set starting points that is not compared with the extracted trajectory segment.
[0274] Step S1809, determining whether there is an intersection between the extracted trajectory segment and the reference line segment corresponding to the set starting point; if so, proceed to step S1810, if not, proceed to step S1807.
[0275] The extracted trajectory segment is compared with the reference line segment corresponding to the acquired set starting point to determine whether there is an intersection between the two. The specific comparison method can be found in the description of the above embodiment and will not be repeated here.
[0276] Step S1810, assign a value to the orig field of the selected motion trajectory according to the acquired set starting point, assign Flag_O=1, Flag_1=1, calculate the entry time corresponding to the selected motion trajectory, and assign a value to the t0 field of the selected motion trajectory.
[0277] If there is an intersection between the trajectory segment extracted from the selected motion trajectory and the reference line corresponding to the obtained set starting point, it indicates that the set starting point is the set starting point corresponding to the motion trajectory. Therefore, the entry time of the motion trajectory can be calculated based on the intersection and the starting and ending points of the trajectory segment. Then, the orig field of the motion trajectory is assigned according to the set starting point, and the t0 field of the motion trajectory is assigned according to the entry time, and Flag_O=1 and Flag_1=1 are assigned (indicating that the set starting point corresponding to the motion trajectory is found, and the set starting point corresponding to the trajectory segment is found).
[0278] Step S1811, determine if Flag_1=0, Flag_D=0, and there are set end points in the multiple set end points that have not been compared with the extracted trajectory segment; if Flag_1=0, Flag_D=0, and there are set end points in the multiple set end points that have not been compared with the extracted trajectory segment, then go to step S1812; if Flag_1=1, Flag_D=1, or there are no set end points in the multiple set end points that have not been compared with the extracted trajectory segment, then go to step S1815.
[0279] If Flag_1=1, it indicates that the set start point corresponding to the extracted trajectory segment has been found. Since the set start point and the set end point are not on the same trajectory segment, the following process of finding the set end point will not be entered for this trajectory segment. If Flag_D is 1, it indicates that the set end point corresponding to the selected motion trajectory has been found, so the following process of finding the set end point will not be entered.
[0280] Step S1812, obtaining a set end point from the plurality of set end points that is not compared with the extracted trajectory segment.
[0281] Step S1813, determining whether there is an intersection between the extracted trajectory segment and the reference line segment corresponding to the set end point; if so, proceed to step S1814, if not, proceed to step S1811.
[0282] Step S1814: assign a value to the dest field of the selected motion trajectory according to the acquired set end point, and assign Flag_D=1.
[0283] Step S1815, determine whether the sum of Flag_O and Flag_D is 2, if so, go to step S1803; if not, go to step S1805.
[0284] If Flag_O+Flag_D=2, it indicates that the set starting point and the set ending point corresponding to the selected motion trajectory are found, and the preprocessing of the motion trajectory is completed. Therefore, the process goes to step S1803 to preprocess the next motion trajectory to find the set starting point and the set ending point corresponding to the next motion trajectory.
[0285] Step S1816: Preprocessing of multiple motion trajectories is completed.
[0286] After the preprocessing of multiple motion trajectories is completed, the set starting point, set ending point and entry time corresponding to each motion trajectory can be obtained.
[0287] Optionally, in an example, the aforementioned preprocessing process can be implemented by the following code:
[0288] While (there are unprocessed motion trajectories among multiple motion trajectories) do Select a motion trajectory that has not been preprocessed
[0289] {
[0290] Flag_O=0; Flag_D=0; / / Assign the initial values of Flag_O and Flag_D to 0. Flag_O=0 indicates that the set starting point corresponding to the motion trajectory has not been found, and Flag_D=0 indicates that the set ending point corresponding to the motion trajectory has not been found.
[0291] While (there are unprocessed trajectory segments in the selected motion trajectory) do extract an unprocessed trajectory segment
[0292] {
[0293] Flag_1 = 0; / / Assign the initial value of Flag_1 to 0. Flag_1 = 0 indicates that the set starting point corresponding to the trajectory segment has not been found.
[0294] If (Flag_O==0) / / If the set starting point corresponding to the selected motion trajectory has not been found, the subsequent process will be executed
[0295] {
[0296] While (there are set starting points among multiple set starting points that are not compared with the extracted trajectory segment) do Get a set starting point that is not compared with the extracted trajectory segment
[0297] {
[0298] If (there is an intersection between the extracted trajectory segment and the reference line segment corresponding to the set starting point obtained)
[0299] {
[0300] orig=the set starting point obtained; / / assign the orig field of the selected motion trajectory according to the set starting point obtained
[0301] Calculate t0 and assign the corresponding value;
[0302] Flag_O=1; / / Find the set starting point corresponding to the selected motion trajectory, and therefore assign the value of Flag_O corresponding to the motion trajectory to 1.
[0303] Flag_1 = 1; / / Find the set starting point corresponding to the extracted motion trajectory, so assign the Flag_1 corresponding to the trajectory segment to 1
[0304] Exit;
[0305] }
[0306] }
[0307] }
[0308] If((Flag_1==0)&&(Flag_D==0))
[0309] {
[0310] While(There is a set end point among multiple set end points that has not been compared with the extracted trajectory segment)doGet a set end point that has not been compared with the extracted trajectory segment
[0311] {
[0312] If (there is an intersection between the extracted trajectory segment and the reference line segment corresponding to the set end point obtained)
[0313] {
[0314] dest = the set end point obtained; / / assign a value to the dest field of the selected motion trajectory according to the set end point obtained
[0315] Flag_D = 1; / / indicates that the set end point corresponding to the selected motion trajectory has been found
[0316] Exit;
[0317] }
[0318] }
[0319] }
[0320] }
[0321] If (Flag_O+Flag_D==2) / / The set end point and the set end point corresponding to the selected motion trajectory are found, then the (Flag_O and Flag_D corresponding to the selected motion trajectory are both 1, and the sum of the two is 2.
[0322] Exit;
[0323] }
[0324] After the preprocessing of multiple motion trajectories is completed, the traffic data calculation process can be executed, where see Fig.19 As shown, the traffic volume data calculation process includes steps S1901 to S1908, which are described in detail as follows:
[0325] Step S1901, it is detected that the preprocessing of multiple motion trajectories is completed.
[0326] Step S1902, determine whether there is a motion trajectory among the multiple motion trajectories that has not been processed by the following process, if so, go to step S1903; if not, go to step S1908.
[0327] Step S1903, selecting a motion trajectory that has not been processed by the following process from the multiple motion trajectories.
[0328] Step S1904, determining whether there is a traffic data matrix among the plurality of traffic data matrices that has not been matched with the selected motion trajectory. If so, proceed to step S1905, if not, proceed to step S1902.
[0329] Among them, the traffic data matrix that has not matched the selected motion trajectory means that the entry time of the selected motion trajectory has not been compared with the calculation period corresponding to the traffic data matrix to determine whether the entry time of the selected motion trajectory matches the calculation period corresponding to the traffic data matrix.
[0330] Step S1905, obtaining an unmatched traffic data matrix from multiple traffic data matrices.
[0331] Step S1906, determine whether the entry time of the selected motion trajectory matches the calculation period of the acquired traffic volume data matrix. If yes, go to step S1907; if not, go to step S1904.
[0332] Step S1907, determining the row according to the set starting point of the selected motion trajectory, determining the column according to the set ending point of the selected motion trajectory, and adding 1 to the values of the elements in the corresponding rows and columns in the acquired traffic data matrix.
[0333] Where i = orig of the selected motion trajectory, j = dest of the selected motion trajectory, and find element a from the acquired traffic data matrix ij , and set a ij =a ij +1.
[0334] Step S1908, the traffic data update is completed.
[0335] It should be noted that Fig.18 The specific process of steps S1801 to S1816 shown in FIG. Fig.19 The specific process of steps S1901 to S1908 shown has been described in detail in the above embodiments and will not be repeated here.
[0336] See also Fig. 20 , Fig. 20 FIG. 1 is a block diagram of a traffic volume data detection device shown in an exemplary embodiment of the present application. Fig. 20 As shown, the device comprises:
[0337] An acquisition module 2001 is configured to acquire a plurality of set starting points and a plurality of set ending points from a set area respectively;
[0338] A detection module 2002 is configured to obtain multiple motion trajectories of a moving object in a set area;
[0339] A search module 2003 is configured to search for a set starting point and a set ending point corresponding to each motion track from a plurality of set starting points and a plurality of set ending points;
[0340] The calculation module 2004 is configured to calculate the traffic volume data in the set area according to the set starting points and the set ending points corresponding to the multiple motion trajectories respectively; wherein the traffic volume data includes the traffic volume corresponding to each group of set starting points and set ending points among the multiple set starting points and the multiple set ending points.
[0341] In an optional embodiment, based on the aforementioned example, the search module 2003 is configured to: obtain the position information of each of the multiple set starting points and the multiple set ending points, and search for the road reference line information of the road to which each set point belongs from the map data according to the position information of each set point; calculate the reference line of each set point according to the position information of each set point and the road reference line information of the road to which it belongs; search for the set starting point from the multiple set starting points where the corresponding reference line has an intersection with each motion trajectory, and search for the set ending point from the multiple set ending points where the corresponding reference line has an intersection with each motion trajectory.
[0342] In an optional embodiment, based on the aforementioned example, under the condition that each motion trajectory includes multiple trajectory segments, the search module 2003 is configured to: compare the multiple trajectory segments with the reference lines of multiple set starting points in turn, until a starting trajectory segment that has an intersection with the reference line of any set starting point among the multiple set starting points is found; compare the multiple trajectory segments with the reference lines of multiple set ending points in turn, until a terminating trajectory segment that has an intersection with the reference line of any set ending point among the multiple set ending points is found; obtain the set starting point at which the corresponding reference line has an intersection with the starting trajectory segment, and the set ending point at which the corresponding reference line has an intersection with the terminating trajectory segment.
[0343] In an optional embodiment, based on the aforementioned example, the search module 2003 is configured to: calculate a linear expression corresponding to any trajectory segment according to the position information of the starting point and the end point of any trajectory segment in the multiple trajectory segments; compare the linear expression corresponding to any trajectory segment with the linear expressions corresponding to the reference lines of the multiple set starting points respectively; if there is no intersection between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of each of the multiple set starting points, calculate the linear expression corresponding to the next trajectory segment in the multiple trajectory segments until the starting trajectory segment is found.
[0344] In an optional embodiment, based on the aforementioned example, the search module is further configured to: in the process of comparing the multiple trajectory segments with the reference lines of the multiple set end points in turn, if the starting trajectory segment is found, then obtain the starting time corresponding to the starting point of the starting trajectory segment; from the multiple trajectory segments, filter out the trajectory segments whose starting time is later than the starting time of the starting trajectory segment; and compare the filtered trajectory segments with the reference lines of the multiple set end points in turn until the ending trajectory segment is found.
[0345] In an optional embodiment, based on the aforementioned example, the search module 2003 is further configured to: obtain the starting time corresponding to the starting point of each trajectory segment in the multiple trajectory segments; and compare the multiple trajectory segments with the reference lines of the multiple set starting points in order from the corresponding starting times, until a terminal trajectory segment that has an intersection with the reference line of any of the multiple set ending points is found.
[0346] In an optional embodiment, based on the aforementioned example, the detection module 2002 is configured to: periodically detect the position information corresponding to multiple moving objects in a set area to obtain a position information sequence for each moving object; generate a trajectory segment corresponding to each moving object based on adjacent position information in the position information sequence of each moving object; and generate a motion trajectory corresponding to each moving object based on the trajectory segment corresponding to each moving object.
[0347] In an optional embodiment, based on the aforementioned example, the calculation module 2004 is configured to: obtain the entry time of each motion trajectory into the corresponding set starting point, and search for a calculation cycle that matches the entry time of each motion trajectory from multiple calculation cycles; calculate the traffic volume data corresponding to each calculation cycle in the multiple calculation cycles according to the set starting points, set ending points and calculation cycles corresponding to the multiple motion trajectories.
[0348] In an optional embodiment, based on the aforementioned example, under the condition that each motion trajectory contains multiple trajectory segments, the calculation module 2004 is configured to: obtain the intersection between each motion trajectory and the reference line of the set starting point corresponding to each running trajectory, and the starting trajectory segment to which the intersection belongs; calculate the distance between the starting point and the end point of the starting trajectory segment, and the distance between the starting point and the intersection; calculate the time corresponding to the intersection based on the distance between the starting point and the end point, the distance between the starting point and the intersection, and the time corresponding to the starting point and the end point respectively; and use the time corresponding to the intersection as the entry time corresponding to each motion trajectory.
[0349] In an optional embodiment, based on the aforementioned example, the calculation module 2004 is further configured to: obtain a set time interval, and search for multiple target calculation cycles that match the set time interval from multiple calculation cycles; obtain traffic data corresponding to the multiple target calculation cycles, and fuse the obtained traffic data to obtain traffic data corresponding to the set time interval.
[0350] In an optional embodiment, based on the aforementioned example, the calculation module 2004 is configured to: obtain the moving object corresponding to each motion trajectory, and search for an object type that matches the moving object corresponding to each motion trajectory from a plurality of object types; calculate the traffic data corresponding to each object type in the plurality of object types according to the set starting points, set ending points and object types corresponding to the plurality of motion trajectories.
[0351] In an optional embodiment, based on the aforementioned example, the calculation module 2004 is configured to: construct a traffic data matrix according to multiple set starting points and multiple set ending points; the elements in the traffic data matrix represent the traffic; and update the values of the elements contained in the traffic data matrix according to the set starting points and the set ending points corresponding to the multiple motion trajectories.
[0352] It should be noted that the traffic data detection device provided in the above embodiment and the traffic data detection method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0353] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more computer programs, when the one or more computer programs are executed by one or more processors, the electronic device implements the traffic data detection method provided in the above-mentioned embodiments.
[0354] Fig.21 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0355] It should be noted that Fig.21 The computer system 2100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0356] like Fig.21As shown, the computer system 2100 includes a central processing unit (CPU) 2101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 2102 or a computer program loaded from a storage part 2108 to a random access memory (RAM) 2103, such as executing the traffic data detection method in the above embodiment. Various computer programs and data required for system operation are also stored in RAM 2103. CPU 2101, ROM 2102 and RAM 2103 are connected to each other through a bus 2104. An input / output (I / O) interface 2103 is also connected to the bus 2104.
[0357] In some embodiments, the following components are connected to the I / O interface 2103: an input section 2106 including a keyboard, a mouse, etc.; an output section 2107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 2108 including a hard disk, etc.; and a communication section 2109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 2109 performs communication processing via a network such as the Internet. A drive 2110 is also connected to the I / O interface 2103 as needed. A removable medium 2111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 2110 as needed, so that a computer program read therefrom is installed into the storage section 2108 as needed.
[0358] In particular, according to an embodiment of the present application, a computer program for implementing a traffic data detection method may be carried on a computer-readable medium, and the computer program may be downloaded and installed from a network through the communication part 2109 , and / or installed from a removable medium 2111 .
[0359] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a computer program, which may be used by an instruction execution system, device or device or used in combination with it. The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried, and the propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer program contained in the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.
[0360] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0361] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0362] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of an electronic device, the electronic device implements the above-mentioned traffic data detection method. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0363] Another aspect of the present application further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the traffic data detection method provided in each of the above embodiments is implemented. The computer program may be stored in a computer-readable storage medium.
[0364] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A method for detecting traffic volume data, characterized in that: The method comprises: Acquire multiple set starting points and multiple set ending points from the set area respectively; Acquire multiple motion trajectories of the moving objects in the set area; From the plurality of set starting points and the plurality of set ending points, respectively searching for a set starting point and a set ending point corresponding to each motion track; The traffic volume data in the set area is calculated according to the set starting points and the set ending points respectively corresponding to the multiple motion trajectories; wherein the traffic volume data includes the traffic volume corresponding to each group of the set starting points and the set ending points among the multiple set starting points and the multiple set ending points.
2. The method according to claim 1, characterized in that The step of searching for a set starting point and a set ending point corresponding to each motion track from the plurality of set starting points and the plurality of set ending points comprises: Acquire the position information of each of the plurality of set starting points and the plurality of set ending points, and search the map data for the road reference line information of the road to which each of the set points belongs according to the position information of each of the set points; Calculating a reference line of each set point according to the position information of each set point and the road reference line information of the corresponding road; A set starting point where an intersection exists between the corresponding reference line and each motion track is searched from the plurality of set starting points, and a set ending point where an intersection exists between the corresponding reference line and each motion track is searched from the plurality of set ending points.
3. The method according to claim 2, characterized in that Each of the motion trajectories comprises a plurality of trajectory segments; The step of searching for a set starting point at which a corresponding reference line has an intersection with each of the motion trajectories from the plurality of set starting points, and searching for a set ending point at which a corresponding reference line has an intersection with each of the motion trajectories from the plurality of set ending points, comprises: Comparing the plurality of trajectory segments with the reference lines of the plurality of set starting points in sequence until a starting trajectory segment having an intersection with the reference line of any set starting point among the plurality of set starting points is found; Comparing the plurality of trajectory segments with the reference lines of the plurality of set end points in sequence until a termination trajectory segment having an intersection with the reference line of any of the plurality of set end points is found; A set starting point where the corresponding reference line intersects with the starting track segment, and a set ending point where the corresponding reference line intersects with the ending track segment are obtained.
4. The method according to claim 3, characterized in that The step of sequentially comparing the plurality of trajectory segments with the reference lines of the plurality of set starting points until finding a starting trajectory segment having an intersection with the reference line of any set starting point among the plurality of set starting points comprises: Calculating a linear expression corresponding to any trajectory segment according to the position information of the starting point and the ending point of any trajectory segment among the multiple trajectory segments; Comparing the linear expressions corresponding to any of the trajectory segments with the linear expressions corresponding to the reference lines of the plurality of set starting points; If there is no intersection between the linear expression corresponding to any trajectory segment and the linear expression corresponding to the reference line of each of the multiple set starting points, the linear expression corresponding to the next trajectory segment in the multiple trajectory segments is calculated until the starting trajectory segment is found.
5. The method according to claim 3, characterized in that The method further comprises: In the process of sequentially comparing the plurality of trajectory segments with the plurality of reference lines of the set end points, if the starting trajectory segment is found, obtaining the starting time corresponding to the starting point of the starting trajectory segment; Filtering out, from the plurality of trajectory segments, a trajectory segment whose start time is later than the start time of the start trajectory segment; The selected trajectory segments are sequentially compared with the reference lines of the plurality of set end points until the end trajectory segment is found.
6. The method according to claim 3, characterized in that The step of sequentially comparing the plurality of trajectory segments with the reference lines of the plurality of set end points until finding a termination trajectory segment having an intersection with the reference line of any of the plurality of set end points comprises: Obtaining a start time corresponding to a starting point of each of the plurality of trajectory segments; The plurality of trajectory segments are sequentially compared with the reference lines of the plurality of set starting points in a descending order of the corresponding starting times until a termination trajectory segment having an intersection with the reference line of any of the plurality of set termination points is found.
7. The method according to claim 3, characterized in that The acquiring of multiple motion trajectories of the moving object in the set area includes: Periodically detecting position information corresponding to a plurality of moving objects in the set area to obtain a position information sequence of each moving object; Generating a trajectory segment corresponding to each moving object according to adjacent position information in the position information sequence of each moving object; The motion trajectory corresponding to each moving object is generated according to the trajectory segment corresponding to each moving object.
8. The method according to claim 1, characterized in that The calculating the traffic volume data in the set area according to the set starting points and the set ending points respectively corresponding to the plurality of motion trajectories includes: Obtaining an entry time of each motion trajectory into a corresponding set starting point, and searching for a calculation cycle that matches the entry time of each motion trajectory from a plurality of calculation cycles; According to the set starting points, the set ending points and the calculation cycles respectively corresponding to the multiple motion trajectories, the traffic volume data corresponding to each calculation cycle in the multiple calculation cycles is calculated.
9. The method according to claim 8, characterized in that Each of the motion trajectories comprises a plurality of trajectory segments; The obtaining of the entry time of each motion trajectory into the corresponding set starting point includes: Obtaining the intersection point between each motion trajectory and a reference line of a set starting point corresponding to each running trajectory, and the starting trajectory segment to which the intersection point belongs; Calculating the distance between the starting point and the end point of the starting trajectory segment, and the distance between the starting point and the intersection point; Calculate the time corresponding to the intersection point according to the distance between the starting point and the end point, the distance between the starting point and the intersection point, and the time corresponding to the starting point and the end point respectively; The time corresponding to the intersection is used as the entry time corresponding to each motion trajectory.
10. The method according to claim 8, characterized in that After calculating the traffic volume data corresponding to each of the plurality of calculation cycles according to the set starting points, the set ending points and the calculation cycles respectively corresponding to the plurality of motion trajectories, the method further includes: Acquire a set time interval, and search for a plurality of target computing cycles matching the set time interval from the plurality of computing cycles; The traffic volume data corresponding to the multiple target calculation periods are obtained, and the obtained traffic volume data are merged to obtain the traffic volume data corresponding to the set time interval.
11. The method according to claim 1, characterized in that The calculating the traffic volume data in the set area according to the set starting points and the set ending points respectively corresponding to the plurality of motion trajectories includes: Acquire the moving object corresponding to each moving track, and search for an object type matching the moving object corresponding to each moving track from multiple object types; According to the set starting points, the set ending points and the object types respectively corresponding to the multiple motion trajectories, the traffic volume data corresponding to each of the multiple object types is calculated.
12. The method according to claim 1, characterized in that The calculating the traffic volume data in the set area according to the set starting points and the set ending points respectively corresponding to the plurality of motion trajectories includes: Constructing a traffic volume data matrix according to the plurality of set starting points and the plurality of set ending points; elements in the traffic volume data matrix represent traffic volume; According to the set starting points and the set ending points respectively corresponding to the multiple motion trajectories, the values of the elements included in the traffic data matrix are updated.
13. A traffic volume data detection device, characterized in that: The device comprises: An acquisition module is configured to respectively acquire a plurality of set starting points and a plurality of set ending points from a set area; A detection module, configured to obtain multiple motion trajectories of the moving object in the set area; A search module, configured to search for a set starting point and a set ending point corresponding to each motion track from the plurality of set starting points and the plurality of set ending points; A calculation module is configured to calculate the traffic volume data in the set area according to the set starting points and the set ending points respectively corresponding to the multiple motion trajectories; wherein the traffic volume data includes the traffic volume corresponding to each group of the set starting points and the set ending points among the multiple set starting points and the multiple set ending points.
14. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the traffic data detection method described in any one of claims 1-12.
15. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of an electronic device, the electronic device implements the traffic data detection method described in any one of claims 1-12.
16. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the traffic data detection method according to any one of claims 1 to 12.
