Method, device and equipment for determining traffic light period

By acquiring traffic light behavior information and dividing time windows over multiple days, and calculating the cycle dispersion, the problem of inaccurate traffic light cycle recognition in existing technologies is solved, achieving high accuracy and reliability recognition in dynamic traffic scenarios.

CN121789484APending Publication Date: 2026-04-03BEIJING SIWEI TUXIN TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, traffic light cycle recognition based on visual perception is easily affected by environmental factors, while solutions based on floating car data cannot adapt to the dynamic adjustment of traffic light cycles, resulting in inaccurate recognition.

Method used

By acquiring waiting behavior information for multiple days at the target traffic light intersection, dividing the time window, calculating the set of the first light change times for each time window, and calculating the cycle dispersion based on the candidate cycle, the optimal traffic light cycle is selected.

Benefits of technology

It improves the accuracy and reliability of traffic light cycle recognition, adapts to the dynamic adjustment of traffic light cycles in actual traffic, and reduces dependence on environmental factors and random errors in single-day data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121789484A_ABST
    Figure CN121789484A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a traffic light period determination method, device and equipment. The method comprises the following steps: acquiring multi-day lamp waiting behavior information of a target traffic light intersection; determining a first lamp changing moment set of a plurality of time windows based on the lamp waiting behavior information of multiple days; wherein the first lamp changing moment set of each time window comprises first lamp changing moments in the time window corresponding to multiple days; the first lamp changing moment represents relative time information of changing a red lamp into a green lamp; for each time window, based on the first lamp changing moment set of the time window and a plurality of preset candidate periods, determining a period dispersion corresponding to each candidate period; wherein the period dispersion represents the matching degree of the candidate period and the first lamp changing moment in the time window; and determining the traffic light period of the time window according to the period dispersion corresponding to each candidate period. The method is used for improving the accuracy of the traffic light period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data technology, and in particular to a method, apparatus and equipment for determining the traffic light cycle. Background Technology

[0002] In urban transportation networks, traffic light cycles directly impact vehicle traffic efficiency, especially during peak hours, when traffic management departments often adjust traffic light cycles to alleviate congestion. Therefore, dynamic traffic light cycle recognition technology is a core component in ensuring traffic efficiency and driving experience. For example, by acquiring traffic light cycles in real time, optimal routes can be dynamically planned, reducing vehicle waiting time and improving traffic flow.

[0003] In related technologies, one approach is to capture the position and color status of traffic lights in real time using visual perception devices and target detection algorithms, and then deduce the traffic light cycle. However, this approach relies on visual perception and is easily affected by environmental factors such as heavy rain, fog, and strong light, resulting in inaccurate traffic light cycles. Another approach is to extract the cycle based on floating car data combined with frequency analysis, statistical tests, and other algorithms. However, this approach can only be adapted to the ideal scenario where the traffic light cycle is fixed throughout the day, and cannot cope with the dynamic adjustment problem of the cycle that is common in actual traffic, thus leading to inaccurate extracted traffic light cycles. Summary of the Invention

[0004] The methods, apparatus, and equipment for determining traffic light cycles provided in this application are intended to improve the accuracy of traffic light cycles.

[0005] In a first aspect, embodiments of this application provide a method for determining the traffic light cycle, including:

[0006] Obtain information on waiting behavior at the target traffic light intersection over multiple days;

[0007] Based on the traffic light behavior information over multiple days, a set of first light-changing times for multiple time windows is determined; wherein, the set of first light-changing times for each time window includes the first light-changing times within the corresponding time window over multiple days; the first light-changing times represent the relative time information of the red light changing to the green light;

[0008] For each time window, based on the first light-changing moment set of that time window and a set of preset candidate periods, the period dispersion corresponding to each candidate period is determined; wherein, the period dispersion characterizes the matching degree between the candidate period and the first light-changing moment within that time window;

[0009] The traffic light cycle for that time window is determined based on the cycle dispersion corresponding to each candidate cycle.

[0010] In one possible implementation, determining the period dispersion corresponding to each candidate period for each time window, based on the first set of light-changing times within that time window and a preset plurality of candidate periods, includes:

[0011] For each time window, iterate through the multiple candidate periods and perform the following steps:

[0012] Based on the current candidate period and the first set of light-changing times in the time window, the third set of light-changing times in the time window is determined; wherein, the third set of light-changing times includes multiple third light-changing times, and the third light-changing times represent the time information after the first light-changing times are mapped to the current candidate period;

[0013] For each third light-changing moment, determine the phase distance between that third light-changing moment and other third light-changing moments;

[0014] Based on the phase distance, the fourth light-changing time is determined from the third light-changing times; wherein the sum of the phase distances between the fourth light-changing time and the other third light-changing times is the smallest;

[0015] The periodicity of the current candidate period is determined based on the current candidate period and the phase distance between the fourth lamp change time and other third lamp change times.

[0016] In one possible implementation, determining the third set of light-changing times for the time window based on the current candidate cycle and the first set of light-changing times for the time window includes:

[0017] For each first light-changing moment in the first light-changing moment set of the time window, the ratio of the first light-changing moment to the current candidate cycle is rounded to obtain the rounded value.

[0018] Subtract the product of the rounded value and the current candidate cycle from the first light-changing time to obtain the third light-changing time corresponding to the first light-changing time.

[0019] In one possible implementation, determining the phase distance between each third lamp-changing moment and other third lamp-changing moments includes:

[0020] The difference between the third light-changing moment and the other third light-changing moments is calculated to obtain the first difference and the second difference.

[0021] The first difference and the second difference are respectively subjected to modulo operation with the current candidate period to obtain the first modulo value and the second modulo value;

[0022] The minimum value between the first modulus and the second modulus is used as the distance between the third light-changing moment and other third light-changing moments.

[0023] In one possible implementation, determining the period dispersion of the current candidate period based on the current candidate period and the phase distance between the fourth lamp-changing time and other third lamp-changing times includes:

[0024] The variance value is determined based on the sum of squares of the phase distances between the fourth light-changing moment and other third light-changing moments, and the number of third light-changing moments included in the set of third light-changing moments;

[0025] The ratio of the variance value to the current candidate period is used as the initial discrete value;

[0026] The penalty value is determined based on the current candidate period and the maximum value among the multiple candidate periods;

[0027] Based on the initial discrete value and the penalty value, the periodic discreteness of the current candidate period is obtained.

