A method for generating traffic light signals based on phase names

By generating a signal light method based on the phase name and automatically generating a signal light color array using the direction and turn keyword array, the shortcomings of the existing technology of manually generating a signal light color comparison table are solved, and calculation errors are reduced and efficiency is improved.

CN120544368BActive Publication Date: 2025-09-23SHENZHEN XIYUE ZHIHUI DATA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510999483.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-09-23
Estimated Expiration
2045-07-21

AI Technical Summary

Technical Problem

In the existing technology for optimizing road intersection signals, it is necessary to manually generate a signal light color comparison table, which is difficult to adapt to various intersection conditions and may cause calculation errors.

Method used

By generating a signal light method based on the phase name and utilizing the direction and turn keyword arrays, the signal light color array is automatically generated, including the calculation of the driving light and pedestrian light status, thus reducing manual calculations and errors.

Benefits of technology

It realizes the automatic generation of standard signal light color comparison table according to phase name, reducing the complicated calculation and error probability of manual setting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120544368B_ABST
    Figure CN120544368B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating traffic light signals based on phase names, relating to the technical field of road traffic control. The method specifically comprises the steps of obtaining a direction keyword array and a turn keyword array based on a set phase name, simultaneously reading an array manually set to indicate whether each direction at an intersection is a semi-crossing pedestrian light, initializing a light color array to all zeros, calculating the state of vehicle running lights, assigning values ​​to the light color array, obtaining a running light array, calculating the state of pedestrian lights based on the running light array, obtaining a pedestrian light array, and controlling the running lights and pedestrian lights based on the running light array and the pedestrian light array. The present invention automatically generates a standard traffic light color comparison table based on the phase name, reducing the complex calculations required for manual setup and the probability of error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of road traffic control, and in particular to a method for generating traffic light signals according to phase names. Background Art

[0002] When optimizing intelligent signal scheduling at road intersections, it is usually necessary to define different phases based on the actual conditions of the intersection. The phases define the colors of signal lights in each direction of the intersection. Based on actual needs, the color of signal lights in any direction can be manually specified. However, in actual applications, the system usually needs to generate a standard light color comparison table first, and then manually modify it. However, this cannot adapt to the conditions of various intersections, and temporary manual modifications may result in calculation errors. Summary of the Invention

[0003] The purpose of the present invention is to propose a method for generating a traffic light signal according to a phase name, so as to solve one or more technical problems existing in the prior art and at least provide a beneficial option or create conditions.

[0004] In order to achieve the above technical objectives, the technical solutions of the present invention are as follows:

[0005] In a first aspect, the present invention provides a method for generating a signal light signal according to a phase name, the method comprising the following steps:

[0006] Step 1: According to the set phase name, obtain its direction keyword array and turn keyword array, and at the same time read the array of whether the manually set intersection is a half-street pedestrian light in each direction, and initialize the light color array to all 0;

[0007] Step 2: Calculate the state of the car's driving lights, assign values ​​to the light color array, and obtain the driving light array;

[0008] Step 3, calculating the pedestrian light state according to the driving light array to obtain the pedestrian light array;

[0009] Step 4: Control the driving lights and pedestrian lights according to the driving light array and the pedestrian light array.

[0010] Furthermore, in step 1, according to the set phase name, the direction keyword array and the turn keyword array are obtained, and at the same time, the array of whether the manually set intersection direction is a half-street pedestrian light is read, and the sub-steps of initializing the light color array to all 0s are as follows:

[0011] Construct the direction array Dir[c] and the turn array Turn[d], with the value ranges of variables c and d being [0, C] and [0, D];

[0012] Among them, the value of constant C is 1, and the value of constant D is 1;

[0013] Initialize the array Dir[c] so that all values ​​in the array Dir[c] are -1;

[0014] If any one or two of the keywords "north, west, south, east" exist in the set phase name, Dir[0] is selected from the direction array Dir[c] to store the number corresponding to the first keyword found, and Dir[1] is selected to store the number corresponding to the second keyword found;

