Multi-source signal lamp data switching method and electronic equipment
Through the multi-source signal lamp data switching method of the main device and the redundant device, the problem of unreliable signal lamp data caused by reporting by a single device is solved, and the stable and reliable reporting of signal lamp data is achieved.
Patent Information
- Application Number
- CN202411612258.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-18
AI Technical Summary
The existing signal light data is reported only through a single device, which is prone to failure or network factors that cannot be reported, affecting the stable operation of cloud scenarios.
The multi-source signal lamp data switching method is adopted to report the signal lamp data simultaneously through the main device and the redundant device. When the main device signal lamp data fails, the redundant device signal lamp data is reported.
Ensure that the signal light data can be reported to the cloud system accurately and without redundancy, and ensure the stable and reliable reporting of the roadside signal light data.
Smart Images

Figure CN119479335A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle-related technology, and in particular to a multi-source signal light data switching method, electronic equipment, storage medium and computer program product. Background Art
[0002] With the continuous development of vehicle-road-cloud collaborative technology, the regular and accurate reporting of roadside traffic light data is crucial to the stable operation of cloud scenarios.
[0003] However, existing traffic light data is only reported through a single device, and the data may not be reported due to failures, network and other factors, affecting the operation of cloud scenarios. Summary of the invention
[0004] Based on this, it is necessary to provide a multi-source signal light data switching method, electronic device, storage medium and computer program product to address the technical problem in the prior art that signal light data is only reported through a single device.
[0005] The present invention provides a multi-source signal light data switching method, comprising:
[0006] Acquire the master device signal light data reported by the master device, and perform a reporting operation on the master device signal light data;
[0007] The redundant device signal light data reported by the redundant device is obtained, and when the data reported by the main device fails, a reporting operation is performed on the redundant device signal light data.
[0008] Further, the acquiring the master device signal light data reported by the master device and performing a reporting operation on the master device signal light data includes:
[0009] The master device signal light data reported by the master device is obtained, the current reporting time is recorded, and when the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, a reporting operation is performed on the master device signal light data.
[0010] Furthermore, the acquiring of the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold, includes:
[0011] Obtain the signal light data of the master device reported by the master device, and record the current timestamp of the master device that obtains the signal light data of the master device as the current reporting time;
[0012] Use the master device identifier of the master device as a keyword to search in the database:
[0013] When the keyword exists in the database, the associated value corresponding to the keyword is obtained as the initial reporting time, and the expiration time of the keyword is refreshed. When the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the reporting operation is performed on the main device signal light data.
[0014] Furthermore, the acquiring of the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold, further includes:
[0015] When the keyword does not exist in the database, the keyword is set in the database, the current reporting time is saved as the associated value corresponding to the keyword, and the expiration time of the keyword is set.
[0016] Further, the acquiring of redundant device signal light data reported by the redundant device and performing a reporting operation on the redundant device signal light data when the primary device reports a data failure includes:
[0017] The redundant device signal light data reported by the redundant device is obtained, and the main device identifier of the main device associated with the redundant device is used as a keyword to search in a database, and when the keyword does not exist in the database, the redundant device signal light data is reported.
[0018] Furthermore, the acquiring of redundant device signal light data reported by the redundant device and performing a reporting operation on the redundant device signal light data when the primary device reports a data failure, further includes:
[0019] When the keyword exists in the database, comparing the current timestamp of the redundant device with the associated value corresponding to the retrieved keyword, the current timestamp of the redundant device being the timestamp for obtaining the signal light data of the redundant device;
[0020] When the difference between the current timestamp of the redundant device and the associated value is greater than or equal to the time threshold, the reporting operation on the redundant device signal light data is terminated; otherwise, the reporting operation on the redundant device signal light data is performed.
[0021] Furthermore, the searching in the database using the master device identifier of the master device associated with the redundant device as a keyword includes:
[0022] According to the redundant device identifier of the redundant device, searching for the main device identifier of the main device associated with the redundant device identifier;
[0023] When the main device identifier associated with the redundant device identifier is not found, terminating the reporting operation on the redundant device signal light data;
[0024] When the main device identifier associated with the redundant device identifier is found, the main device identifier is used as a keyword to perform a search in the database.
[0025] The present invention provides an electronic device, comprising:
[0026] at least one processor; and,
[0027] a memory communicatively connected to at least one of the processors; wherein,
[0028] The memory stores instructions that can be executed by at least one of the processors. The instructions are executed by at least one of the processors to enable the at least one of the processors to execute the multi-source signal light data switching method as described above.
[0029] The present invention provides a storage medium, wherein the storage medium stores computer instructions. When a computer executes the computer instructions, the storage medium is used to execute all steps of the multi-source signal light data switching method as described above.
[0030] The present invention provides a computer program product, comprising a computer program / instruction, which implements the multi-source signal light data switching method as described above when executed by a processor.
[0031] The present invention reports traffic light data through a main device and a redundant device simultaneously. When the traffic light data of the main device fails, the traffic light data of the redundant device is reported, so that the traffic light data can be reported to the cloud system accurately and without redundancy, thereby ensuring stable and reliable reporting of roadside traffic light data. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a working flow chart of a multi-source signal light data switching method according to an embodiment of the present invention;
[0033] Figure 2 This is a working flow chart of a multi-source signal light data switching method according to another embodiment of the present invention;
[0034] Figure 3 A flowchart of a multi-source signal light data switching method according to a preferred embodiment of the present invention;
[0035] Figure 4 The figure is a schematic diagram of the hardware structure of an electronic device of the present invention. DETAILED DESCRIPTION
[0036] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings. The same components are represented by the same reference numerals. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.
[0037] like Figure 1 The figure shows a working flow chart of a multi-source signal light data switching method according to an embodiment of the present invention, comprising:
[0038] Step S101, obtaining the master device signal light data reported by the master device, and performing a reporting operation on the master device signal light data;
[0039] Step S102, obtaining redundant device signal light data reported by redundant devices, and performing a reporting operation on the redundant device signal light data when the primary device reports data failure.
[0040] Specifically, the present invention can be applied to electronic devices with processing capabilities in the cloud. The two data sources of this embodiment are the main device and the redundant device.
[0041] Specifically, the cloud electronic device executes step S101, obtains the master device signal light data reported by the master device, and performs a reporting operation on the master device signal light data.
[0042] The master device includes but is not limited to a mobile edge computing device (MEC). In general, the MEC device serves as the main data source reported by the traffic light. The traffic light data reported by the master device is the traffic light data of the master device.
[0043] The reporting operation is performed on the signal light data of the master device, that is, the signal light data of the master device is reported to the cloud system.
[0044] At the same time, step S102 is executed to obtain redundant device signal light data reported by the redundant device, and when the data reported by the master device fails, a reporting operation is performed on the redundant device signal light data.
[0045] The redundant equipment includes but is not limited to the Road Side Unit (RSU). Under normal circumstances, the RSU serves as the data source for redundant signal light reporting. The signal light data reported by the redundant equipment is the redundant equipment signal light data. When the signal light data of the main equipment is normal, the signal light data of the redundant equipment will be discarded. When the data reported by the main equipment fails, the reporting operation is performed on the signal light data of the redundant equipment.
[0046] The reporting operation is performed on the redundant device signal light data, that is, the redundant device signal light data is reported to the cloud system.
[0047] Among them, the reporting operation adopts the existing traffic light data reporting process. After the reporting operation is executed, the signal light data of the main device or the redundant device will enter the cloud system, and the cloud system will perform the corresponding operation. For example, when arriving at an intersection with a traffic light, the signal light data uploaded by the main device or the redundant device will be reported to the cloud, and the cloud will send the signal light data to the vehicle to tell the vehicle how many seconds the signal light will change. In this way, in assisted driving, the green light start function is realized, and the green light start reminder service is provided to the vehicle, or the red light running warning is provided to the vehicle. Reminder service.
[0048] The present invention reports traffic light data through a main device and a redundant device simultaneously. When the traffic light data of the main device fails, the traffic light data of the redundant device is reported, so that the traffic light data can be reported to the cloud system accurately and without redundancy, thereby ensuring stable and reliable reporting of roadside traffic light data.
[0049] like Figure 2 The figure shows a working flow chart of a multi-source signal light data switching method in another embodiment of the present invention, comprising:
[0050] Step S201, obtaining the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold.
[0051] Step S202, obtaining redundant device signal light data reported by redundant devices, searching in a database using the master device identifier of the master device associated with the redundant device as a keyword, and performing a reporting operation on the redundant device signal light data when the keyword does not exist in the database.
[0052] Specifically, first execute step S201 to obtain the master device signal light data reported by the master device, record the current reporting time, and when the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, perform a reporting operation on the master device signal light data.
[0053] Among them, the master device is preferably MEC.
[0054] The master device reports the master device signal light data, the cloud electronic device obtains the master device signal light data, and records the current timestamp as the current reporting time, and compares the difference between the current reporting time and the initial reporting time to determine whether the difference exceeds the time threshold. Preferably, the time threshold is 3 seconds. When the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the reporting operation is performed on the master device signal light data, and when the difference between the current reporting time and the initial reporting time is less than the time threshold, the process is terminated, and there is no need to perform a reporting operation on the master device signal light data.
[0055] On the other hand, execute step S202 to obtain the redundant device signal light data reported by the redundant device, and use the main device identifier of the main device associated with the redundant device as a keyword to search in the database. When the keyword does not exist in the database, perform a reporting operation on the redundant device signal light data.
[0056] Specifically, the redundant device is associated with the main device, for example, by associating the redundant device identifier with the main device identifier. Wherein the redundant device is preferably RSU, the redundant device identifier is RSUID. The data reported by the redundant device includes redundant device signal light data and redundant device identifier, so the redundant device identifier can be parsed from the data reported by the redundant device. Then, the main device identifier associated with the redundant device identifier is searched, and the database is searched using the main device identifier as a keyword. When the keyword does not exist in the database, it is determined that the main device reports a data failure, and a reporting operation is performed on the redundant device signal light data.
[0057] This embodiment associates the redundant device with the main device, and determines whether the main device reports a fault by retrieving the main device identifier. When the main device reports a fault, it promptly switches to the associated redundant device as the data source of the traffic light data, and reports the traffic light data of the redundant device, which greatly shortens the underreporting time of the traffic light data and reduces the time for manual troubleshooting.
[0058] In one of the embodiments, the acquiring of the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold, includes:
[0059] Obtain the signal light data of the master device reported by the master device, and record the current timestamp of the master device that obtains the signal light data of the master device as the current reporting time;
[0060] Use the master device identifier of the master device as a keyword to search in the database:
[0061] When the keyword exists in the database, the associated value corresponding to the keyword is obtained as the initial reporting time, and the expiration time of the keyword is refreshed. When the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the reporting operation is performed on the main device signal light data.
[0062] Specifically, when MEC is used as the master device, the master device identifier is MECID, which is the MEC number. The data reported by the master device includes the master device signal light data and the master device identifier, so the master device identifier can be parsed from the data reported by the master device.
[0063] The cloud electronic device associates and stores the main device identification and the reporting time through a database, wherein the main device identification is used as a keyword key, and the reporting time is stored as an associated word value corresponding to the keyword.
[0064] Preferably, a distributed cache middleware (redis) is used to associate and store the master device identifier and the reporting time.
[0065] When searching the database with the master device identifier as a keyword, the associated value corresponding to the keyword can be obtained. The associated value is the timestamp when the master device is first set, that is, the initial reporting time.
[0066] At the same time, in the database, the keyword is set with an expiration time. When the expiration time is reached and the expiration time is not refreshed, the keyword and the corresponding associated words will be discarded. Therefore, when a keyword is retrieved, the expiration time of the keyword is refreshed, that is, the expiration time is reset to avoid keyword expiration.
[0067] Then, the difference between the current reporting time and the initial reporting time is compared, and when the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the reporting operation is performed on the signal light data of the master device. When the difference between the current reporting time and the initial reporting time is less than the time threshold, the process is terminated without performing the reporting operation on the signal light data of the master device.
[0068] Specifically, when the difference between the current reporting time and the initial reporting time is less than the time threshold, it means that the master device has just set the keyword in the database. At this time, the master device is not stable. During this period, the redundant device acts as the provider of signal light data and provides redundant device signal light data. Therefore, during this period, the master device does not act as the provider of signal light data, and the master device signal light data reported by the master device does not perform the reporting operation. When the time threshold is passed, that is, when the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the master device has been stable, so the reporting operation is performed on the master device signal light data.
[0069] This embodiment associates and saves the keywords and associated values to quickly obtain the last reporting time for comparison and to determine whether data needs to be reported, thereby avoiding frequent switching.
[0070] In one of the embodiments, the acquiring of the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold, further includes:
[0071] When the keyword does not exist in the database, the keyword is set in the database, the current reporting time is saved as the associated value corresponding to the keyword, and the expiration time of the keyword is set.
[0072] Specifically, the main device identifier of the main device is used as a keyword to search in the database, and the search results are in two situations:
[0073] In the first case, the keyword exists, and the database has an initial reporting time saved, which needs to be compared. Therefore, when the keyword exists in the database, the associated value corresponding to the retrieved keyword is used as the initial reporting time, and the expiration time of the keyword is refreshed. When the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the master device signal light data is reported, and the associated value corresponding to the keyword is updated to the current reporting time;
[0074] The second case is that the keyword does not exist. The case where the keyword does not exist may be the first time the master device reports data, or it may be that the master device is unable to report due to failures, network and other factors, resulting in the keyword expiring and being deleted, and there is no initial reporting time in the database. Therefore, when the keyword does not exist in the database, the current reporting time is saved as the associated value corresponding to the keyword, and the expiration time of the keyword is set. When the master device initially sets the keyword, the master device signal light data will not perform a reporting operation because the master device is unstable. Until the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the master device has stabilized, so the master device signal light data is reported.
[0075] This embodiment searches for keywords to determine whether the keywords exist, so that data can be reported again after the main device recovers from a failure.
[0076] In one embodiment, the step of obtaining redundant device signal light data reported by redundant devices and performing a reporting operation on the redundant device signal light data when the master device reports a data failure includes:
[0077] The redundant device signal light data reported by the redundant device is obtained, and the main device identifier of the main device associated with the redundant device is used as a keyword to search in a database, and when the keyword does not exist in the database, the redundant device signal light data is reported.
[0078] Specifically, when the keyword does not exist in the database, the main device is likely unable to report due to failure, network and other factors, resulting in the keyword being deleted due to expiration. Therefore, at this time, the redundant device is used as the provider of the signal light data, and the redundant device signal light data is reported.
[0079] In one embodiment, the acquiring of redundant device signal light data reported by the redundant device and performing a reporting operation on the redundant device signal light data when the primary device reports a data failure further includes:
[0080] When the keyword exists in the database, comparing the current timestamp of the redundant device with the associated value corresponding to the retrieved keyword, the current timestamp of the redundant device being the timestamp for obtaining the signal light data of the redundant device;
[0081] When the difference between the current timestamp of the redundant device and the associated value is greater than or equal to the time threshold, the reporting operation on the redundant device signal light data is terminated; otherwise, the reporting operation on the redundant device signal light data is performed.
[0082] Specifically, when the keyword exists, the main device has been restored. At this time, the difference between the current time of the redundant device and the initial reporting time of the main device is judged. When the difference is greater than or equal to the time threshold, it means that the main device has been stably connected for more than the preset time threshold. Therefore, the reporting of the redundant device signal light data is terminated. When the difference is less than the time threshold, the reporting operation is performed on the redundant device signal light data.
[0083] The redundant device timestamp is the timestamp when the redundant device signal light data reported by the redundant device is received.
[0084] This embodiment accurately determines whether the master device has been reliably restored by comparing the difference between the timestamp when the redundant device data is received and the initial reporting time saved by the master device.
[0085] In one embodiment, the searching in the database using the master device identifier of the master device associated with the redundant device as a keyword includes:
[0086] According to the redundant device identifier of the redundant device, searching for the main device identifier of the main device associated with the redundant device identifier;
[0087] When the main device identifier associated with the redundant device identifier is not found, terminating the reporting operation on the redundant device signal light data;
[0088] When the main device identifier associated with the redundant device identifier is found, the main device identifier is used as a keyword to perform a search in the database.
[0089] Specifically, the association between the redundant device identifier and the main device identifier can be recorded through a table (MAP). The association between the redundant device identifier and the main device identifier is pre-recorded by the user. The redundant device identifier is included in the data reported by the redundant device. According to the redundant device identifier, the main device identifier associated with the redundant device identifier is searched by, for example, looking up a table. When the main device identifier associated with the redundant device identifier is not found, it indicates an association failure, and the reporting operation of the redundant device signal light data is terminated. When the main device identifier associated with the redundant device identifier is found, it indicates a correct association, and the main device identifier is used as a keyword to search in the database, and subsequent steps are executed according to the search results.
[0090] This embodiment searches for redundant device identifiers to avoid erroneous data reporting when an associated fault occurs.
[0091] like Figure 3 The flowchart of a multi-source signal light data switching method according to the best embodiment of the present invention is shown, comprising:
[0092] Step S301, MEC reports traffic light data;
[0093] Step S302, data analysis;
[0094] Step S303: Check whether the key of the MEC device number exists in redis. If yes, execute step S304; otherwise, execute step S305.
[0095] Step S304, check whether the difference between value and the current reporting time is greater than 3 seconds. If so, the data is reported to the system normally, otherwise the process ends.
[0096] Step S305: Set the MEC device number into redis, and value is the currently reported timestamp. The process ends.
[0097] Step S306, RSU reports signal light data;
[0098] Step S307, data analysis;
[0099] Step S308, check whether the device is associated with MEC, if so, execute step S309, otherwise the process ends;
[0100] Step S309: Check whether the key of the MEC device number exists in redis. If yes, execute step S310; otherwise, the data is reported to the system normally.
[0101] Step S310, check whether the difference between value and the current reporting time is greater than 3 seconds. If so, the process ends, otherwise the data is reported to the system normally.
[0102] Specifically, in order to ensure stable and reliable reporting of roadside signal light data, this embodiment sets up redundant equipment (RSU) to ensure that the data source can be switched in a short time to continue reporting signal light data after the main equipment (MEC) fails. In response to this situation, the cloud automatically switches the signal light data transmission source through a real-time, non-sensitive and highly reliable switching method to ensure that the signal light data is accurately and non-redundantly reported to the cloud.
[0103] Specifically, redis is used to store the unique identifier of the MEC device, and the identifier is used to distinguish whether to use the traffic light data reported by the MEC device. When the identifier expires, the traffic light data reported by the corresponding RSU device is automatically received, where:
[0104] (1) Usually, the MEC device and the RSU device are registered in the system and establish an association relationship. The MEC device reports the signal light data and parses the reported data. The general data will contain the MEC number of the device, called MECID;
[0105] (2) Use MECID as the key in redis to check whether it exists. If it does not exist, set it, use MECID as the key, use the current timestamp as the value, and the expiration time is 3 seconds;
[0106] (3) If it exists, get the value and refresh the expiration time of the key. Use the value to compare with the current timestamp. If the current timestamp is greater than the value by 3000 (i.e. 3 seconds), the normal reporting process can be carried out; otherwise, the process ends.
[0107] (4) The RSU device can also report the traffic light data. After parsing, the RSU number RSUID in the data is obtained.
[0108] (5) Check whether the RSU is associated with the MEC. If not, terminate the process and discard the reported data;
[0109] (6) If the association is made, check whether the MECID of the associated MEC exists in redis. If not, it means that the MEC device has not reported the traffic light data (it may be unable to report due to failure, network and other factors). The RSU needs to take over the reporting of the traffic light data by the MEC device. At this time, the data is reported normally.
[0110] (7) If the MECID of the associated MEC exists in redis, obtain the value and compare it with the current timestamp. If the current timestamp is greater than 3000 of the value, terminate the reporting operation of the redundant device signal light data. Otherwise, proceed with the normal reporting process.
[0111] This embodiment uses distributed cache to set the identifier of the corresponding MEC device in the cache. When the MEC reports the traffic light, it checks whether the identifier exists. If it exists, it can be reported normally. For RSU devices, it is the opposite of MEC devices. The system uses the traffic light data reported by the MEC device by default. If the MEC exists, the traffic light data of the RSU device will be discarded. When the MEC device fails to report the traffic light data for various reasons after 3 seconds, the data in redis with the MEC device number as the key will expire. When the RSU device reports the traffic light, it checks whether the key is expired or does not exist, and then the traffic light data can be reported normally.
[0112] The multi-source traffic light data switching method of this embodiment can switch to the associated RSU device as the data source of the traffic light data after 3 seconds when the MEC device is unable to report the traffic light data normally due to some fault, thereby greatly shortening the underreporting time of the traffic light data and reducing the time for manual troubleshooting.
[0113] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0114] like Figure 4 The figure shows a hardware structure diagram of an electronic device of the present invention, including:
[0115] at least one processor 401; and,
[0116] A memory 402 is communicatively connected to at least one of the processors 401; wherein,
[0117] The memory 402 stores instructions that can be executed by at least one of the processors. The instructions are executed by at least one of the processors so that the at least one of the processors can execute the multi-source signal light data switching method as described above.
[0118] Figure 4 A processor 401 is taken as an example.
[0119] The electronic device may further include: an input device 403 and a display device 404 .
[0120] The processor 401, the memory 402, the input device 403 and the display device 404 may be connected via a bus or other means, and the figure takes the connection via a bus as an example.
[0121] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the multi-source signal light data switching method in the embodiment of the present application, for example, Figure 1 , Figure 2 , Figure 3 The processor 401 executes various functional applications and data processing by running the non-volatile software programs, instructions and modules stored in the memory 402, that is, the multi-source signal light data switching method in the above embodiment is implemented.
[0122] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the multi-source signal light data switching method, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the device for executing the multi-source signal light data switching method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0123] The input device 403 can receive user clicks and generate signal inputs related to user settings and function control of the multi-source signal light data switching method. The display device 404 can include display devices such as a display screen.
[0124] The one or more modules are stored in the memory 402 , and when executed by the one or more processors 401 , the multi-source signal light data switching method in any of the above method embodiments is executed.
[0125] The present invention reports traffic light data through a main device and a redundant device simultaneously. When the traffic light data of the main device fails, the traffic light data of the redundant device is reported, so that the traffic light data can be reported to the cloud system accurately and without redundancy, thereby ensuring stable and reliable reporting of roadside traffic light data.
[0126] An embodiment of the present invention provides a storage medium, wherein the storage medium stores computer instructions. When a computer executes the computer instructions, the storage medium is used to execute all steps of the multi-source signal light data switching method as described above.
[0127] In the context of the present disclosure, a storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. The storage medium may be a machine-readable signal medium or a machine-readable storage medium. Alternatively, the storage medium may be a non-temporary computer-readable storage medium, for example, a non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (Compact Disc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0128] An embodiment of the present invention provides a computer program product, including a computer program / instruction, which implements the multi-source signal light data switching method as described above when executed by a processor.
[0129] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A multi-source signal light data switching method, characterized in that: include: Acquire the master device signal light data reported by the master device, and perform a reporting operation on the master device signal light data; The redundant device signal light data reported by the redundant device is obtained, and when the data reported by the main device fails, a reporting operation is performed on the redundant device signal light data.
2. The multi-source signal light data switching method according to claim 1, characterized in that: The acquiring the master device signal light data reported by the master device and performing a reporting operation on the master device signal light data includes: The master device signal light data reported by the master device is obtained, the current reporting time is recorded, and when the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, a reporting operation is performed on the master device signal light data.
3. The multi-source signal light data switching method according to claim 2, characterized in that: The acquiring the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold, includes: Obtain the signal light data of the master device reported by the master device, and record the current timestamp of the master device that obtains the signal light data of the master device as the current reporting time; Use the master device identifier of the master device as a keyword to search in the database: When the keyword exists in the database, the associated value corresponding to the keyword is obtained as the initial reporting time, and the expiration time of the keyword is refreshed. When the difference between the current reporting time and the initial reporting time is greater than or equal to the time threshold, the reporting operation is performed on the main device signal light data.
4. The multi-source signal light data switching method according to claim 3, characterized in that: The step of obtaining the master device signal light data reported by the master device, recording the current reporting time, and performing a reporting operation on the master device signal light data when the difference between the current reporting time and the initial reporting time is greater than or equal to a time threshold, further includes: When the keyword does not exist in the database, the keyword is set in the database, the current reporting time is saved as the associated value corresponding to the keyword, and the expiration time of the keyword is set.
5. The multi-source signal light data switching method according to claim 1, characterized in that: The step of acquiring redundant device signal light data reported by redundant devices and performing a reporting operation on the redundant device signal light data when the primary device reports a data failure includes: The redundant device signal light data reported by the redundant device is obtained, and the main device identifier of the main device associated with the redundant device is used as a keyword to search in a database, and when the keyword does not exist in the database, the redundant device signal light data is reported.
6. The multi-source signal light data switching method according to claim 5, characterized in that: The acquiring of redundant device signal light data reported by the redundant device and performing a reporting operation on the redundant device signal light data when the primary device reports a data failure also includes: When the keyword exists in the database, comparing the current timestamp of the redundant device with the associated value corresponding to the retrieved keyword, the current timestamp of the redundant device being the timestamp for obtaining the signal light data of the redundant device; When the difference between the current timestamp of the redundant device and the associated value is greater than or equal to the time threshold, the reporting operation on the redundant device signal light data is terminated; otherwise, the reporting operation on the redundant device signal light data is performed.
7. The multi-source signal light data switching method according to claim 5, characterized in that: The searching in the database using the master device identifier of the master device associated with the redundant device as a keyword includes: According to the redundant device identifier of the redundant device, searching for the main device identifier of the main device associated with the redundant device identifier; When the main device identifier associated with the redundant device identifier is not found, terminating the reporting operation on the redundant device signal light data; When the main device identifier associated with the redundant device identifier is found, the main device identifier is used as a keyword to perform a search in the database.
8. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions executable by at least one of the processors, and the instructions are executed by at least one of the processors to enable at least one of the processors to execute the multi-source signal light data switching method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium stores computer instructions, and when a computer executes the computer instructions, it is used to execute all steps of the multi-source signal light data switching method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the multi-source signal light data switching method as claimed in any one of claims 1 to 7 is implemented.