[0028] In one possible implementation, determining the first set of light-changing times for multiple time windows based on the light-keeping behavior information over multiple days includes:

[0029] Based on the aforementioned traffic light behavior information, a set of second light-changing times for each time window is determined; wherein, the set of second light-changing times for each time window includes the second light-changing times within the corresponding time windows of multiple days; the second light-changing time represents the absolute time information of the red light changing to the green light;

[0030] For the same time window, the second light-changing moments within the second light-changing moment set of the time window are phase-aligned to obtain the first light-changing moment set of the time window.

[0031] In one possible implementation, the waiting-at-the-light behavior information includes the start time information, waiting-at-the-light duration information, and waiting-at-the-light distance information; determining the second set of light-changing times for each time window based on the waiting-at-the-light behavior information includes:

[0032] For each day's waiting-at-the-light behavior information, time error information is determined based on a preset distance correction coefficient and the waiting-at-the-light distance information of that waiting-at-the-light behavior information; wherein, the time error information represents the time error caused from the parking position to the traffic light position;

[0033] Based on the start time information, waiting duration information, and time error information of the waiting behavior information, the second light-changing time corresponding to the waiting behavior information is determined.

[0034] The second light-changing time corresponding to each light-changing behavior information is divided into multiple time windows to obtain the set of second light-changing times for each time window.

[0035] In one possible implementation, the method further includes:

[0036] Based on the traffic light cycles of adjacent time windows, determine the candidate cycle transition time;

[0037] For each candidate cycle transition moment, extract from the first light-changing moment set multiple preceding first light-changing moments that are before the candidate cycle transition moment, and multiple subsequent first light-changing moments that are after the candidate cycle transition moment;

[0038] Based on the multiple preceding first light-changing times and the multiple candidate cycles, the cycle dispersion before the cycle jump is determined; and based on the multiple subsequent first light-changing times and the multiple candidate cycles, the cycle dispersion after the cycle jump is determined.

[0039] The candidate periodic transition moment that minimizes the sum of the periodic dispersion before and after the periodic transition is taken as the final periodic transition moment.

[0040] Secondly, embodiments of this application provide a device for determining the cycle of a traffic light, comprising:

[0041] The acquisition module is used to obtain waiting behavior information for multiple days at the target traffic light intersection;

[0042] The first determining module is used to determine a set of first light-changing times for multiple time windows based on the light-waiting behavior information over multiple days; wherein, the set of first light-changing times for each time window includes the first light-changing times within the corresponding time window over multiple days; the first light-changing times represent the relative time information of the red light changing to the green light;

[0043] The second determining module is used to determine the cycle dispersion of each candidate cycle for each time window based on the first light-changing moment set of the time window and a set of preset candidate cycles; wherein the cycle dispersion characterizes the matching degree between the candidate cycle and the first light-changing moment in the time window.

[0044] The third determining module is used to determine the traffic light cycle of the time window based on the cycle dispersion corresponding to each candidate cycle.

[0045] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0046] The memory stores computer-executed instructions;

[0047] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0048] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0049] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0050] The traffic light cycle determination method, apparatus, and device provided in this application obtain multi-day waiting behavior information of a target traffic light intersection, divides the time window to obtain a set of first light-changing times for each time window, and calculates the cycle dispersion of each candidate cycle based on multiple preset candidate cycles for the first light-changing times of each time window. Finally, the traffic light cycle of that time window is determined based on the cycle dispersion of each candidate cycle, thereby determining the traffic light cycle of each time window. This method, which independently calculates the cycle for each time window, can adapt to the scenario of dynamic adjustment of traffic light cycles in actual traffic, solving the technical pain point of traditional floating car data-based solutions that can only identify fixed cycles, thus improving the accuracy of traffic light cycle recognition. Simultaneously, calculating the light-changing times based on waiting behavior information and then calculating the cycle dispersion quantifies cycle stability, reduces the dependence of traditional visual perception solutions on environmental factors, and reduces random errors in single-day data through multi-day data aggregation, improving the accuracy and reliability of traffic light cycle recognition. Attached Figure Description

[0051] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0052] Figure 1 A flowchart illustrating the method for determining the traffic light cycle provided in this application. Figure 1 ;

[0053] Figure 2 A flowchart illustrating the method for determining the traffic light cycle provided in this application. Figure 2 ;

[0054] Figure 3 A schematic diagram of a phase alignment process provided in this application;

[0055] Figure 4A schematic diagram of a periodic discreteness provided for this application;

[0056] Figure 5 A schematic diagram of a periodic transition moment provided in this application;

[0057] Figure 6 A schematic diagram of the structure of the traffic light cycle determination device provided in this application;

[0058] Figure 7 A schematic diagram of the structure of the electronic device provided in this application.

[0059] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0060] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0061] First, let me explain the terms used in this application:

[0062] Floating Car Data (FCD) refers to a dynamic data set that is collected and uploaded in real time by a mobile vehicle equipped with a positioning module, sensing device, and data transmission module during its operation. This data set includes the vehicle's location, status, and time dimensions.

[0063] The inventors noted that visual perception-based traffic light cycle recognition schemes in related technologies are easily affected by environmental factors such as severe weather and lighting conditions. Traditional schemes based on floating car data combined with frequency analysis or statistical tests cannot adapt to the dynamic adjustment of traffic light cycles in real-world traffic scenarios. Both suffer from inaccurate cycle recognition. Therefore, they considered that if the environmental dependence of visual perception could be avoided, and effective information strongly correlated with traffic light states in floating car data could be extracted and adapted to the dynamic changes in cycles, the accuracy of cycle recognition could be improved. Based on this, the inventors realized that waiting behavior in floating car data is directly related to the time when the red light turns green. Furthermore, the massive and wide-coverage nature of waiting behavior data over multiple days can reduce the random errors of single-day data. Therefore, by accurately determining the time of the light change through multiple days of waiting behavior, and then calculating the matching degree between candidate cycles and the time of the light change by discretely measuring the cycle, the optimal traffic light cycle for each time period is finally selected. This approach avoids environmental interference from visual perception and adapts to the actual scenario of dynamic cycle adjustment, thus solving the problem of inaccurate cycle recognition in existing technologies.

[0064] The execution subject of this application embodiment can be an electronic device with processing capabilities, such as a computer, server, etc., and this application embodiment is not limited thereto.