[0015] Initialize the value stored in Turn[d] to -1, indicating that the keyword "does not exist". If one or two keywords among "left, straight, right, through" exist in the phase name, Turn[0] stores the number corresponding to the first keyword found (left is 0, straight is 1, right is 2, through is 3), and Turn[1] stores the number corresponding to the second keyword found (left is 0, straight is 1, right is 2, through is 3).

[0016] The array TC[e] stores whether the intersection is a half-crossing pedestrian light in each direction, and the value range of the variable e is [0, E];

[0017] Set variable k = 0, k's value range is [0, E], and E's value is 3; k's values ​​0 to 3 represent the directions of east, west, south, and north, respectively. The content stored in the array is 1, indicating that the pedestrian light is half-crossing. From the perspective of the driver of the vehicle entering the lane at the intersection, the pedestrian light in this direction is divided into left and right parts, respectively recorded as "left crossing" and "right crossing". The content stored in the array is 0, indicating that the pedestrian light is fully crossing, recorded as "full crossing".

[0018] Construct a two-dimensional array Color(a, b) to store the light color status. Variable a represents the position of the signal light, and variable b represents the type of the signal light. Each element in the array represents a control entry for the signal light. Variable a has a value range of [0, A], and variable b has a value range of [0, B]. The value of A is 3, and the value of B is 6. There are a total of A×B control entries for the signal light.

[0019] According to the obtained traffic light installation status, the status entry of each traffic light is initialized: traverse the control entry of the traffic light in the light color array, if the status entry of the traffic light is red, set the value of the control entry of the corresponding traffic light to 0, if the status entry of the traffic light is green, set the value of the corresponding control entry to 1.

[0020] Preferably, the color of the signal light also includes yellow, and the elements in the light color array are stored using integers.

[0021] Initialize the status entry of each signal light according to the obtained installation status of the signal light: traverse the control entry of the signal light in the light color array. If the hardware corresponding to the status entry of the signal light is not installed, set the value of the control entry of the corresponding signal light to the modification according to the previous text. If the hardware corresponding to the status entry of the signal light exists, set the value of the corresponding control entry to 0.

[0022] Furthermore, in step 2, the state of the vehicle's driving lights is calculated, and the light color array is assigned. The sub-steps for obtaining the driving light array are:

[0023] Assign Color(i,j) through the direction array and the steering array. The sub-steps are:

[0024] Construct a direction intermediate value array byteDir, and construct a relationship between the direction intermediate value array and the direction array byteDir[i]=(Dir[i]×2+1)×2;

[0025] Construct the redirection array assignment condition to obtain the redirection sub-parameter nDirIndex:

[0026] When (Dir[i]==0 or Dir[i]==3) is true, nDirIndex= (3-Dir[i]), otherwise it is Dir[i];

[0027] When Turn[j] is 0, 1, or 2, set Color[nDirIndex][Turn[j]] to 1. When Turn[j] is 3, set Color[nDirIndex][0] to 1 and Color[nDirIndex][1] to 1.

[0028] Calculate each turn signal variable byteTurn = (((Dir[i]×2+1)+ k)%8)×2, and the pedestrian light variable byteLight = byteLight|(byteDir|byteTurn); where k is a variable and | is a bitwise OR operator. It performs a logical OR operation on each corresponding binary bit of the left and right operands and returns the result. The so-called logical OR operation is 1 when any of the corresponding bits is 1, otherwise it is 0.

[0029] byteLight calculation method:

[0030] When Turn[j] is 0, k is 5. When Turn[j] is 1, k is 3. When Turn[j] is 2, k does not need to be assigned a value. When Turn[j] is 3, set the value of k to 5 and calculate byteLight. Then set the value of k to 3 and calculate byteLight.

[0031] Furthermore, in step 3, the pedestrian light state is calculated based on the driving light array, and the sub-steps for obtaining the pedestrian light array are:

[0032] Traverse the variable i and calculate the redirection sub-parameter nDirIndex. The sub-steps are:

