Automatically configuring time zone of car machine, device, equipment and storage medium
By receiving T-BOX data, converting it into a target offset, and performing a three-level priority matching with a list of time zone IDs, the problem of vehicle time zone configuration being unusable in weak network scenarios and the matching results not conforming to user habits is solved. Stable and accurate automatic time zone configuration is achieved, which is suitable for Android vehicle systems.
Patent Information
- Application Number
- CN202610705054.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-11-20
AI Technical Summary
The existing vehicle-mounted time zone configuration scheme cannot be used in scenarios with weak or no network, such as underground parking garages or remote areas. It relies on external services, which leads to response delays. Furthermore, the matching results do not conform to user habits and geographical orientation, do not consider the impact of daylight saving time switching, and have a simplistic matching logic, resulting in a high failure rate.
By receiving integer time zone data uploaded by T-BOX, converting it into a target offset, and performing a three-level priority matching with a pre-built list of time zone IDs, including verification of standard offset, current offset, and historical offset, the stability of the matching results and their conformity to user habits are ensured. A two-level list of time zone IDs is used for filtering.
It achieves stable time zone matching in weak network/disconnection scenarios, the matching results conform to user habits, has strong adaptability, reduces user cognitive cost, improves the matching success rate and the robustness of time zone settings, and avoids offset changes caused by daylight saving time switching.
Smart Images