[0065] It should be noted that the user information and user data involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant laws, regulations and standards, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0066] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0067] Figure 1 A flowchart illustrating the method for determining the traffic light cycle provided in this application. Figure 1 ,like Figure 1 As shown, the method includes:

[0068] S101. Obtain information on waiting behavior at the target traffic light intersection over multiple days.

[0069] For example, the target traffic light intersection refers to the intersection where the traffic light cycle to be identified is to be determined. "Multiple days" refers to two or more calendar days; the specific number of days can be flexibly set according to data accuracy requirements, and this application embodiment does not impose a mandatory limitation. Waiting-at-the-light behavior information refers to the characteristic data generated by a vehicle waiting for a red light at the target intersection. This may include, for example, the time information of starting to wait (the timestamp when the vehicle first meets the stopping conditions), the waiting time information (the time difference from starting to wait to starting to proceed), and the waiting distance information (the straight-line distance between the vehicle's stopping position and the traffic light at the intersection).

[0070] In one example, the electronic device can communicate with other electronic devices to directly obtain waiting behavior information for the target intersection over the past 30 days, or it can receive waiting behavior information for the target intersection over the past 30 days imported from external devices. Alternatively, the electronic device can communicate with other electronic devices to obtain floating car data for the target intersection over the past 30 days. This floating car data can include information such as unique vehicle identifiers, real-time location information, collection timestamps, driving speed, and driving direction. Based on waiting behavior filtering criteria, the floating car data can be cleaned to remove invalid trajectories with abnormal speeds or positional drifts. From the valid trajectories, the start time, waiting duration, and waiting distance information that meet the filtering criteria can be extracted and integrated to form a multi-day set of waiting behavior information. The filtering criteria for waiting behavior could be, for example, vehicle stopping speed below a preset speed threshold, stopping duration above a preset duration threshold, stopping location distance from the intersection below a preset distance threshold, or vehicle accelerating to above a preset traffic speed threshold after stopping. This excludes non-waiting behaviors such as temporary deceleration or yielding to pedestrians.

[0071] S102. Based on the lighting behavior information over multiple days, determine the set of the first lighting change times for multiple time windows.

[0072] For example, a time window refers to a period of time divided according to a preset time interval. In this embodiment, the length of the time window and the preset time interval are not limited; for example, it can be 10 minutes, 15 minutes, 30 minutes, etc., and can be set according to actual needs. The rule for dividing the time window is as follows: starting from 00:00 every day, multiple time points are divided according to the preset time interval (e.g., 15 minutes). Each time point corresponds to a fixed collection window of a subsequent preset duration (e.g., 1 hour), which serves as multiple time windows. Taking a preset time interval of 15 minutes and a preset duration of 1 hour as an example, time window 1 can be 00:00~01:00, time window 2 can be 00:15~01:15, time window 3 can be 00:30~01:30, and so on, to obtain multiple time windows.

[0073] The first light-changing moment represents the relative time information of the red light changing to green, with the start time of the corresponding time window as the origin (0 seconds), and the unit is seconds, used to eliminate the difference in absolute time between different days. The second light-changing moment refers to the absolute time information of the red light changing to green, calculated based on the waiting light behavior information. The set of first light-changing moments for each time window refers to the set of first light-changing moments within the corresponding time window for multiple days after cross-day phase alignment processing. For example, the set of first light-changing moments corresponding to time window 1 (00:00~01:00) may include multiple first light-changing moments within 00:00~01:00 on the first day, multiple first light-changing moments within 00:00~01:00 on the second day, etc.

[0074] In one example, for each waiting-at-the-lights behavior information for each day, the second light-changing time is determined by combining preset waiting-at-the-lights distance information, start-of-waiting time information, waiting-at-the-lights duration information, and the mapping relationship between the second light-changing time and the second light-changing time. Then, according to the time range of each time window, all second light-changing times for each day are divided into corresponding time windows, forming a set of second light-changing times for each time window for each day. For the same time window, the sets of second light-changing times for multiple days are extracted. After converting each second light-changing time into a relative light-changing time within the corresponding time window, the relative light-changing times for each day are adjusted by time axis offset based on a preset base time for that time window to complete cross-day phase alignment, finally obtaining the first light-changing time set for that time window. The preset base time can be the median of the first second light-changing time within that time window each day, or the first second light-changing time of the first day; this embodiment does not limit the specific time.

[0075] S103. For each time window, based on the first set of light-changing times in that time window and multiple preset candidate cycles, determine the cycle dispersion corresponding to each candidate cycle.

[0076] For example, the preset multiple candidate cycles refer to a pre-defined range of possible values ​​for the traffic light cycle, which may include multiple continuous or discrete candidate cycle values. In other words, the multiple candidate cycles may be, for example, […]. In the form of ], where, This represents the minimum value within the candidate period. This represents the maximum value in the candidate period; it can also be a discrete form of C=[40,45,50,60,70,90]. It should be noted that this application does not limit the value or number of candidate periods; these can be set according to actual needs.

[0077] Periodic dispersion is an indicator used to quantify the degree of matching between a candidate period and the first light-changing moment within the corresponding time window. The smaller the dispersion value, the higher the degree of matching between the candidate period and the light-changing moment within the window, and the closer it is to the actual traffic light period.

[0078] In one example, for each time window, multiple preset candidate periods are traversed. For the current candidate period, all the first light-changing moments within the time window are mapped to the current candidate period to obtain a set of mapped first light-changing moments. First, based on the preset mapping relationship between the light-changing moments and the current candidate period, the phase distance between each mapped first light-changing moment and other mapped first light-changing moments is determined. Then, based on the preset mapping relationship between the period dispersion, the phase distance, and the current candidate period, the period dispersion of the current candidate period is determined.

[0079] S104. Determine the traffic light cycle for the time window based on the cycle dispersion corresponding to each candidate cycle.

[0080] For example, the traffic light cycle refers to the time it takes for the traffic lights at the target intersection to complete one red→green→yellow→red cycle. In this step, by quantitatively comparing the cycle dispersion, the candidate cycle that best matches the light-changing time pattern within the time window is selected as the actual traffic light cycle corresponding to that window.

[0081] In one example, after calculating the period dispersion of all preset candidate periods for the current time window, the dispersion values ​​of all candidate periods are sorted, and the candidate period with the smallest period dispersion is selected as the traffic light period for that time window. Thus, the traffic light period for each time window can be determined through the above steps.