[0033] When (i=0 or i=3) is true, nDirIndex=(3-i), otherwise it is i, calculate the variable nPhaseIndex, and when (i<2) is true, nPhaseIndex=(1-i), otherwise nPhaseIndex=(5-i);

[0034] If the direction is a half-crossing pedestrian light, that is, TC[i] is 1, then according to the calculated direction light variable byteDir=(nDirIndex×2)×2:

[0035] Get the value of the light color array Color(a,b) according to the steering sub-parameter nDirIndex:

[0036] Calculate the status of the left pedestrian light in this direction as Color[nPhaseIndex][4]=(byteLight&byteDir)==0);

[0037] Set the direction light variable to byteDir=(nDirIndex×2+1)×2;

[0038] Calculate the right pedestrian light status in this direction as Color[nPhaseIndex][5]=(byteLight&byteDir)==0);

[0039] If the direction is full-street pedestrian lights, that is, TC[i] is 0, then according to the direction light variable byteDir=(nDirIndex×2)×8, the pedestrian light status of this direction is obtained as Color[nPhaseIndex][6]=(byteLight&byteDir)==0);

[0040] Among them, & is the bitwise AND operator, which performs a logical AND operation on each binary bit of the left and right operands and returns the result. The so-called logical AND operation is that when all the corresponding bits are 1, the result is 1, otherwise it is 0.

[0041] Preferably, the symbol "==" is a logical judgment operator, which returns 1 if the expressions on the left and right sides of the symbol are equal, and returns 0 if they are not equal.

[0042] Furthermore, in step 4, the sub-steps of controlling the driving lights and pedestrian lights according to the driving light array and the pedestrian light array are:

[0043] The driving lights and pedestrian lights are controlled according to the obtained light color array Color(a, b).

[0044] Preferably, if the value in the light color array Color(a, b) is 1, the corresponding signal light color is green, otherwise it is red.

[0045] Preferably, all undefined variables in the present invention, if not clearly defined, can be manually set thresholds.

[0046] This technical solution can automatically generate a standard signal light color comparison table based on the phase name, reducing the complicated calculations of manual settings and reducing the probability of errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 The present invention provides a flow chart of a method for generating a traffic light signal according to a phase name. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. The specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0049] It should also be understood that the following examples are only used to further illustrate the present invention and are not to be construed as limiting the scope of protection of the present invention. Any non-essential improvements and adjustments made by those skilled in the art based on the above-mentioned disclosure of the present invention fall within the scope of protection of the present invention. The specific process parameters and the like in the following examples are merely examples within a suitable range, and those skilled in the art can make appropriate selections based on the description herein, and are not to be limited to the specific values ​​exemplified below.

[0050] The following exemplifies a method for generating a traffic light signal according to a phase name provided by the present invention.

[0051] like Figure 1 The following is a flow chart of a method for generating a signal light signal according to a phase name. Figure 1 A method for generating a traffic light signal according to a phase name according to an embodiment of the present invention is described below. The method includes the following steps:

[0052] Step 1: According to the set phase name, obtain its direction keyword array and turn keyword array, and at the same time read the array of whether the manually set intersection is a half-street pedestrian light in each direction, and initialize the light color array to all 0;

[0053] Step 2: Calculate the state of the car's driving lights, assign values ​​to the light color array, and obtain the driving light array;

[0054] Step 3, calculating the pedestrian light state according to the driving light array to obtain the pedestrian light array;

[0055] Step 4: Control the driving lights and pedestrian lights according to the driving light array and the pedestrian light array.

[0056] Furthermore, in step 1, according to the set phase name, the direction keyword array and the turn keyword array are obtained, and at the same time, the array of whether the manually set intersection direction is a half-street pedestrian light is read, and the sub-steps of initializing the light color array to all 0s are as follows:

[0057] Construct the direction array Dir[c] and the turn array Turn[d], with the value ranges of variables c and d being [0, C] and [0, D];