Figure CN123145679A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronics technology, and in particular to a method, apparatus, device, and storage medium for automatic time zone configuration in a vehicle. Background Technology
[0002] In existing in-vehicle systems, the main time zone configuration schemes are as follows:
[0003] This solution relies on network positioning to obtain time zone information. The vehicle's infotainment system obtains its current geographical coordinates via GPS or mobile network, queries the corresponding time zone ID using a map service API, and then sets the system time zone. This approach requires the vehicle's infotainment system to maintain a network connection and depends on the accuracy of the external map service.
[0004] The disadvantages of this solution are: it cannot be used in scenarios with weak or no network, such as underground parking garages or remote areas; it relies on external services, which leads to response delays and increases the network traffic consumption of the vehicle system; and if the location information is inaccurate, it will cause time zone matching errors. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art, and proposes a method, device, equipment and storage medium for automatic time zone configuration of vehicle system.
[0006] In a first aspect, the present invention discloses a method for automatic time zone configuration of a vehicle system, comprising the following steps:
[0007] Receive integer time zone data uploaded by T-BOX;
[0008] Convert the integer time zone data into the target offset;
[0009] The target offset is matched against a pre-built list of time zone IDs to find a time zone ID that matches the target offset.
[0010] Based on the successfully matched time zone ID, configure the system time zone of the vehicle system to synchronize the vehicle system time with the standard time corresponding to the time zone ID.
[0011] In some embodiments, converting the integer time zone data into a target offset specifically includes: converting the integer time zone data into a standard time zone offset in ±HH:MM format;
[0012] Convert standard time zone offsets in ±HH:MM format to second-level target offsets.
[0013] In some embodiments, converting the integer time zone data into a standard time zone offset in ±HH:MM format specifically includes:
[0014] Subtract the set reference value from the integer time zone data to obtain the difference between the two, and divide the difference by the hour coefficient to obtain the hour offset.
[0015] The minute offset is obtained by taking the remainder of the absolute value of the difference with respect to the hour coefficient and then multiplying it by the minute step.
[0016] The standard time zone offset in ±HH:MM format is obtained based on the hour offset and minute offset.
[0017] In some embodiments, the standard time zone offset in ±HH:MM format is obtained based on the hour offset and the minute offset. Specifically, this includes: adding a positive or negative sign based on the sign of the hour offset, formatting the absolute value of the hour offset and the minute offset as two-digit numbers respectively, padding with leading zeros if less than two digits, and combining them in the format of sign + hour + colon + minute to obtain the standard time zone offset in ±HH:MM format.
[0018] In some embodiments, the standard time zone offset in ±HH:MM format is obtained based on the hour offset and the minute offset, specifically including:
[0019] Convert the hours and minutes of the standard time zone offset to seconds and sum them to obtain the second-level target offset.
[0020] The standard time zone offset is converted into seconds in hours and minutes respectively and summed to obtain the second-level target offset. Specifically, the hour part of the standard time zone offset in ±HH:MM format is multiplied by 3600 and the minute part is multiplied by 60, and the sum is obtained to get the total number of seconds. The original sign is retained to form the second-level target offset.
[0021] In some embodiments, during the matching of the target offset with a pre-built list of time zone IDs, the following steps are performed sequentially for each time zone ID:
[0022] First priority matching: Obtain the standard offset of the time zone. If the standard offset matches the target offset, check whether the time zone has an offset change due to daylight saving time switching in the future preset period. If there is no offset change, directly return the time zone ID.
[0023] Second priority matching: If the first priority matching has no result, check whether the actual offset of the time zone at the current time is consistent with the target offset. If they are consistent, temporarily store the time zone ID.
[0024] Third priority matching: If the first two priority matching results are not found, obtain the historical time point of the preset number of days before the current time, and match the time zone offset at the historical time point with the target offset; if they match, temporarily store the time zone ID. The preset number of days is used to cover the daylight saving time switching cycle.
[0025] After iterating through all timezone IDs in the current list, return the matching results in descending order of priority.
[0026] In some embodiments, the target offset is matched against a pre-built list of time zone IDs to find a time zone ID that matches the target offset, specifically including:
[0027] The target offset is matched with a pre-built first time zone ID list; if the match is successful, the matched time zone ID is returned; if the match fails, the target offset is matched with a pre-built second time zone ID list; if the match is successful, the matched time zone ID is returned.
[0028] The first time zone ID list contains time zone IDs in country / region format, and the second time zone ID list contains all special time zones excluded from the first time zone ID list.
[0029] Secondly, the present invention also discloses an automatic time zone configuration device for in-vehicle systems, comprising:
[0030] The time zone data acquisition module is used to receive integer time zone data uploaded by the T-BOX;
[0031] The time zone data conversion module is used to convert the integer time zone data into a target offset;
[0032] The time zone data matching module is used to match the target offset with a pre-built list of time zone IDs to find a time zone ID that matches the target offset.
[0033] The time zone data configuration module is used to configure the system time zone of the vehicle system according to the successfully matched time zone ID, so that the vehicle system time is synchronized with the standard time corresponding to the time zone ID.
[0034] Thirdly, the present invention also discloses an electronic device, comprising:
[0035] One or more processors;
[0036] Memory, used to store one or more programs;
[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.
[0038] Fourthly, the present invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect.
[0039] The present invention has at least the following beneficial effects:
[0040] This invention does not rely on network or preset regional information; it achieves end-to-end timezone matching solely through T-BOX integer data. It remains stable even in weak or offline network scenarios and is adaptable to complex in-vehicle scenarios such as cross-border driving and remote areas. The matching results of this invention conform to user habits: it prioritizes returning timezone IDs in "country / region" format (e.g., Asia / Shanghai), providing clear geographical indication and stronger compatibility with in-vehicle navigation, local services, and other functions, thus reducing the cognitive burden on users. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating an automatic time zone configuration method for a vehicle system provided in an embodiment of the present invention.
[0042] Figure 2 A flowchart illustrating another method for automatic time zone configuration in a vehicle system provided in an embodiment of the present invention;
[0043] Figure 3 This is a partial code example of a vehicle-mounted time zone automatic configuration method provided in an embodiment of the present invention;
[0044] Figure 4 This is another code example of an automatic time zone configuration method for in-vehicle systems provided in an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of an automatic time zone configuration device for a vehicle system provided in an embodiment of the present invention;
[0046] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0047] To enable those skilled in the art to better understand the technical solutions of the present invention, exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0048] Where there is no conflict, the various embodiments of the present invention and the features thereof may be combined with each other.
[0049] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0050] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Terms such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0051] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having the meaning consistent with their meaning in the context of the relevant art and the invention, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.
[0052] In the technical solution of this invention, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information all comply with relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution follows relevant national laws and regulations (e.g., the "Information Security Technology - Personal Information Security Specification"). For example: appropriate measures are taken for personal information access control; restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; and explicit identity targeting is eliminated when using personal information to avoid precisely locating a specific individual.
[0053] In vehicle systems, a proposed time zone setting scheme relies on network positioning to obtain time zone information. The vehicle's infotainment system obtains its current geographical coordinates via GPS or mobile network, queries the corresponding time zone ID using a map service API, and then sets the system time zone. This scheme requires the vehicle's infotainment system to maintain a network connection and depends on the accuracy of external map services. As a network positioning-dependent scheme, it cannot be used in scenarios with weak or no network coverage, such as underground parking garages or remote areas. Furthermore, its reliance on external services leads to response delays and increases network bandwidth consumption. Inaccurate positioning information can also result in time zone mismatches.
[0054] In in-vehicle systems, another time zone setting scheme has been disclosed: directly mapping a time zone offset to a fixed time zone ID. The T-BOX sends time zone offset data to the in-vehicle system, which converts it to a GMT format offset (e.g., GMT+8:00), then directly maps it to a fixed Etc / GMT series time zone ID (e.g., Etc / GMT-8), and sets it as the system time zone. This scheme requires no network, but only performs a simple one-to-one mapping between offset and time zone ID, without considering user habits regarding time zone formats or the impact of daylight saving time.
[0055] This scheme uses a simple offset mapping method. The matching results do not conform to users' usual usage habits. The returned Etc / GMT series time zone IDs lack clear geographical references (e.g., Etc / GMT-8 cannot correspond to Asia / Shanghai), making it impossible for users to intuitively associate them with their actual driving location. Furthermore, its geographical compatibility with functions such as in-vehicle navigation and local services is poor. The scheme also lacks time zone stability, failing to consider the impact of Daylight Saving Time (DST). Some time zones will experience offset changes due to DST, leading to time discrepancies in in-vehicle navigation reminders and reservation functions. Additionally, the scheme's fallback mechanism is inadequate. When a single offset cannot match a fixed time zone ID, there is no backup matching logic, directly causing time zone setting failure and requiring manual intervention from the user. DST (Daylight Saving Time) refers to a time system where the time is advanced by one hour during the summer to maximize sunlight. GMT (Greenwich Mean Time) is the base time for time zone offsets. T-BOX (TelematicsBox) is a telematics processor used to send time zone-related integer data to the vehicle's infotainment system. ZoneRules is the core class in the Java / Android system that defines time zone offset rules (including daylight saving time rules). IANA (Internet Assigned Numbers Authority) is the Internet Corporation for Assigned Numbers, and its defined time zone IDs are an industry-standard feature.
[0056] The related technology also discloses a matching scheme combining "offset + vehicle's region". The vehicle's infotainment system first obtains the time zone offset through the T-BOX, and then combines it with the vehicle's factory-preset region information to match the corresponding time zone from a limited list of preset time zone IDs. This scheme does not require a network and can guarantee the geographical correlation of time zones to a certain extent.
[0057] The disadvantages of this scheme are:
[0058] Poor compatibility: The number of preset time zone IDs is limited and cannot cover all time zones in the world. When vehicles travel across regions (such as imported cars or cross-border self-driving tour vehicles), there may be situations where no matching time zone is available.
[0059] Insufficient flexibility: The vehicle's location information is fixed at the factory and cannot be dynamically adjusted according to the actual driving location, causing the time zone setting to fail when driving across time zones;
[0060] Unresolved Daylight Saving Time Issue: Daylight Saving Time rules for time zones have not been validated, and time instability issues still occur when switching between different daylight saving time periods.
[0061] In view of the shortcomings of existing technologies, the present invention aims to solve the following core technical problems:
[0062] 1. Address the issues that existing solutions rely on network positioning or preset regional information, leading to failure in scenarios with weak or no network coverage, such as underground parking garages or remote areas, as well as poor adaptability when vehicles travel across regions;
[0063] 2. Resolve the issue that the time zone ID (such as Etc / GMT-8) returned by the simple offset mapping scheme does not conform to user habits and has no clear geographical indication, resulting in poor compatibility with other functions of the vehicle system;
[0064] 3. Resolve the issue that the existing solution does not consider daylight saving time switching, resulting in unstable time zone offset and incorrect time for in-vehicle navigation reminders and reservation functions;
[0065] 4. To address the problem that existing solutions have a simple matching logic and lack a robust fallback mechanism, resulting in a high matching failure rate and requiring frequent manual intervention from users.
[0066] Figure 1 This is a flowchart illustrating an embodiment of the vehicle-mounted time zone automatic configuration method provided by the present invention. See also: Figure 1 A method for automatically configuring the time zone of a vehicle's infotainment system includes the following steps:
[0067] S1. Receive integer time zone data uploaded by T-BOX;
[0068] S2. Convert the integer time zone data into the target offset;
[0069] S3. Match the target offset with a pre-built list of time zone IDs to find a time zone ID that matches the target offset;
[0070] S4. Based on the successfully matched time zone ID, configure the system time zone of the vehicle system so that the vehicle system time is synchronized with the standard time corresponding to the time zone ID.
[0071] In some embodiments, converting the integer time zone data into a target offset specifically includes: converting the integer time zone data into a standard time zone offset in ±HH:MM format;
[0072] Convert standard time zone offsets in ±HH:MM format to second-level target offsets.
[0073] In some embodiments, converting the integer time zone data into a standard time zone offset in ±HH:MM format specifically includes:
[0074] Subtract the set reference value from the integer time zone data to obtain the difference between the two, and divide the difference by the hour coefficient to obtain the hour offset.
[0075] The minute offset is obtained by taking the remainder of the absolute value of the difference with respect to the hour coefficient and then multiplying it by the minute step.
[0076] The standard time zone offset in ±HH:MM format is obtained based on the hour offset and minute offset.
[0077] In some embodiments, the standard time zone offset in ±HH:MM format is obtained based on the hour offset and the minute offset. Specifically, this includes: adding a positive or negative sign based on the sign of the hour offset, formatting the absolute value of the hour offset and the minute offset as two-digit numbers respectively, padding with leading zeros if less than two digits, and combining them in the format of sign + hour + colon + minute to obtain the standard time zone offset in ±HH:MM format.
[0078] In some embodiments, the standard time zone offset in ±HH:MM format is obtained based on the hour offset and the minute offset, specifically including:
[0079] Convert the hours and minutes of the standard time zone offset to seconds and sum them to obtain the second-level target offset.
[0080] The standard time zone offset is converted into seconds in hours and minutes respectively and summed to obtain the second-level target offset. Specifically, the hour part of the standard time zone offset in ±HH:MM format is multiplied by 3600 and the minute part is multiplied by 60, and the sum is obtained to get the total number of seconds. The original sign is retained to form the second-level target offset.
[0081] The vehicle's infotainment system receives integer time zone data (tboxTimeZone, e.g., a value of 80) uploaded from the T-BOX. It then converts this data into a standard time zone offset in ±HH:MM format using a dedicated conversion algorithm, and further converts it to a second-level offset (for subsequent matching calculations). The core conversion algorithm (corresponding to the `parseTboxTimeZonetoZoneId` method) is as follows:
[0082] With a base value of 48 and an hour coefficient of 4, calculate the hour offset: hourOffset=(tboxTimeZone-48) / 4.
[0083] Calculate the minute offset (minute increments of 15 minutes):
[0084] minuteOffset=Math.abs(tboxTimeZone-48)%4*15.
[0085] That is, minute offset = |T - BOX integer data - 48|%4 × 15.
[0086] Concatenate into a ±HH:MM format string: add a sign based on the hour offset, and format both hours and minutes as two digits (padded with 0s if necessary).
[0087] Boundary value validation: In practical applications, the input parameter tboxTimeZone is validated. Abnormal cases where its value is less than 0 or greater than 104 will be judged as invalid and will not be processed further.
[0088] Example: T-BOX sends the value 80 → (80-48) / 4=8 (hour offset) → (80-48)%4*15=0 (minute offset) → converted to +08:00 → further converted to a second-level offset of 28800 seconds (8*3600). If the T-BOX sends integer data with different base values and step rules, the base value (e.g., 48), hour coefficient (e.g., 4), and minute step (e.g., 15) in the parseTboxTimeZonetoZoneId method can be adjusted to still achieve the conversion of integer data to standard offsets.
[0089] In some embodiments, during the matching of the target offset with a pre-built list of time zone IDs, the following steps are performed sequentially for each time zone ID:
[0090] First priority matching: Obtain the standard offset of the time zone. If the standard offset matches the target offset, then check whether the time zone has an offset change due to daylight saving time switching within the next preset period (the next preset period is a stability verification period, which can be set as needed; the next preset period can be 5 years, or "5 years" can be replaced with "3 years" or "7 years". The core logic is to "cover the normal vehicle usage cycle" and still achieve the function of offset stability verification, covering the 5-year two-node verification rules for both winter and summer seasons. For example, by verifying whether the offset on January 1st and July 1st of each year matches the target offset, it can be determined whether there is an impact from daylight saving time switching). If there is no offset change, then directly return the time zone ID.
[0091] Second priority matching: If the first priority matching has no result, check whether the actual offset of the time zone at the current time is consistent with the target offset. If they are consistent, temporarily store the time zone ID.
[0092] Third priority matching: If the first two priority matching levels yield no results, obtain the historical time point of the current time with a preset number of days prior (the preset number of days is a fallback matching time point; the preset number of days prior can be set as needed, such as 180 days before the current time, i.e., the preset number of days prior can be "half a year ago", or "half a year ago" can be replaced with "3 months ago" or "9 months ago". The core logic is to "cover the daylight saving time switching cycle", which can still achieve the function of supplementary matching). Match the time zone offset at this historical time point with the target offset; if they match, temporarily store the time zone ID. The preset number of days is used to cover the daylight saving time switching cycle.
[0093] After iterating through all timezone IDs in the current list, return the matching results in descending order of priority.
[0094] The `findMatchingZoneId` method is called to match each `ZoneId` in the current list in the order of "priority 1 → priority 2 → priority 3". If a match is found, the corresponding `ZoneId` is returned, and the iteration stops. Core matching rules:
[0095] Priority 1 (highest): Standard offset matches and no daylight saving time is expected in the next 5 years (offset stable).
[0096] First, obtain the standard offset of the ZoneId (rules.getStandardOffset(now).getTotalSeconds()) and the current offset (rules.getOffset(now).getTotalSeconds()). If the standard offset is consistent with the target second-level offset, verify the stability using the isOffsetStableForFiveYears method: verify that the offsets for January 1st and July 1st of each of the current year and the next 4 years (a total of 5 years) are equal to the target offset, with no offset changes caused by daylight saving time switching. If the condition is met, return the ZoneId directly.
[0097] Priority 2 (Medium): Current time offset perfectly matched
[0098] If there is no matching result for priority 1, check whether the offset of ZoneId at the current time (Instant.now()) is consistent with the target offset; only retain the first matching result and temporarily store it as matchedId.
[0099] Priority 3 (lowest): Matching the offset from six months ago (as a backup)
[0100] If there are no matching results for priorities 1 and 2, calculate the time six months ago (now.minus(180,ChronoUnit.DAYS)); check whether the offset of ZoneId at this time point is consistent with the target offset, and temporarily store it as matchedNonCurrentId.
[0101] In some embodiments, a two-level list of ZoneIds is built within the vehicle's infotainment system. ZoneId (ZoneIdentifier) is a unique identifier used to identify time zones in the Java / Android system.
[0102] The vehicle's infotainment system retrieves all available ZoneIds supported by the Android system (using the ZoneId.getAvailableZoneIds() method) and divides them into two-level lists based on filtering rules. The first list is used for matching first: First Priority List (Core First Choice, ZoneId in Country / Region format): Filtering rules: ① Contains the " / " character (format: "Country / Region" or "Region / City"); ② Excludes special / old time zones (prefixes Etc / , GMT, UTC, SystemV / , US / and time zones with W-SU, WET, CET, MET, EET); ③ Sort by alphabetical order. Examples: Asia / Shanghai, Europe / London, America / New_York, etc.
[0103] Second priority list (supplementary fallback, not in country / region format ZoneId): Filtering rules: all special time zones excluded from the first list (such as Etc / GMT+8, UTC+0, etc.) are sorted alphabetically and are only enabled when there are no matching results in the first list.
[0104] First, iterate through the first list and match according to the priority of "standard offset matching and no daylight saving time in the future preset period → current offset matching → preset historical time point offset matching". If there is no matching result in the first list, iterate through the second list.
[0105] In some embodiments, see Figure 2 The target offset is matched against a pre-built list of time zone IDs to find a time zone ID that matches the target offset. Specifically, this includes:
[0106] The target offset is matched with a pre-built first time zone ID list; if the match is successful, the matched time zone ID is returned; if the match fails, the target offset is matched with a pre-built second time zone ID list; if the match is successful, the matched time zone ID is returned.
[0107] The first time zone ID list contains time zone IDs in country / region format, and the second time zone ID list contains all special time zones excluded from the first time zone ID list.
[0108] The return logic within a single list is as follows: priority 1 > priority 2 > priority 3, returning the matching results in that order.
[0109] The overall return logic is as follows: First list (country / region format) > Second list (special format). If the first list matches successfully, there is no need to query the second list. If neither list has a match, an empty string is returned and a log is recorded (including the number of verified time zones).
[0110] After the vehicle's infotainment system obtains the successfully matched ZoneId, it calls the Android system API (such as Settings.System.putString(getContentResolver(),Settings.System.TIME_ZONE,zoneId)) to set it as the system time zone, thus completing the automatic setting.
[0111] This invention provides a method for automatic time zone configuration and setting of in-vehicle infotainment systems based on T-BOX data. It eliminates the need for network positioning or preset regional information, achieving accurate, stable, and user-friendly automatic time zone setting through a complete process: "T-BOX data conversion → two-level list filtering → three-layer priority matching → system time zone setting." The solution is applicable to Android in-vehicle infotainment systems, and the core logic is implemented using Java code. See details... Figure 3 and Figure 4 Among a bunch of timezone IDs, find the timezone that matches the "target offset in seconds". For example, if the target is UTC+8 (28800 seconds), find a matching timezone like Asia / Shanghai from the list.
[0112] The technical solution disclosed herein will be described in detail below with specific examples.
[0113] Operating environment: Android in-vehicle infotainment system (Android 8.0 and above), Java 8 and above;
[0114] Hardware dependency: Vehicle hardware that supports T-BOX data transmission (T-BOX module, vehicle controller);
[0115] Implementation example:
[0116] T-BOX sends the integer 80 to the vehicle's infotainment system;
[0117] The vehicle's infotainment system converts the time to +08:00 using the parseTboxTimeZonetoZoneId method, and then further converts it to 28800 seconds.
[0118] Construct a first-priority list, filtering out ZoneIds containing " / " such as Asia / Shanghai and Asia / Hong_Kong, and excluding those with special time zones;
[0119] Traversing the first list, the standard offset for Asia / Shanghai is 28800 seconds, and it has passed the 5-year stability check (the offset will be 28800 seconds on January 1st and July 1st for the next 5 years).
[0120] Return directly to Asia / Shanghai and call the setSystemTimeZone method to set it as the system timezone;
[0121] The car's time is synchronized with Beijing time, and the automatic setting is completed.
[0122] This invention does not rely on network or preset regional information: it achieves end-to-end time zone matching solely through T-BOX integer data, ensuring stable operation even in weak / out-of-network scenarios and adapting to complex in-vehicle scenarios such as cross-border driving and remote areas. The matching results conform to user habits: it prioritizes returning time zone IDs in "country / region" format (e.g., Asia / Shanghai), providing clear geographical indication and better compatibility with in-vehicle navigation and local services, reducing user cognitive costs. The time zone offset remains stable over the long term: through a "two-node stability check over the next 5 years" (i.e., a 5-year two-node check rule covering both winter and summer), it avoids offset changes caused by daylight saving time switching, ensuring the accuracy of in-vehicle navigation reminders and reservation functions. This invention boasts a high matching success rate and strong robustness: the nested logic of "two-level list + three-level priority" forms a comprehensive fallback mechanism (ensuring a balance between matching success rate and user experience). Even if the first list has no matching results, valid results can still be obtained through a special format list or low-priority matching logic.
[0123] Analysis and testing show that, compared to existing solutions that only perform simple fixed mapping (whose overall matching accuracy is estimated to be about 70%), the present invention improves the matching success rate to over 99%, significantly enhancing the robustness of automatic time zone setting and user experience. The present invention also has low resource consumption: the algorithm logic is simple, the traversal efficiency is high, the vehicle's CPU usage is less than 0.5%, and it will not affect the operation of other in-vehicle functions.
[0124] Based on the same inventive concept, the present invention provides an automatic time zone configuration device for vehicles. Figure 5 This is a schematic diagram of an automatic time zone configuration device for a vehicle system provided in an embodiment of the present invention. See also: Figure 5 An automatic time zone configuration device for in-vehicle systems, comprising:
[0125] The time zone data acquisition module is used to receive integer time zone data uploaded by the T-BOX;
[0126] The time zone data conversion module is used to convert the integer time zone data into a target offset;
[0127] The time zone data matching module is used to match the target offset with a pre-built list of time zone IDs to find a time zone ID that matches the target offset.
[0128] The time zone data configuration module is used to configure the system time zone of the vehicle system according to the successfully matched time zone ID, so that the vehicle system time is synchronized with the standard time corresponding to the time zone ID.
[0129] The core of this invention is the combination of software algorithms and in-vehicle scenarios. The manufacturing methods and processes of related products (in-vehicle infotainment systems that support this time zone setting function) do not require special improvements; the existing R&D, compilation, and pre-installation processes of Android in-vehicle infotainment systems can be used.
[0130] The core algorithm code of this invention is integrated into the time management module of the vehicle system;
[0131] Adapt the data transmission protocol between T-BOX and the vehicle's infotainment system (to ensure that integer time zone data is received correctly).
[0132] The accuracy of time zone matching corresponding to different T-BOX values was verified through vehicle-to-T-BOX joint debugging tests.
[0133] It can be pre-installed in the vehicle infotainment system of mass-produced vehicles without incurring additional hardware manufacturing costs.
[0134] Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Figure 6 As shown, an embodiment of the present invention provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any of the vehicle time zone automatic configuration methods described in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, configured to enable information interaction between the processor and the memory.
[0135] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0136] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0137] In some embodiments, the one or more processors 101 include a field-programmable gate array.
[0138] This invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the vehicle-mounted time zone automatic configuration methods described in the above embodiments. The computer-readable storage medium can be volatile or non-volatile.
[0139] This invention also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the above-described vehicle time zone automatic configuration method.
[0140] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0141] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0142] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0143] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.
[0144] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0145] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0146] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0147] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0149] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A method for automatic time zone configuration in a vehicle, characterized in that, Includes the following steps: Receive integer time zone data uploaded by T-BOX; Convert the integer time zone data into the target offset; The target offset is matched against a pre-built list of time zone IDs to find a time zone ID that matches the target offset. Based on the successfully matched time zone ID, configure the system time zone of the vehicle system to synchronize the vehicle system time with the standard time corresponding to the time zone ID.
2. The method according to claim 1, characterized in that: Converting the integer time zone data into a target offset specifically includes: converting the integer time zone data into a standard time zone offset in ±HH:MM format; Convert standard time zone offsets in ±HH:MM format to second-level target offsets.
3. The method according to claim 2, characterized in that: Converting the integer time zone data into a standard time zone offset in ±HH:MM format specifically includes: Subtract the set reference value from the integer time zone data to obtain the difference between the two, and divide the difference by the hour coefficient to obtain the hour offset. The minute offset is obtained by taking the remainder of the absolute value of the difference with respect to the hour coefficient and then multiplying it by the minute step. The standard time zone offset in ±HH:MM format is obtained based on the hour offset and minute offset.
4. The method according to claim 3, characterized in that: The standard time zone offset in ±HH:MM format is obtained based on the hour offset and minute offset. Specifically, positive and negative signs are added according to the sign of the hour offset. The absolute value of the hour offset and the minute offset are formatted as two-digit numbers respectively. If the number is less than two digits, a leading zero is added. The standard time zone offset in ±HH:MM format is obtained by combining the sign, hour, colon and minute in the format of sign + hour + colon + minute.
5. The method according to claim 2, 3, or 4, characterized in that: The standard time zone offset in ±HH:MM format is obtained based on the hour and minute offsets, specifically including: Convert the hours and minutes of the standard time zone offset to seconds and sum them to obtain the second-level target offset.
6. The method according to claim 1, characterized in that: During the matching of the target offset with the pre-built list of time zone IDs, for each time zone ID, the following steps are performed sequentially according to priority: First priority matching: Obtain the standard offset of the time zone. If the standard offset matches the target offset, check whether the time zone has an offset change due to daylight saving time switching in the future preset period. If there is no offset change, directly return the time zone ID. Second priority matching: If the first priority matching has no result, check whether the actual offset of the time zone at the current time is consistent with the target offset. If they are consistent, temporarily store the time zone ID. Third priority matching: If the first two priority matching results are not found, obtain the historical time point of the preset number of days before the current time, and match the time zone offset at the historical time point with the target offset; if they match, temporarily store the time zone ID. The preset number of days is used to cover the daylight saving time switching cycle. After iterating through all timezone IDs in the current list, return the matching results in descending order of priority.
7. The method according to claim 1, characterized in that: The target offset is matched against a pre-built list of time zone IDs to find the time zone ID that matches the target offset. Specifically, this includes: The target offset is matched with a pre-built first time zone ID list; if the match is successful, the matched time zone ID is returned; if the match fails, the target offset is matched with a pre-built second time zone ID list; if the match is successful, the matched time zone ID is returned. The first time zone ID list contains time zone IDs in country / region format, and the second time zone ID list contains all special time zones excluded from the first time zone ID list.
8. A vehicle-mounted time zone automatic configuration device, characterized in that, include: The time zone data acquisition module is used to receive integer time zone data uploaded by the T-BOX; The time zone data conversion module is used to convert the integer time zone data into a target offset; The time zone data matching module is used to match the target offset with a pre-built list of time zone IDs to find a time zone ID that matches the target offset. The time zone data configuration module is used to configure the system time zone of the vehicle system according to the successfully matched time zone ID, so that the vehicle system time is synchronized with the standard time corresponding to the time zone ID.
9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