[0082] Optionally, if the difference in period dispersion of multiple candidate periods is less than a preset error threshold (e.g., 0.01), the average of these candidate periods can be taken as the final traffic light period.

[0083] The traffic light cycle determination method provided in this application obtains waiting behavior information for multiple days at a target traffic light intersection, divides the time window to obtain a set of first light-changing times for each time window, and calculates the cycle dispersion of each candidate cycle based on multiple preset candidate cycles for the first light-changing times of each time window. Finally, the traffic light cycle for that time window is determined based on the cycle dispersion of each candidate cycle, thus determining the traffic light cycle for each time window. This method, which calculates the cycle independently for each time window, can adapt to the scenario of dynamic adjustment of traffic light cycles in actual traffic, solving the technical pain point of traditional floating car data-based solutions that can only identify fixed cycles, and improving the accuracy of traffic light cycle recognition. Simultaneously, calculating the light-changing times based on waiting behavior information and then calculating the cycle dispersion quantifies cycle stability, reduces the dependence of traditional visual perception solutions on environmental factors, and reduces random errors in single-day data through multi-day data aggregation, improving the accuracy and reliability of traffic light cycle recognition.

[0084] Figure 2 A flowchart illustrating the method for determining the traffic light cycle provided in this application. Figure 2 ,like Figure 2 As shown, in this embodiment... Figure 1 Based on the embodiments, the method for determining the traffic light cycle is described in detail, and the method includes:

[0085] S201. Obtain information on waiting behavior at the target traffic light intersection over multiple days.

[0086] It should be noted that this step is similar to the aforementioned step S101, and will not be repeated here.

[0087] S202. Based on the lighting behavior information, determine the set of the second lighting change times for each time window.

[0088] For example, the second light-changing time refers to the absolute time information of when the red light turns green, calculated based on waiting light behavior information. The set of second light-changing times is the set of second light-changing times corresponding to multiple days within the same time window.

[0089] In one example, for each waiting-at-the-light behavior information for each day, the second light-changing time is determined by combining the preset waiting-at-the-light distance information, the start time of waiting-at-the-light information, the waiting-at-the-light duration information and the mapping relationship between the second light-changing time. This results in the set of second light-changing times for each time window.

[0090] Specifically, step S202 may include the following sub-steps:

[0091] S2021. For each day's waiting-at-the-light behavior information, based on the preset distance correction coefficient and the waiting-at-the-light distance information of that waiting-at-the-light behavior information, determine the time error information.

[0092] For example, distance correction factor This represents the ratio of travel time to distance from the parking position to the traffic light position, measured in seconds per meter. Waiting distance information is the straight-line distance between the vehicle's stopping position and the traffic light position. Time error information is the time required for the vehicle to travel from its stopping position to the traffic light position; in other words, the time error caused by the travel time from the parking position to the traffic light position, used to correct the deviation between the waiting time and the actual time the traffic light changes.

[0093] In one example, the electronic device has a pre-defined mapping relationship between time error information, distance correction coefficient, and waiting distance information. Then, by substituting the pre-defined distance correction coefficient and the waiting distance information from the waiting behavior information into this mapping relationship, the time error information can be obtained. For example, this mapping relationship can be expressed as: Time error information = ;in, This indicates the distance to the streetlights, in meters. This represents a constant term, measured in seconds, used to characterize fixed time such as vehicle start-up delay or minor traffic congestion at intersections.

[0094] S2022. Based on the start time information, waiting duration information and time error information of the waiting behavior information, determine the second light-changing time corresponding to the waiting behavior information.

[0095] For example, the start time information for waiting at the traffic light is the timestamp of the vehicle's first stop location in the intersection's waiting area. The waiting time information is the time difference between the start of the waiting period and the vehicle's acceleration.

[0096] In one example, the electronic device has a pre-defined mapping relationship between the start time of the light-waiting period, the waiting duration, the time error, and the second light-changing time. Then, by substituting the start time, waiting duration, and time error into this mapping relationship, the second light-changing time can be obtained. For example, this mapping relationship can be represented as follows: ;in, Indicates the time of the second light change; This indicates the start time of waiting for the light to turn on; This indicates the duration of waiting at the traffic light.

[0097] S2023. Divide the second light-changing time corresponding to each light-changing behavior information into multiple time windows to obtain the set of second light-changing times for each time window.

[0098] In one example, an electronic device can be added to the set of second light-changing times within a corresponding time window, based on a preset time window division rule. For instance, the second light-changing times of Day 1 ("2024-01-01 08:02:43"), Day 2 ("2024-01-02 08:03:10"), and Day 3 ("2024-01-03 08:01:55") can be uniformly divided into the 08:00~09:00 time window, forming the set of second light-changing times for that time window. .

[0099] Through the above steps, the time error information is determined by combining the preset distance correction coefficient and the waiting distance. Then, the second light-changing time is determined based on the start waiting time, waiting duration, and the time error. Finally, the set of second light-changing times for each time window is obtained by dividing the time window. This can correct the time deviation caused by the vehicle's waiting distance and ensure the accuracy of the second light-changing time.

[0100] S203. For the same time window, perform phase alignment processing on the second light-changing times within the second light-changing times set of the time window to obtain the first light-changing times set of the time window.

[0101] For example, phase alignment is an operation that adjusts the relative time axis of the second light-changing moments within the same time window on different days to synchronize the light-changing rhythm. The set of first light-changing moments is the set of first light-changing moments corresponding to multiple days within the same time window after phase alignment.

[0102] In one example, the second light-changing time of each day is converted into a relative light-changing time within that time window. Specifically, taking the start time of the time window as the origin (0 seconds), all second light-changing times within the window are converted into relative light-changing times. For instance, if the start time of the 08:00-09:00 time window is 08:00:00 (absolute seconds: 8 × 3600 = 28800 seconds), and the second light-changing time is 08:01:03 (absolute seconds: 28800 + 63 = 28863 seconds), then the relative light-changing time for this second light-changing time is 63 seconds. Furthermore, the median of the first relative light-changing time within that time window each day (the relative light-changing time of the first second light-changing time within the time window) is used as a unified benchmark. All relative light-changing times for each day are then offset by the difference between the first relative light-changing time of the day and the unified benchmark to obtain the corresponding first light-changing time. Thus, the set of the first light-changing moments is obtained. .