[0058] Among them, the value of constant C is 1, and the value of constant D is 1;

[0059] Initialize the array Dir[c] so that all values ​​in the array Dir[c] are -1;

[0060] If any one or two of the keywords "north, west, south, east" exist in the set phase name, Dir[0] is selected from the direction array Dir[c] to store the number corresponding to the first keyword found, and Dir[1] is selected to store the number corresponding to the second keyword found;

[0061] Initialize the value stored in Turn[d] to -1, indicating that the keyword "does not exist". If one or two keywords among "left, straight, right, through" exist in the phase name, Turn[0] stores the number corresponding to the first keyword found (left is 0, straight is 1, right is 2, through is 3), and Turn[1] stores the number corresponding to the second keyword found (left is 0, straight is 1, right is 2, through is 3).

[0062] Assume that the phase name must contain words describing the direction (direction keywords: north, west, south, east) and words describing the turn (turn keywords: left, straight, right, through), where "through" means that both left and straight are passable, and there are one to two direction keywords and one to two turn keywords. The phase name describes which turning lanes in that direction get the green light signal during the phase execution. The phase name can be described by two array variables, the direction keyword array Dir[2] and the turn keyword array Turn[2]. The value range is -1 to 3, where -1 is the initial default value, which can be used to indicate that there is no corresponding keyword in the phase name. 0 to 3 correspond to the above-mentioned "north, west, south, east" and "left, straight, right, through" in order.

[0063] The indexes of the two arrays can only be 0 and 1, which means that there are at most two direction keywords and two steering keywords in the phase name, and the values ​​stored in the arrays can be one of -1, 0, 1, 2, and 3.

[0064] The array TC[e] stores whether the intersection is a half-crossing pedestrian light in each direction, and the value range of the variable e is [0, E];

[0065] Set variable k = 0, k's value range is [0, E], and E's value is 3; k's values ​​0 to 3 represent the directions of east, west, south, and north, respectively. The content stored in the array is 1, indicating that the pedestrian light is half-crossing. From the perspective of the driver of the vehicle entering the lane at the intersection, the pedestrian light in this direction is divided into left and right parts, respectively recorded as "left crossing" and "right crossing". The content stored in the array is 0, indicating that the pedestrian light is fully crossing, recorded as "full crossing".

[0066] Construct a two-dimensional array Color(a, b) to store the light color status. Variable a represents the position of the signal light, and variable b represents the type of the signal light. Each element in the array represents a control entry for the signal light. Variable a has a value range of [0, A], and variable b has a value range of [0, B]. The value of A is 3, and the value of B is 6. There are a total of A×B control entries for the signal light.

[0067] According to the obtained traffic light installation status, the status entry of each traffic light is initialized: traverse the control entry of the traffic light in the light color array, if the status entry of the traffic light is red, set the value of the control entry of the corresponding traffic light to 0, if the status entry of the traffic light is green, set the value of the corresponding control entry to 1.

[0068] Preferably, the color of the signal light also includes yellow, and the elements in the light color array are stored using integers.

[0069] Initialize the status entry of each signal light according to the obtained installation status of the signal light: traverse the control entry of the signal light in the light color array. If the hardware corresponding to the status entry of the signal light is not installed, set the value of the control entry of the corresponding signal light to the modification according to the previous text. If the hardware corresponding to the status entry of the signal light exists, set the value of the corresponding control entry to 0.

[0070] Preferably, the signal light color comparison table is a two-dimensional array Color[4][7], in which the first dimension represents four directions, and the index values ​​0 to 3 represent the directions of east, west, south, and north respectively. The second dimension represents seven different signal light types (left turn, straight ahead, right turn, U-turn, left crossing, right crossing, full crossing, corresponding index values ​​0 to 6). The two-dimensional array stores the value 0 or 1, 1 represents the green light color, 0 represents the red light color, and all are 0 when initialized. This signal light color comparison table is used to describe the signal light green light configuration when a phase with a specified phase name is actually executed. In reality, when switching between phases (green light turns red light), there are transition light colors. Common ones are green flashing for 3 seconds, followed by yellow light for 3 seconds, and then full red for 1 second. Since the transition light colors are relatively fixed, they are ignored here.