[0103] Figure 3 A schematic diagram of a phase alignment process provided in this application is shown below. Figure 3As shown, for the same time window (08:00-09:00), the first relative light-changing time within that time window is extracted for each day. For example, the first relative light-changing time for Day 1 is 63 seconds, for Day 2 it is 115.5 seconds, and for Day 3 it is 62 seconds. Assuming 63 seconds is chosen as the unified baseline, then all relative light-changing times for Day 2 need to be shifted as a whole: 115.5 - 63 = 52.5 seconds. That is, each relative light-changing time for Day 2 within this time window needs to be subtracted by 52.5 seconds to obtain the corresponding first light-changing time. Similarly, for all days, the first relative light-changing time is shifted as a whole based on the difference between the first relative light-changing time of the day and the unified baseline to obtain the set of first light-changing times. (Reference) Figure 3 As shown, this step can synchronize the switching rhythm of traffic lights within the same time window on different days, that is, align the red light turning green light time within the same time window on different days to the dotted line on the left.

[0104] For each time window, iterate through multiple candidate periods and perform the following steps:

[0105] S204. Determine whether the current candidate period is greater than the maximum value in the candidate period.

[0106] For example, the candidate period is a preset range of traffic light cycle values, which includes multiple candidate values; the maximum value in the candidate period is the upper limit of the range of traffic light cycle values.

[0107] If not, proceed to step S205; if yes, proceed to step S209.

[0108] S205. Based on the current candidate cycle and the first set of light-changing times in the time window, determine the third set of light-changing times in the time window.

[0109] For example, the third light-changing moment represents the time information after the first light-changing moment is mapped to the current candidate cycle, with a value range of [0, current candidate cycle), used to adapt to the cyclical characteristics of traffic light cycles. The set of third light-changing moments includes multiple third light-changing moments. Through this step, the time redundancy caused by the cycle can be eliminated, allowing all first light-changing moments to be analyzed within a single candidate cycle, making it easier to determine whether they conform to the cyclical pattern of that candidate cycle.

[0110] Specifically, for each first light-changing moment in the first light-changing moment set within the time window, the ratio of that first light-changing moment to the current candidate period is rounded down to obtain a rounded value; the product of the rounded value and the current candidate period is subtracted from the first light-changing moment to obtain the third light-changing moment corresponding to that first light-changing moment.

[0111] For example, electronic devices can be configured according to the formula Each first light change moment The ratio of the current candidate period C is rounded down to obtain the rounded value. Therefore, the first light-changing moment Subtract the product of the rounded value and the current candidate period to obtain the third light-changing time corresponding to the first light-changing time. This allows us to obtain the set of the third light-changing times within that time window. .

[0112] S206. For each third light-changing moment, determine the phase distance between that third light-changing moment and other third light-changing moments.

[0113] For example, the phase distance refers to the shortest time difference between two third lamp-changing moments within the current candidate cycle. The electronic device can determine the phase distance between the third lamp-changing moment and other third lamp-changing moments based on a preset mapping relationship between the lamp-changing moments and the current candidate cycle.

[0114] Specifically, the difference between the third light-changing time and other third light-changing times is calculated to obtain a first difference and a second difference; the first difference and the second difference are respectively moduloed with the current candidate cycle to obtain a first modulo value and a second modulo value; the minimum value between the first modulo value and the second modulo value is taken as the distance between the third light-changing time and other third light-changing times.

[0115] For example, regarding the third light change time Other third light-changing moments The electronic device can first calculate the first difference. Second difference And then refer to The first modulus value is obtained by performing a modulo operation on the first difference and the current candidate period C. Then, a modulo operation is performed on the second difference and the current candidate period C to obtain the second modulo value. Finally, the minimum value between the first and second moduli will be used as the distance between the third light-changing moment and other third light-changing moments. .

[0116] This step allows for accurate measurement of the actual distance between the two third-time light-changing moments within a cycle, avoiding cross-cycle calculation errors.

[0117] S207. Based on the phase distance, determine the fourth light-changing time from the third light-changing time.

[0118] For example, the sum of the phase distances between the fourth lamp-changing moment and the other third lamp-changing moments is minimized; in other words, the fourth lamp-changing moment can be considered the centroid moment in the set of third lamp-changing moments. For instance, electronic devices can refer to the formula... For each third light change moment Other third light change times Phase distance between Summing is performed, and the third light-changing moment corresponding to the smallest sum is taken as the fourth light-changing moment. .

[0119] S208. Based on the current candidate cycle and the phase distance between the fourth lamp change time and other third lamp change times, determine the cycle dispersion of the current candidate cycle.

[0120] For example, the electronic device can determine the period dispersion of the current candidate period based on the preset mapping relationship between the period dispersion, the phase distance, and the current candidate period, by substituting the current candidate period and the phase distance between the fourth lamp change time and other third lamp change times.

[0121] Specifically, the variance value is determined based on the sum of the squares of the phase distances between the fourth light-changing moment and other third light-changing moments, and the number of third light-changing moments included in the set of third light-changing moments; the ratio of the variance value to the current candidate period is used as the initial discrete value; the penalty value is determined based on the current candidate period and the maximum value among multiple candidate periods; and the periodicity of the current candidate period is obtained based on the initial discrete value and the penalty value.

[0122] The variance value is a statistic that quantifies the dispersion of the fourth light-changing moment from other third light-changing moments, reflecting the centroid of the third light-changing moments and the central tendency of each third light-changing moment. The initial dispersion value is an index normalized from the variance value, used to eliminate the influence of differences in the size of different candidate periods on the dispersion assessment. The penalty value is a constraint term for excessively small candidate periods, avoiding mismatches caused by excessively short periods.

[0123] For example, an electronic device can first sum the squared values ​​of the phase distances between the fourth lamp-changing moment and other third lamp-changing moments according to the following formula. After obtaining the sum of squares, the variance value is determined based on the sum of squares and the number m of the third lamp-changing moments included in the set of third lamp-changing moments. Then, the ratio of the variance value to the current candidate period is used as the initial discrete value; further, based on the preset penalty value, the mapping relationship between the current candidate period and the maximum value among multiple candidate periods, the penalty value is obtained by substituting the current candidate period and the maximum value among multiple candidate periods, and the sum of the initial discrete value and the penalty value is used as the periodicity of the current candidate period.

[0124]

[0125] in, This represents the periodicity of the current candidate period C; This represents the penalty coefficient, which is an empirical value. This represents the maximum value among multiple candidate cycles; m represents the number of third light-changing times included in the set of third light-changing times.

[0126] By accurately capturing the centroid of the third light-changing moment and the discrete distribution characteristics of each third light-changing moment through variance values, and combining the candidate period with the variance values ​​to obtain the initial discrete value, the incomparability of the degree of dispersion under different period scales is avoided. At the same time, by introducing a penalty value, the risk of misselection of excessively small candidate periods is effectively constrained, ensuring that the matching results are more in line with the reasonable range of actual traffic signal periods. The obtained period dispersion can comprehensively quantify the degree of matching between candidate periods and light-changing moments.

[0127] Update the current candidate period, that is, update the current candidate period to the next value, and return to the execution step S204.

[0128] S209. The candidate period corresponding to the minimum value of the period dispersion of each candidate period shall be taken as the traffic light period of the time window.

[0129] Figure 4 A schematic diagram of a periodic discreteness provided in this application is shown below. Figure 4 As shown, Figure 4 This graph represents the cycle dispersion analysis, where the horizontal axis represents the candidate cycles traversed, and the vertical axis represents the cycle dispersion. Each point in the graph corresponds to the calculated cycle dispersion result of a candidate cycle, and the height of the point reflects the degree of matching between the candidate cycle and the light-changing time. The dashed line marks the final determined traffic light cycle (117 seconds) for this time window, whose corresponding cycle dispersion is the smallest among all candidate cycles. This graph visually demonstrates that the optimal traffic light cycle can be selected based on cycle dispersion, solving the problem that traditional methods cannot dynamically adapt to cycle changes and improving the accuracy of traffic light cycles.

[0130] Through the above steps, the electronic device can obtain the traffic light cycle for each time window.

[0131] S210. Based on the traffic light cycles of adjacent time windows, determine the candidate cycle transition time.

[0132] For example, adjacent time windows refer to windows of consecutive time, such as 08:00-09:00 and 08:15-09:15. The candidate cycle transition moment refers to a possible moment selected from adjacent time windows, at which a change in the traffic light cycle occurs.

[0133] In one example, an electronic device can compare the traffic light cycles of adjacent time windows. If the difference between the traffic light cycles of two time windows is greater than a preset threshold, a candidate transition interval is determined based on these two time windows. For example, these two time windows can be directly integrated as the candidate transition interval, or the overlapping period of the two time windows can be used as the candidate transition interval. Then, the candidate transition interval is sliced ​​according to a preset slicing interval to obtain the candidate cycle transition time. It should be noted that the duration of the slicing interval is not limited in this embodiment; for example, it can be 2 minutes, 5 minutes, etc., and can be set according to actual needs. Taking a slicing interval of 5 minutes and a candidate transition interval of 08:15-09:00 as an example, the candidate cycle transition time can be 08:15, 08:20, ..., 09:00, thus forming a set of candidate transition times. .

[0134] S211. For each candidate cycle transition moment, extract from the set of first light-changing moments multiple preceding first light-changing moments before the candidate cycle transition moment, and multiple subsequent first light-changing moments after the candidate cycle transition moment.

[0135] For example, the preceding first light change time refers to the first light change time within a preset time period before the candidate light change time; the following first light change time refers to the first light change time within a preset time period after the candidate light change time. The length of the preset time period is not limited in this embodiment of the application, but may be, for example, 30 minutes.

[0136] For example, taking a preset duration of 30 minutes as an example, for candidate transition moments... Extract from the set of the first light-changing moments -30min to Multiple preceding first light-changing moments within, and to Multiple subsequent first light-changing moments within +30 minutes.

[0137] S212. Based on multiple preceding first light-changing times and multiple candidate cycles, determine the cycle dispersion before the cycle jump; and based on multiple subsequent first light-changing times and multiple candidate cycles, determine the cycle dispersion after the cycle jump.

[0138] For example, the period dispersion before the period jump is the minimum period dispersion calculated based on the first lamp change time of the preceding period; the period dispersion after the period jump is the minimum period dispersion calculated based on the first lamp change time of the following period.

[0139] In one example, the electronic device can use the extracted first-light-changing moments and the aforementioned steps S204-S208 to calculate the period dispersion of each candidate period, and take the candidate period corresponding to the minimum period dispersion as the period before the jump. Furthermore, the minimum periodic dispersion is taken as the periodic dispersion before the periodic jump. Similarly, the post-change cycle is calculated based on multiple subsequent first-light-change times. And, the periodic dispersion after the periodic jump .

[0140] Through the above steps, the candidate transition time set can be targeted. For each candidate transition time, the periodic dispersion before and after the periodic transition corresponding to that candidate transition time is calculated.

[0141] S213. The candidate periodic jump moment that minimizes the sum of the periodic dispersion before and after the periodic jump is taken as the final periodic jump moment.

[0142] For example, the final cycle transition moment refers to the moment when the traffic light cycle changes.

[0143] For example, electronic devices can be configured according to the formula By substituting the periodic dispersion before and after each candidate transition time into the equation, the final transition time can be obtained. .

[0144] It is understandable that the essence of a cycle transition is the switching of the traffic light cycle between the preceding and following periods. Therefore, the actual transition moment must satisfy the condition that the data before the transition and the cycle before the transition are identical. High degree of matching, and the data after the jump and the period after the jump. The two are highly matched. Therefore, the smaller the sum of the two, the more likely the candidate transition moment is the dividing point between the end of the previous cycle and the beginning of the next cycle, and the higher the degree of fit with the actual transition pattern.

[0145] Figure 5 A schematic diagram of a periodic transition moment provided in this application is shown below. Figure 5 As shown, Figure 5The top chart shows the trend of traffic light cycles throughout the day. The horizontal axis represents the start time of each time window, with each window corresponding to an analysis period. The vertical axis represents the identified traffic light cycles. The time periods marked by the boxes show abnormal fluctuations in the traffic light cycles, such as a sudden drop followed by a rapid recovery; these are candidate cycle jump intervals that require further analysis to determine the exact cycle jump time. The bottom chart shows the minimum sum of the dispersion before and after the cycle jump for each candidate jump time. The horizontal axis represents the candidate jump time from 09:20 to 09:50; the vertical axis represents the sum of the dispersion before and after the cycle jump. When the time point is 09:30:00, the sum of the dispersion before and after the cycle jump reaches its minimum value (0.2058), indicating that this candidate cycle jump time is the final cycle jump time.