[0071] Furthermore, in step 2, the state of the vehicle's driving lights is calculated, and the light color array is assigned. The sub-steps for obtaining the driving light array are:

[0072] Assign Color(i,j) through the direction array and the steering array. The sub-steps are:

[0073] Construct a direction intermediate value array byteDir, and construct a relationship between the direction intermediate value array and the direction array byteDir[i]=(Dir[i]×2+1)×2;

[0074] Construct the redirection array assignment condition to obtain the redirection sub-parameter nDirIndex:

[0075] When (Dir[i]==0 or Dir[i]==3) is true, nDirIndex= (3-Dir[i]), otherwise it is Dir[i];

[0076] When Turn[j] is 0, 1, or 2, set Color[nDirIndex][Turn[j]] to 1. When Turn[j] is 3, set Color[nDirIndex][0] to 1 and Color[nDirIndex][1] to 1.

[0077] Calculate each turn signal variable byteTurn = (((Dir[i]×2+1)+ k)%8)×2, and the pedestrian light variable byteLight = byteLight|(byteDir|byteTurn); where k is a variable and | is a bitwise OR operator. It performs a logical OR operation on each corresponding binary bit of the left and right operands and returns the result. The so-called logical OR operation is 1 when any of the corresponding bits is 1, otherwise it is 0.

[0078] byteLight calculation method:

[0079] When Turn[j] is 0, k is 5. When Turn[j] is 1, k is 3. When Turn[j] is 2, k does not need to be assigned a value. When Turn[j] is 3, set the value of k to 5 and calculate byteLight. Then set the value of k to 3 and calculate byteLight.

[0080] Furthermore, in step 3, the pedestrian light state is calculated based on the driving light array, and the sub-steps for obtaining the pedestrian light array are:

[0081] Traverse the variable i and calculate the redirection sub-parameter nDirIndex. The sub-steps are:

[0082] When (i=0 or i=3) is true, nDirIndex=(3-i), otherwise it is i, calculate the variable nPhaseIndex, and when (i<2) is true, nPhaseIndex=(1-i), otherwise nPhaseIndex=(5-i);

[0083] If the direction is a half-crossing pedestrian light, that is, TC[i] is 1, then according to the calculated direction light variable byteDir=(nDirIndex×2)×2:

[0084] Get the value of the light color array Color(a,b) according to the steering sub-parameter nDirIndex:

[0085] Calculate the status of the left pedestrian light in this direction as Color[nPhaseIndex][4]=(byteLight&byteDir)==0);

[0086] Set the direction light variable to byteDir=(nDirIndex×2+1)×2;

[0087] Calculate the right pedestrian light status in this direction as Color[nPhaseIndex][5]=(byteLight&byteDir)==0);

[0088] If the direction is full-street pedestrian lights, that is, TC[i] is 0, then according to the direction light variable byteDir=(nDirIndex×2)×8, the pedestrian light status of this direction is obtained as Color[nPhaseIndex][6]=(byteLight&byteDir)==0);

[0089] Among them, & is the bitwise AND operator, which performs a logical AND operation on each binary bit of the left and right operands and returns the result. The so-called logical AND operation is that when all the corresponding bits are 1, the result is 1, otherwise it is 0.

[0090] Preferably, the symbol "==" is a logical judgment operator, which returns 1 if the expressions on the left and right sides of the symbol are equal, and returns 0 if they are not equal.

[0091] Furthermore, in step 4, the sub-steps of controlling the driving lights and pedestrian lights according to the driving light array and the pedestrian light array are:

[0092] The driving lights and pedestrian lights are controlled according to the obtained light color array Color(a, b).

[0093] Preferably, if the value in the light color array Color(a, b) is 1, the corresponding signal light color is green, otherwise it is red.