[0146] Optionally, the electronic device can store the traffic light cycle and the final cycle transition time of each time window into the vehicle navigation system, so that the vehicle navigation system can perform route planning based on the traffic light cycle and the final cycle transition time of each time window.

[0147] The traffic light cycle determination method provided in this application obtains waiting behavior information of a target traffic light intersection over multiple days. It then divides the time window and aligns the phases to obtain the first light-changing moment set for each time window. Next, it iterates through candidate cycles and determines the traffic light cycle for each time window through modulo operation, centroid filtering, and discrete quantization. Finally, it accurately identifies cycle transition moments based on the differences in traffic light cycles between adjacent time windows. This method, based on the cycle dispersion calculated across time windows, can accurately determine the traffic light cycle for each time window. It not only eliminates the dependence of visual perception schemes on environmental factors and improves the stability of light-changing moment recognition, but also adapts to scenarios with dynamic cycle adjustments in actual traffic. This solves the technical pain point of traditional schemes that can only identify fixed cycles, improving the accuracy of cycle recognition. Simultaneously, based on the traffic light cycles of adjacent time windows, it can finely capture cycle transition moments, providing highly reliable data support for traffic signal timing optimization, intelligent driving decision-making, and public travel planning, comprehensively improving the operational efficiency and application value of intelligent transportation systems.

[0148] Figure 6 A schematic diagram of the structure of the traffic light cycle determination device provided in this application is shown below. Figure 6 As shown, the traffic light cycle determination device 300 provided in this embodiment includes:

[0149] The acquisition module 301 is used to acquire waiting behavior information for multiple days at the target traffic light intersection;

[0150] The first determining module 302 is used to determine a set of first light-changing times for multiple time windows based on the waiting behavior information over multiple days; wherein, the set of first light-changing times for each time window includes the first light-changing times within the corresponding time window over multiple days; the first light-changing time represents the relative time information of the red light changing to the green light;

[0151] The second determining module 303 is used to determine the cycle dispersion of each candidate cycle for each time window based on the first light-changing moment set of the time window and a set of preset candidate cycles; wherein, the cycle dispersion characterizes the matching degree between the candidate cycle and the first light-changing moment in the time window.

[0152] The third determining module 304 is used to determine the traffic light cycle of the time window based on the cycle dispersion corresponding to each candidate cycle.

[0153] In one possible implementation, the second determining module 303 is configured to:

[0154] For each time window, iterate through multiple candidate periods and perform the following steps:

[0155] Based on the current candidate period and the first set of light-changing times in the time window, the third set of light-changing times in the time window is determined; wherein, the third set of light-changing times includes multiple third light-changing times, and the third light-changing times represent the time information after the first light-changing times are mapped to the current candidate period;

[0156] For each third light-changing moment, determine the phase distance between that third light-changing moment and other third light-changing moments;

[0157] Based on the phase distance, the fourth light-changing time is determined from the third light-changing time; among them, the sum of the phase distances between the fourth light-changing time and the other third light-changing times is minimized;

[0158] The periodicity of the current candidate period is determined based on the current candidate period and the phase distance between the fourth lamp change time and other third lamp change times.

[0159] In one possible implementation, the second determining module 303 is configured to:

[0160] For each first light-changing moment in the set of first light-changing moments within the time window, the ratio of that first light-changing moment to the current candidate cycle is rounded down to obtain the rounded value.

[0161] Subtract the product of the rounded value and the current candidate cycle from the first light-changing time to obtain the third light-changing time corresponding to the first light-changing time.

[0162] In one possible implementation, the second determining module 303 is configured to:

[0163] The difference between the third light-changing time and other third light-changing times is calculated to obtain the first difference and the second difference.

[0164] The first difference and the second difference are respectively moduloed with the current candidate period to obtain the first modulo value and the second modulo value;

[0165] The minimum value between the first and second moduli is used as the distance between the third light-changing moment and other third light-changing moments.

[0166] In one possible implementation, the second determining module 303 is configured to:

[0167] The variance is determined based on the sum of squares of the phase distances between the fourth light-changing moment and the other third light-changing moments, and the number of third light-changing moments included in the set of third light-changing moments.

[0168] The ratio of the variance value to the current candidate period is used as the initial discrete value;

[0169] The penalty value is determined based on the current candidate period and the maximum value among multiple candidate periods;

[0170] Based on the initial discrete value and the penalty value, the periodicity of the current candidate period is obtained.

[0171] In one possible implementation, the first determining module 302 is configured to:

[0172] Based on traffic light behavior information, the set of second light-changing times for each time window is determined; wherein, the set of second light-changing times for each time window includes the second light-changing times within the corresponding time windows of multiple days; the second light-changing time represents the absolute time information of the red light turning into the green light;

[0173] For the same time window, the second light-changing moments within the second light-changing moment set of the time window are phase-aligned to obtain the first light-changing moment set of the time window.

[0174] In one possible implementation, the waiting-at-the-light behavior information includes the start time of waiting, the duration of waiting, and the distance to the waiting area; the first determining module 302 is used for:

[0175] For each day's waiting-at-the-light behavior information, based on a preset distance correction coefficient and the waiting-at-the-light distance information for that behavior, time error information is determined; wherein, time error information represents the time error caused from the parking position to the traffic light position;

[0176] Based on the start time information, waiting time information, and time error information of the waiting behavior information, the second light-changing time corresponding to the waiting behavior information is determined.

[0177] The second light-changing time corresponding to each light-changing behavior information is divided into multiple time windows to obtain the set of second light-changing times for each time window.

[0178] In one possible implementation, the device further includes a fourth determining module for:

[0179] Based on the traffic light cycles of adjacent time windows, determine the candidate cycle transition time;

[0180] For each candidate cycle transition moment, extract multiple preceding first light transition moments that are before the candidate cycle transition moment and multiple subsequent first light transition moments that are after the candidate cycle transition moment from the set of first light transition moments.

[0181] Based on multiple preceding first light-changing times and multiple candidate cycles, the cycle dispersion before the cycle jump is determined; and based on multiple subsequent first light-changing times and multiple candidate cycles, the cycle dispersion after the cycle jump is determined.

[0182] The candidate periodic transition moment that minimizes the sum of the periodic dispersion before and after the periodic transition will be taken as the final periodic transition moment.

[0183] The traffic light cycle determination device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0184] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 400 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the electronic device 400 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus.

[0185] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to perform the above-described method.

[0186] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0187] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0188] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0189] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0190] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0191] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0192] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0193] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0194] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0195] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0196] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0197] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0198] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0199] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for determining the cycle of a traffic light, characterized in that, include: Obtain information on waiting behavior at the target traffic light intersection over multiple days; Based on the traffic light behavior information over multiple days, a set of first light-changing times for multiple time windows is determined; wherein, the set of first light-changing times for each time window includes the first light-changing times within the corresponding time window over multiple days; the first light-changing times represent the relative time information of the red light changing to the green light; For each time window, based on the first light-changing moment set of that time window and a set of preset candidate periods, the period dispersion corresponding to each candidate period is determined; wherein, the period dispersion characterizes the matching degree between the candidate period and the first light-changing moment within that time window; The traffic light cycle for that time window is determined based on the cycle dispersion corresponding to each candidate cycle.

2. The method according to claim 1, characterized in that, For each time window, based on the first set of light-changing times within that time window and multiple preset candidate periods, the period dispersion corresponding to each candidate period is determined, including: For each time window, iterate through the multiple candidate periods and perform the following steps: Based on the current candidate period and the first set of light-changing times in the time window, the third set of light-changing times in the time window is determined; wherein, the third set of light-changing times includes multiple third light-changing times, and the third light-changing times represent the time information after the first light-changing times are mapped to the current candidate period; For each third light-changing moment, determine the phase distance between that third light-changing moment and other third light-changing moments; Based on the phase distance, the fourth light-changing time is determined from the third light-changing times; wherein the sum of the phase distances between the fourth light-changing time and the other third light-changing times is the smallest; The periodicity of the current candidate period is determined based on the current candidate period and the phase distance between the fourth lamp change time and other third lamp change times.

3. The method according to claim 2, characterized in that, The process of determining the third set of light-changing times for the time window based on the current candidate cycle and the first set of light-changing times for that time window includes: For each first light-changing moment in the first light-changing moment set of the time window, the ratio of the first light-changing moment to the current candidate cycle is rounded to obtain the rounded value. Subtract the product of the rounded value and the current candidate cycle from the first light-changing time to obtain the third light-changing time corresponding to the first light-changing time.

4. The method according to claim 2, characterized in that, The step of determining the phase distance between each third lamp-changing moment and other third lamp-changing moments includes: The difference between the third light-changing moment and the other third light-changing moments is calculated to obtain the first difference and the second difference. The first difference and the second difference are respectively subjected to modulo operation with the current candidate period to obtain the first modulo value and the second modulo value; The minimum value between the first modulus and the second modulus is used as the distance between the third light-changing moment and other third light-changing moments.

5. The method according to claim 2, characterized in that, The determination of the period dispersion of the current candidate period based on the current candidate period and the phase distance between the fourth lamp-changing time and other third lamp-changing times includes: The variance value is determined based on the sum of squares of the phase distances between the fourth light-changing moment and other third light-changing moments, and the number of third light-changing moments included in the set of third light-changing moments; The ratio of the variance value to the current candidate period is used as the initial discrete value; The penalty value is determined based on the current candidate period and the maximum value among the multiple candidate periods; Based on the initial discrete value and the penalty value, the periodic discreteness of the current candidate period is obtained.

6. The method according to claim 1, characterized in that, The determination of the first set of light-changing times for multiple time windows based on the lighting behavior information over multiple days includes: Based on the aforementioned traffic light behavior information, a set of second light-changing times for each time window is determined; wherein, the set of second light-changing times for each time window includes the second light-changing times within the corresponding time windows of multiple days; the second light-changing time represents the absolute time information of the red light changing to the green light; For the same time window, the second light-changing moments within the second light-changing moment set of the time window are phase-aligned to obtain the first light-changing moment set of the time window.

7. The method according to claim 6, characterized in that, The waiting-at-the-light behavior information includes the start time of waiting, the duration of waiting, and the distance to the light; the step of determining the second light-changing time set for each time window based on the waiting-at-the-light behavior information includes: For each day's waiting-at-the-light behavior information, time error information is determined based on a preset distance correction coefficient and the waiting-at-the-light distance information of that waiting-at-the-light behavior information; wherein, the time error information represents the time error caused from the parking position to the traffic light position; Based on the start time information, waiting duration information, and time error information of the waiting behavior information, the second light-changing time corresponding to the waiting behavior information is determined. The second light-changing time corresponding to each light-changing behavior information is divided into multiple time windows to obtain the set of second light-changing times for each time window.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: Based on the traffic light cycles of adjacent time windows, determine the candidate cycle transition time; For each candidate cycle transition moment, extract from the first light-changing moment set multiple preceding first light-changing moments that are before the candidate cycle transition moment, and multiple subsequent first light-changing moments that are after the candidate cycle transition moment; Based on the multiple preceding first light-changing times and the multiple candidate cycles, the cycle dispersion before the cycle jump is determined; and based on the multiple subsequent first light-changing times and the multiple candidate cycles, the cycle dispersion after the cycle jump is determined. The candidate periodic transition moment that minimizes the sum of the periodic dispersion before and after the periodic transition is taken as the final periodic transition moment.

9. A device for determining the cycle of a traffic light, characterized in that, include: The acquisition module is used to obtain waiting behavior information for multiple days at the target traffic light intersection; The first determining module is used to determine a set of first light-changing times for multiple time windows based on the light-waiting behavior information over multiple days; wherein, the set of first light-changing times for each time window includes the first light-changing times within the corresponding time window over multiple days; the first light-changing times represent the relative time information of the red light changing to the green light; The second determining module is used to determine the cycle dispersion of each candidate cycle for each time window based on the first light-changing moment set of the time window and a set of preset candidate cycles; wherein the cycle dispersion characterizes the matching degree between the candidate cycle and the first light-changing moment in the time window. The third determining module is used to determine the traffic light cycle of the time window based on the cycle dispersion corresponding to each candidate cycle.

10. An electronic device / computer-readable storage medium / computer program product, characterized in that, The electronic device includes: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8; The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8; The computer program product includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1-8.