[0094] Preferably, all undefined variables in the present invention, if not clearly defined, can be manually set thresholds.

[0095] The method for generating a signal light signal based on a phase name can be run on computing devices such as desktop computers, laptops, PDAs, and cloud servers. Systems capable of running the method for generating a signal light signal based on a phase name may include, but are not limited to, a processor and memory. Those skilled in the art will appreciate that the example is merely an illustration of a method for generating a signal light signal based on a phase name and does not constitute a limitation on the method. The method may include more or fewer components than the example, or a combination of certain components, or different components. For example, the method for generating a signal light signal based on a phase name may also include input / output devices, network access devices, buses, and the like.

[0096] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor serves as the control center of the system for operating the method for generating a signal light signal according to a phase name, and utilizes various interfaces and lines to connect various parts of the system for operating the method for generating a signal light signal according to a phase name.

[0097] The memory can be used to store the computer program and / or module. The processor implements the various functions of the method for generating a traffic light signal based on a phase name by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include random access memory (RAM) and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0098] Although the present invention has been described in considerable detail and with particularity with respect to several embodiments, it is not intended to limit the present invention to any of these details or embodiments or any particular embodiment, so as to effectively encompass the intended scope of the present invention. In addition, the present invention has been described above with respect to embodiments foreseen by the inventors for the purpose of providing a useful description, and those insubstantial modifications of the present invention that are not currently foreseen may still represent equivalent modifications of the present invention.

[0099] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative uses of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0100] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions, and alterations may be made to the embodiments without departing from the principles and spirit of the invention.

Claims

1. A method for generating a traffic light signal according to a phase name, characterized in that: The method comprises the following steps: Step 1: According to the set phase name, obtain its direction keyword array and turn keyword array, and at the same time read the array of whether the manually set intersection is a half-street pedestrian light in each direction, and initialize the light color array to all 0; Step 2: Calculate the state of the car's driving lights, assign values ​​to the light color array, and obtain the driving light array; Step 3, calculating the pedestrian light state according to the driving light array to obtain the pedestrian light array; Step 4: Control the driving lights and pedestrian lights according to the driving light array and the pedestrian light array; wherein the signal lights include vehicle driving lights and pedestrian lights. In step 1, the direction keyword array and the turn keyword array are obtained according to the set phase name, and the array of whether each direction of the intersection is a half-crossing pedestrian light is read manually, and the sub-step of initializing the light color array to all 0 is as follows: Construct the direction array Dir[c] and the turn array Turn[d], with the value ranges of variables c and d being [0, C] and [0, D]; Among them, the value of constant C is 1, and the value of constant D is 1; Initialize the array Dir[c] so that all values ​​in the array Dir[c] are -1; If any one or two keywords among "north, west, south, east" exist in the set phase name, Dir[0] is selected from the direction array Dir[c] to store the number corresponding to the first keyword found, and Dir[1] is selected to store the number corresponding to the second keyword found; Initialize the value stored in Turn[d] to -1, indicating that the keyword "does not exist". If one or two keywords "left, straight, right, through" exist in the phase name, Turn[0] stores the number corresponding to the first keyword found, and Turn[1] stores the number corresponding to the second keyword found; wherein, the numbers are used to describe the direction; The array TC[e] stores whether the intersection is a half-crossing pedestrian light in each direction, and the value range of the variable e is [0, E]; Set variable k to 0, with values ​​in the range [0, E] and E being 3. Values ​​0 to 3 represent the directions east, west, south, and north, respectively. A value of 1 in the array indicates a half-crossing pedestrian light. From the perspective of drivers entering the intersection, the pedestrian light in that direction is divided into left and right sections, respectively labeled "left crossing" and "right crossing." A value of 0 in the array indicates a full-crossing pedestrian light, labeled "full crossing." Construct a two-dimensional array Color(a, b) to store the light color status. Variable a represents the position of the signal light, and variable b represents the type of the signal light. Each element in the array represents a control entry for the signal light. Variable a has a value range of [0, A], and variable b has a value range of [0, B]. The value of A is 3, and the value of B is 6. There are a total of A×B control entries for the signal light. According to the obtained traffic light installation status, the status entry of each traffic light is initialized: traverse the control entry of the traffic light in the light color array, if the status entry of the traffic light is red, set the value of the control entry of the corresponding traffic light to 0, if the status entry of the traffic light is green, set the value of the corresponding control entry to 1.

2. The method for generating a traffic light signal according to a phase name according to claim 1, characterized in that: In step 2, the state of the car's driving lights is calculated and the light color array is assigned. The sub-steps for obtaining the driving light array are: Assign Color(i,j) through the direction array and the steering array. The sub-steps are: Construct a direction intermediate value array byteDir, and construct a relationship between the direction intermediate value array and the direction array byteDir[i]=(Dir[i]×2+1)×2; Construct the redirection array assignment condition to obtain the redirection sub-parameter nDirIndex: When (Dir[i]==0 or Dir[i]==3) is true, nDirIndex= (3-Dir[i]), otherwise it is Dir[i]; When Turn[j] is 0, 1, or 2, set Color[nDirIndex][Turn[j]] to 1. When Turn[j] is 3, set Color[nDirIndex][0] to 1 and Color[nDirIndex][1] to 1. Calculate each turn signal variable byteTurn = (((Dir[i]×2+1)+ k)%8)×2, and the pedestrian light variable byteLight = byteLight|(byteDir|byteTurn); where k is a variable and | is a bitwise OR operator. It performs a logical OR operation on each corresponding binary bit of the left and right operands and returns the result. The so-called logical OR operation is 1 when any of the corresponding bits is 1, otherwise it is 0. byteLight calculation method: When Turn[j] is 0, k is 5. When Turn[j] is 1, k is 3. When Turn[j] is 2, k does not need to be assigned a value. When Turn[j] is 3, set the value of k to 5 and calculate byteLight. Then set the value of k to 3 and calculate byteLight.

3. The method for generating a traffic light signal according to a phase name according to claim 2, characterized in that: In step 3, the pedestrian light status is calculated based on the driving light array. The sub-steps for obtaining the pedestrian light array are: Traverse the variable i and calculate the redirection sub-parameter nDirIndex. The sub-steps are: When (i=0 or i=3) is true, nDirIndex=(3-i), otherwise it is i, calculate the variable nPhaseIndex, and when (i<2) is true, nPhaseIndex=(1-i), otherwise nPhaseIndex=(5-i); If the direction is a half-crossing pedestrian light, that is, TC[i] is 1, then according to the calculated direction light variable byteDir=(nDirIndex×2)×2: Get the value of the light color array Color(a,b) according to the steering sub-parameter nDirIndex: Calculate the status of the left pedestrian light in this direction as Color[nPhaseIndex][4]=(byteLight&byteDir)==0); Set the direction light variable to byteDir=(nDirIndex×2+1)×2; Calculate the right pedestrian light status in this direction as Color[nPhaseIndex][5]=(byteLight&byteDir)==0); If the direction is full-street pedestrian lights, that is, TC[i] is 0, then according to the direction light variable byteDir=(nDirIndex×2)×8, the pedestrian light status of this direction is obtained as Color[nPhaseIndex][6]=(byteLight&byteDir)==0); Among them, & is the bitwise AND operator, which performs a logical AND operation on each binary bit of the left and right operands and returns the result. The so-called logical AND operation is that when all the corresponding bits are 1, the result is 1, otherwise it is 0.

4. The method for generating a traffic light signal according to a phase name according to claim 3, characterized in that: In step 4, the sub-steps of controlling the driving lights and pedestrian lights according to the driving light array and the pedestrian light array are: The driving lights and pedestrian lights are controlled according to the obtained light color array Color(a, b).

Citation Information

Patent Citations

  • Signal lamp set serialization control method of standard 4-phase crossing

    CN107085950A

  • Signal lamp duration data mining method, device, equipment, storage medium and system

    CN118397846A