Reporting control method and device for vehicle positioning data
By obtaining and grouping the positioning data of the vehicle in real time and reporting and controlling according to urban supervision requirements, the problem of poor reutilization and timeliness on the positioning data in the existing technology is solved, and the requirements of multiple control and supervision platforms are met.
Patent Information
- Application Number
- CN202411811505.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-07
AI Technical Summary
When the prior art reports the positioning data of the operating vehicle to the regulatory department, the reusability and timeliness are poor, and the differences in the requirements of different regulatory platforms cannot be met.
By obtaining the positioning data of the operating vehicle in real time, determining the city to which it belongs, and grouping and reporting control of data according to the city's regulatory requirements. If the city meets the preset reporting conditions, report immediately; if it does not meet, it will be stored in cache and reported regularly, and the interface call frequency, packaging quantity and data timeliness control is achieved through distributed locking and timing task scheduling.
It improves the reusability and timeliness of operating vehicle positioning data reporting, can meet the requirements of different regulatory platforms, and realizes multiple controls such as interface call frequency, packaging quantity and data timeliness.
Smart Images

Figure CN119584075A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and more specifically, to a method and device for controlling the reporting of vehicle positioning data. Background Art
[0002] During the operation of the vehicle platform, the positioning data of the vehicle needs to be reported to the regulatory department in accordance with regulatory requirements. Different regulatory departments may have different requirements, such as limiting the frequency of interface calls, reporting a maximum of 100 positioning data at a time, controlling the reporting frequency of the same driver, requiring the same driver to report once every 30 seconds, and the frequency should not be too high or too low.
[0003] If a reporting process is written for each regulatory department, problems such as poor reusability and timeliness will arise in the process of reporting the positioning data of operating vehicles to the regulatory department, resulting in the inability to meet the differences in requirements of different regulatory platforms.
[0004] Therefore, how to improve the reusability and timeliness of reporting the positioning data of operating vehicles to the regulatory authorities to meet the differences in requirements of different regulatory platforms is an issue that this application urgently needs to solve. Summary of the invention
[0005] In view of this, the present application discloses a vehicle positioning data reporting control method and device, which aims to improve the reusability and timeliness of reporting the positioning data of operating vehicles to the regulatory authorities to meet the differences in requirements of different regulatory platforms.
[0006] In order to achieve the above purpose, the disclosed technical solution is as follows:
[0007] The first aspect of the present application discloses a method for controlling the reporting of vehicle positioning data, the method comprising:
[0008] Obtain the positioning data of operating vehicles in real time and determine the city to which the operating vehicles belong;
[0009] Grouping the positioning data of the operating vehicles according to the cities to which the operating vehicles belong;
[0010] Traverse each city in the grouping result;
[0011] For each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city will be reported; wherein the preset reporting conditions are conditions determined according to the regulatory requirements of the city for controlling the reporting frequency of the same driver;
[0012] If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city are stored in the cache;
[0013] The positioning data of the operating vehicles in the cache are obtained at regular intervals, and the positioning data of the corresponding operating vehicles in the cache are reported according to the positioning reporting control configuration of the city.
[0014] Preferably, for each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city are reported, including:
[0015] For each city, if the driver reporting frequency control is turned on in the city, and the positioning reporting control is not turned on, it is determined that the city meets the preset reporting conditions; wherein the driver reporting frequency control is used to control the driver to report data within a preset time interval; the positioning reporting control is determined by the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages and the data timeout discard time;
[0016] If the city meets the preset reporting conditions, the location data list is traversed, and all drivers in the location data list are locked through distributed locks;
[0017] In the process of traversing the positioning data list, all drivers who failed to lock are eliminated to obtain the drivers to be reported;
[0018] The positioning data of the operating vehicles of the drivers to be reported corresponding to the city are reported.
[0019] Preferably, if the city does not meet the preset reporting conditions, storing the positioning data of the operating vehicles corresponding to the city in the cache includes:
[0020] If the driver reporting frequency control is not enabled in the city, or the location reporting control is enabled, it is determined that the city does not meet the preset reporting conditions;
[0021] If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city are stored in the cache in a preset storage order.
[0022] Preferably, it also includes:
[0023] In the process of locking all drivers in the positioning data list through distributed locks, if the driver fails to lock, it is determined that the driver who failed to lock has reported the positioning data of the operating vehicle within the specified time, and the operation of the driver who failed to lock to report the positioning data of the operating vehicle is stopped.
[0024] Preferably, the positioning data of the operating vehicles in the cache are obtained at regular intervals, and the positioning data of the corresponding operating vehicles in the cache are reported according to the reporting control configuration of the city, including:
[0025] Obtain the positioning data of the operating vehicles in the cache at regular intervals, and obtain the reporting control configuration of the city from the distributed configuration center framework; the reporting control configuration at least includes the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages, and the data timeout discard time;
[0026] Locking the city via distributed locks;
[0027] If the city is locked successfully, the last reporting time corresponding to the city is obtained from the cache;
[0028] Verify the interface call frequency by the last reporting time;
[0029] If the interface call frequency is equal to 0, and the sum of the last reporting time and the interface call frequency is less than or equal to the current time, it is determined that the interface call frequency check has passed;
[0030] Under the condition that the interface call frequency check passes, the length of the location data list of the city is obtained; wherein the location data list is obtained from the cache in a preset fetching order;
[0031] Verify the minimum number of packages and the maximum interface call interval by using the list length;
[0032] If the length of the list is greater than or equal to the minimum number of packages, and the last reporting time and the maximum interface call interval are less than or equal to the current time, it is determined that the verification of the minimum number of packages and the maximum interface call interval has passed;
[0033] Under the condition that the verification of the minimum number of packages and the maximum call interval of the interface is passed, the timeout data is removed from the positioning data list, and the positioning data of the operating vehicles corresponding to the reporting control configuration of the city in the cache is obtained and reported; wherein, the timeout data is determined by the data timeout discarding time; the positioning data of the operating vehicles is the data to be reported.
[0034] Preferably, it also includes:
[0035] Eliminate the data that does not meet the timeliness requirement in the positioning data list; wherein the data that does not meet the timeliness requirement is determined by the actual positioning time, the maximum interface call interval and the current time;
[0036] Determine whether the length of the location data list of the city is less than the maximum number of packages;
[0037] If the length of the list is less than the maximum number of packages, return to execute the step of removing the data in the list whose sum of the actual positioning time and the maximum interface call interval is less than or equal to the current time, until there is no data in the cache, or the length of the list is equal to the maximum number of packages, and the scheduled task process ends.
[0038] Preferably, it also includes:
[0039] If the interface call frequency is greater than 0, and the sum of the last reporting time and the interface call frequency is greater than the current time, the scheduled task process is terminated.
[0040] Preferably, it also includes:
[0041] If the list length is less than the minimum number of packages, and the last reporting time is less than the maximum interface call interval and greater than the current time, the scheduled task process is terminated.
[0042] The second aspect of the present application discloses a vehicle positioning data reporting control device, the device comprising:
[0043] A real-time acquisition unit is used to acquire the positioning data of the operating vehicle in real time and determine the city to which the operating vehicle belongs;
[0044] A grouping unit, used for grouping the positioning data of the operating vehicles according to the cities to which the operating vehicles belong;
[0045] A traversal unit, used for traversing each city in the grouping result;
[0046] A first reporting unit is used to report the positioning data of the operating vehicles corresponding to each city if the city meets the preset reporting conditions; wherein the preset reporting conditions are conditions determined according to the regulatory requirements of the city for controlling the reporting frequency of the same driver;
[0047] A storage unit, for storing the positioning data of the operating vehicles corresponding to the city into a cache if the city does not meet the preset reporting conditions;
[0048] The second reporting unit is used to periodically obtain the positioning data of the operating vehicles in the cache, and report the GPS data of the corresponding operating vehicles in the cache according to the GPS reporting control configuration of the city.
[0049] Preferably, the first reporting unit includes:
[0050] The first determination module is used to determine, for each city, if the driver reporting frequency control is turned on in the city, and the positioning reporting control is not turned on, whether the city meets the preset reporting conditions; wherein the driver reporting frequency control is used to control the driver to report data within a preset time interval; the positioning reporting control is determined by the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages, and the data timeout discard time;
[0051] A traversal locking module, used to traverse the positioning data list when the city meets the preset reporting conditions, and lock all drivers in the positioning data list through a distributed lock;
[0052] The elimination module is used to eliminate all drivers who have failed to lock in the process of traversing the positioning data list, and obtain the drivers to be reported;
[0053] The first reporting module is used to report the positioning data of the operating vehicles of the drivers to be reported in the city.
[0054] It can be known from the above technical scheme that the present application discloses a vehicle positioning data reporting control method and system, which obtains the positioning data of the operating vehicle in real time, and determines the city to which the operating vehicle belongs. According to the city to which the operating vehicle belongs, the positioning data of the operating vehicle is grouped, and each city in the grouping result is traversed. For each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicle corresponding to the city is reported; wherein the preset reporting conditions are conditions determined according to the regulatory requirements of the city for controlling the reporting frequency of the same driver. If the city does not meet the preset reporting conditions, the positioning data of the operating vehicle corresponding to the city is stored in a cache, the positioning data of the operating vehicle in the cache is obtained at regular intervals, and according to the positioning reporting control configuration of the city, the positioning data of the operating vehicle corresponding to the cache is reported.
[0055] Through the above solution, during the operation of the vehicle platform, it is necessary to report the positioning data in accordance with regulatory requirements, and different regulatory departments may have different requirements. This solution does not need to write complex reporting processes for different regulatory requirements. It only needs to determine whether the city to which the operating vehicle belongs meets the preset reporting conditions for controlling the reporting frequency of the same driver determined according to the city's regulatory requirements. If the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city will be reported. If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city that does not meet the preset reporting conditions will be stored in the cache, and the process will be obtained from the cache at a regular interval. According to the positioning reporting control configuration of the city that does not meet the preset reporting conditions, the positioning data of the corresponding operating vehicles in the cache will be reported. The positioning reporting control configuration realizes interface call frequency control, package quantity control, same driver reporting frequency control, data timeliness control, and preset reporting conditions for controlling the reporting frequency of the same driver determined according to the city's regulatory requirements to meet the reporting requirements of each regulatory platform, thereby improving the reusability and timeliness of the positioning data of the operating vehicle reported to the regulatory department to meet the differences in requirements of different regulatory platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0057] Figure 1 A flowchart of a method for controlling the reporting of vehicle positioning data disclosed in an embodiment of the present application;
[0058] Figure 2 A schematic diagram of the reporting control process disclosed in the embodiment of the present application;
[0059] Figure 3 A schematic diagram of the timing task process disclosed in the embodiment of the present application;
[0060] Figure 4 A schematic diagram of the structure of a vehicle positioning data reporting control device disclosed in an embodiment of the present application;
[0061] Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0063] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0064] It can be seen from the background technology that during the operation of the operating vehicle platform, the positioning data of the operating vehicle needs to be reported to the regulatory department in accordance with regulatory requirements. However, each regulatory department may have different requirements. If a reporting process is written for each regulatory department, in the process of reporting the positioning data of the operating vehicle to the regulatory department, problems such as poor reusability and poor timeliness will arise, resulting in the inability to meet the differences in requirements of different regulatory platforms. Therefore, how to improve the reusability and timeliness of reporting the positioning data of the operating vehicle to the regulatory department to meet the differences in requirements of different regulatory platforms is a problem that this application urgently needs to solve.
[0065] In order to solve the above problems, the present application discloses a reporting control method and device for vehicle positioning data. During the operation of the vehicle platform, the positioning data needs to be reported in accordance with regulatory requirements, and different regulatory departments may have different requirements. This solution does not need to compile complex reporting processes for different regulatory requirements. It only needs to judge whether the city to which the operating vehicle belongs meets the preset reporting conditions for controlling the reporting frequency of the same driver determined according to the regulatory requirements of the city. If the city meets the preset reporting conditions, the positioning data of the operating vehicle corresponding to the city is reported. If the city does not meet the preset reporting conditions, the positioning data of the operating vehicle corresponding to the city that does not meet the preset reporting conditions is stored in the cache, and the process is obtained from the cache at a regular interval. According to the positioning reporting control configuration of the city that does not meet the preset reporting conditions, the positioning data of the corresponding operating vehicle in the cache is reported. The positioning reporting control configuration realizes interface call frequency control, package quantity control, same driver reporting frequency control, data timeliness control, and preset reporting conditions for controlling the reporting frequency of the same driver determined according to the regulatory requirements of the city to meet the reporting requirements of each regulatory platform, thereby improving the reusability and timeliness of the GPS data of the operating vehicle reported to the regulatory department to meet the requirements of different regulatory platforms. The specific implementation method is specifically described by the following embodiments.
[0066] refer to Figure 1 As shown, a vehicle positioning data reporting control method disclosed in an embodiment of the present application is shown.
[0067] S101: Acquire the positioning data of the operating vehicle in real time and determine the city to which the operating vehicle belongs;
[0068] In S101, the city to which the operating vehicle belongs may be determined by the license plate number of the operating vehicle.
[0069] Positioning data includes, but is not limited to, Global Positioning System (GPS) data.
[0070] S102: Grouping the positioning data of the operating vehicles according to the cities to which the operating vehicles belong;
[0071] In S102, the operating vehicles in the same city are grouped into one group. For example, the operating vehicles in Guangdong Province, the operating vehicles in Shenzhen City are grouped into one group, and the operating vehicles in Guangzhou City are grouped into one group.
[0072] S103: traverse each city in the grouping result, and for each city, if the city meets the preset reporting condition, execute S104. If the city does not meet the preset reporting condition, execute S105.
[0073] In S103, the reporting control process is used to traverse each city in the grouping result. For each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city is reported.
[0074] Among them, the preset reporting conditions are determined by the driver's reporting frequency control conditions and the reporting control condition positioning reporting control.
[0075] S104: reporting the positioning data of the operating vehicles corresponding to the city; wherein the preset reporting conditions are conditions determined according to the regulatory requirements of the city for controlling the reporting frequency of the same driver.
[0076] Different regulatory departments have different requirements, such as: limiting the frequency of interface calls, such as the interface can only be called once every 30 seconds; package quantity requirements, such as only reporting a maximum of 100 GPS data each time, or trying to package 20 data before reporting; controlling the reporting frequency of the same driver, such as requiring the same driver to report once every 30 seconds or so, and the frequency must not be too high or too low; data timeliness requirements, such as requiring that the difference between the reporting time and the actual positioning time must not exceed 60 seconds, etc.
[0077] Reporting control process:
[0078] The processing method is determined according to the reporting control configuration, where the reporting control configuration includes whether the city has enabled driver reporting frequency control and whether the city has enabled positioning reporting control.
[0079] Specific positioning reporting control process reference Figure 2 shown.
[0080] Figure 2 In the process, GPS data is obtained from the client in real time, grouped by city and traversed. The following process is for a single city in the traversal;
[0081] First, determine whether the driver reporting frequency control is enabled in the current city;
[0082] If the driver reporting frequency control is not enabled in the current city, continue the process;
[0083] If the current city has enabled driver reporting frequency control, obtain the driver reporting frequency configuration of the current city from the distributed configuration center framework (apollo) (for example, 30s, indicating that drivers in this city should report once every 30 seconds or so); it should be noted that apollo is used to implement configuration reading and dynamic modification to respond to regulatory needs in a timely manner;
[0084] Then, the GPS data list is traversed and a distributed lock (redisson) is used to lock each driver. The expiration time is the driver's reporting frequency. Redisson is used to ensure thread safety and avoid unexpected effects caused by concurrency. It can also meet the driver's reporting frequency control requirements.
[0085] During the traversal process, if the driver successfully locks the car, it means that the driver has not reported it within the preset time (such as 30 seconds), and needs to report it this time; if the driver fails to lock the car, it means that the driver has reported it within 30 seconds, and does not need to report it this time; it should be noted that the preset time is set according to the actual situation, and this application does not make a specific limitation;
[0086] After the traversal is completed, the drivers who failed to be locked are eliminated, and the remaining drivers are the drivers that need to be reported this time. If the remaining driver data volume = 0, the reporting control process is terminated;
[0087] Determine whether the current city has GPS reporting control enabled. If the current city has GPS reporting control disabled, directly report the current city’s GPS data to the regulatory authorities. If the current city has GPS reporting control enabled, store all the current city’s GPS data in the cache (redis) in a preset storage order. GPS reporting control refers to other controls besides the driver’s reporting frequency, such as some unimportant and deletable information.
[0088] When storing in redis, the preset storage order is used, that is, the order of entering the queue from the right (rightPushAl) is used for storage. When retrieving from redis in the subsequent scheduled task process, the preset retrieval order (lRange and lTrim) is used to remove from the left to achieve the first-in-first-out effect, ensuring that the GPS data is reported to the regulatory department in chronological order and ensuring the timeliness of GPS data reporting; among them, lRange is to obtain data from the queue within the specified range; lTrim is to remove data from the queue within the specified range; the specified range is set according to the actual situation, and this application does not make specific restrictions.
[0089] Use redis to achieve temporary data storage to meet the requirements of packaging quantity control and interface call frequency control.
[0090] Specifically, each city in the grouping result is traversed. For each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city is reported as shown in A1-A4.
[0091] A1: Traverse each city in the grouping result. For each city, if the city has enabled driver reporting frequency control and has not enabled GPS reporting control, determine whether the city meets the preset reporting conditions. Driver reporting frequency control is used to control drivers to report data within a preset time interval. GPS reporting control is determined by the interface call frequency, the maximum interface call interval, the minimum package quantity, the maximum package quantity, and the data timeout discard time.
[0092] A2: When the city meets the preset reporting conditions, traverse the GPS data list and lock all drivers in the GPS data list through distributed locks.
[0093] A3: When traversing the GPS data list, all drivers who have failed to lock are eliminated to obtain the drivers to be reported.
[0094] In the process of locking all drivers in the GPS data list through distributed locks, if the driver fails to lock, it is determined that the driver who failed to lock has reported the GPS data of the operating vehicle within the specified time, and the operation of the driver who failed to lock to report the GPS data of the operating vehicle is stopped.
[0095] A4: Report the GPS data of the operating vehicles of the drivers to be reported in the corresponding city.
[0096] The execution process and execution principle of A1-A4 are consistent with the execution process and execution principle of the above-mentioned reporting control process, which can be used as a reference and will not be repeated here.
[0097] S105: storing the positioning data of the operating vehicles corresponding to the city in the cache.
[0098] In S105, if the city does not enable driver reporting frequency control, or enables positioning reporting control, it is determined that the city does not meet the preset reporting conditions. If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city are stored in the cache according to the preset storage order.
[0099] The preset storage order is the right entry order (rightPushAll). The location data of the operating vehicles corresponding to the city is stored in the cache from the right entry order, and the preset retrieval order is used when it is retrieved later (i.e. lRange and lTrim are removed from the left), achieving the first-in-first-out effect, ensuring that the location data is reported to the regulatory authorities in chronological order.
[0100] S106: Regularly obtain the positioning data of the operating vehicles in the cache, and report the corresponding positioning data of the operating vehicles in the cache according to the positioning reporting control configuration of the city.
[0101] In S106, the timing task process of the open source distributed task scheduling framework (xxl-job) is used to obtain the positioning data of the operating vehicles in the cache at a regular time, and the positioning data of the corresponding operating vehicles in the cache is reported according to the positioning reporting control configuration of the city.
[0102] Among them, the city's positioning reporting control configuration is obtained from apollo.
[0103] Use xxl-job to implement task scheduling and adjust the task execution interval according to data timeliness requirements.
[0104] The scheduled task process is as follows Figure 3 shown.
[0105] Figure 3 1. The scheduled task can be set to execute every 10s (adjusted according to actual needs). After entering the scheduled task process, first obtain the list of cities that have enabled GPS reporting control, and traverse the list of cities that have enabled GPS reporting control. The following process is for a single city in the traversal.
[0106] 2. For each city in the GPS reporting control city list, obtain the GPS reporting control configuration of the current city, where the GPS reporting control configuration includes five attributes: interface call frequency, maximum interface call interval, minimum package quantity, maximum package quantity, and data timeout discard time.
[0107] 3. Use redisson to lock the current city to avoid concurrency, so as to ensure that only one thread processes the data of the current city at the same time. If the lock fails (for example, the previous scheduled task has not been completed, and the next scheduled task starts to execute, and the same city may compete for the lock at this time, which may cause the lock to fail), the scheduled task process is terminated and the reporting of the current city in this scheduled task is terminated.
[0108] 4. Get the last reporting time of the current city from redis. If the last reporting time exists, the interface call frequency > 0, and the last reporting time + interface call frequency > current time, it means that it is necessary to wait for a certain period of time before reporting, and terminate the scheduled task process. This process is the above-mentioned scheduled task process Figure 3 The process of checking whether the interface call frequency has passed the verification.
[0109] 5. Get the list length of the current city GPS data list from redis. If the list length does not exist or the list length is <= 0, terminate the scheduled task process.
[0110] 6. If the last reporting time exists, and the list length < the minimum quantity for packaging, and the last reporting time + the maximum interface call interval > the current time, it means that the minimum quantity for packaging is not met and the maximum interface call interval is not exceeded, and the scheduled task process is terminated.
[0111] 7. Use lRange and lTrim to sequentially retrieve the current city GPS data list from redis, and remove the data that does not meet the timeliness requirements from the current city GPS data list; the data that does not meet the timeliness requirements is the data where the actual positioning time + the maximum interface call interval <= the current time. At this time, the length of the GPS data list may have changed. If the list length < the maximum number of packages, repeat this step until there is no data in redis, or the list length = the maximum number of packages. If the final list length = 0 (this may happen, for example, the data does not meet the timeliness requirements), terminate the scheduled task process. In this process, there are two points to note:
[0112] When retrieving data from redis, you need to specify the length. When retrieving data for the first time, the length is set to the maximum number of packages. When retrieving data for the second time or later, the length is set to the maximum number of packages - the length of the retrieved data list to avoid the final data list length being greater than the maximum number of packages.
[0113] If the interface call frequency = 0, there is no need to specify the length, and all the data in redis can be directly retrieved.
[0114] 8. Report the GPS data of the corresponding operating vehicle in the cache and store the time of this report in redis.
[0115] Specifically, the GPS data of the operating vehicles in the cache are obtained at regular intervals, and the corresponding GPS data of the operating vehicles in the cache are reported according to the GPS reporting control configuration of the city, such as B1-B9.
[0116] B1: Regularly obtain the GPS data of the operating vehicles in the cache, and obtain the reporting control configuration of the city from the distributed configuration center framework; the reporting control configuration at least includes the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages, and the data timeout discard time;
[0117] B2: Lock the city through distributed locks;
[0118] B3: If the city is locked successfully, obtain the last reporting time corresponding to the city from the cache;
[0119] B4: Verify the interface call frequency by the last reporting time;
[0120] B5: If the interface call frequency is less than or equal to 0, and the sum of the last reporting time and the interface call frequency is less than or equal to the current time, it is determined that the interface call frequency check has passed;
[0121] B6: Under the condition that the interface call frequency check passes, the length of the GPS data list of the city is obtained; wherein the GPS data list is obtained from the cache in a preset fetching order;
[0122] B7: Verify the minimum number of packages and the maximum interface call interval through the list length;
[0123] B8: If the list length is greater than or equal to the minimum number of packages, and the last reporting time and the maximum interface call interval are less than or equal to the current time, it is determined that the verification of the minimum number of packages and the maximum interface call interval has passed;
[0124] Among them, if the list length is less than the minimum number of packages, and the last reporting time is less than the maximum interface call interval and greater than the current time, it means that the minimum number of packages is not met and the maximum interface call interval is not exceeded, and the scheduled task process is terminated.
[0125] B9: Under the condition that the minimum number of packages and the maximum call interval of the interface are verified, the timeout data is removed from the GPS data list, and the GPS data of the operating vehicles corresponding to the city's reporting control configuration in the cache is obtained and reported; among them, the timeout data is determined by the data timeout discarding time; the GPS data of the operating vehicles is the data to be reported.
[0126] Among them, the current city GPS data list is retrieved from redis in sequence through the preset of lRange and lTrim, and the data in the list where the actual positioning time + the maximum interface call interval <= the current time is removed (this part of the data does not meet the timeliness requirement). At this time, the length of the list may change. If the length is < the maximum number of packages, repeat this step until there is no data in redis, or the list length = the maximum number of packages. If the final list length = 0 (this may happen, for example, the data does not meet the timeliness requirement), the scheduled task process is terminated.
[0127] The execution process and execution principle of B1-B9 are consistent with the execution process and execution principle of the above-mentioned scheduled task process, which can be used as a reference and will not be repeated here.
[0128] In the embodiment of the present application, during the operation of the vehicle platform, it is necessary to report the positioning data in accordance with regulatory requirements, and different regulatory departments may have different requirements. This solution does not need to write complex reporting processes for different regulatory requirements. It only needs to determine whether the city to which the operating vehicle belongs meets the preset reporting conditions for controlling the reporting frequency of the same driver determined according to the city's regulatory requirements. If the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city will be reported. If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city that does not meet the preset reporting conditions will be stored in the cache, and the process will be obtained from the cache at a regular interval. According to the positioning reporting control configuration of the city that does not meet the preset reporting conditions, the positioning data of the corresponding operating vehicles in the cache will be reported. The positioning reporting control configuration realizes interface call frequency control, package quantity control, same driver reporting frequency control, data timeliness control, and preset reporting conditions for controlling the reporting frequency of the same driver determined according to the city's regulatory requirements to meet the reporting requirements of each regulatory platform, thereby improving the reusability and timeliness of the positioning data of the operating vehicle reported to the regulatory department to meet the differences in requirements of different regulatory platforms.
[0129] Based on the above embodiments Figure 1 A method for controlling the reporting of vehicle positioning data is disclosed. The embodiment of the present application also discloses a device for controlling the reporting of vehicle positioning data. Figure 4 As shown, the vehicle positioning data reporting control device includes:
[0130] A real-time acquisition unit 401 is used to acquire the positioning data of the operating vehicle in real time and determine the city to which the operating vehicle belongs;
[0131] A grouping unit 402, configured to group the positioning data of the operating vehicles according to the cities to which the operating vehicles belong;
[0132] A traversal unit 403 is used to traverse each city in the grouping result;
[0133] The first reporting unit 404 is used to report the positioning data of the operating vehicles corresponding to each city if the city meets the preset reporting conditions; wherein the preset reporting conditions are conditions determined according to the supervision requirements of the city for controlling the reporting frequency of the same driver;
[0134] Storage unit 405, for storing the location data of the operating vehicles corresponding to the city into a cache if the city does not meet the preset reporting conditions;
[0135] The second reporting unit 406 is used to periodically obtain the positioning data of the operating vehicles in the cache, and report the corresponding positioning data of the operating vehicles in the cache according to the positioning reporting control configuration of the city.
[0136] Furthermore, the first reporting unit 404 includes:
[0137] The first traversal module is used to traverse each city in the grouping result. For each city, if the driver reporting frequency control is turned on in the city, and the positioning reporting control is not turned on, it is determined that the city meets the preset reporting conditions; among which, the driver reporting frequency control is used to control the driver to report data within a preset time interval; the positioning reporting control is determined by the interface call frequency, the maximum interface call interval, the minimum package quantity, the maximum package quantity and the data timeout discard time;
[0138] The second traversal module is used to traverse the location data list when the city meets the preset reporting conditions, and lock all drivers in the location data list through distributed locks;
[0139] The elimination module is used to eliminate all drivers who have failed to lock in the process of traversing the positioning data list, and obtain the drivers to be reported;
[0140] The first reporting module is used to report the positioning data of the operating vehicles of the drivers to be reported in the city.
[0141] Furthermore, the storage unit 405 includes:
[0142] A first determination module is used to determine that a city does not meet the preset reporting conditions if the driver reporting frequency control is not enabled in the city, or the location reporting control is enabled;
[0143] The storage module is used to store the positioning data of the operating vehicles corresponding to the city into the cache in a preset storage order when the city does not meet the preset reporting conditions.
[0144] Furthermore, the vehicle positioning data reporting control device also includes:
[0145] A determination unit is used to, during the process of locking all drivers in the positioning data list through a distributed lock, if the driver fails to lock, determine that the driver who failed to lock has reported the positioning data of the operating vehicle within a specified time, and stop executing the operation of the driver who failed to lock reporting the positioning data of the operating vehicle.
[0146] Furthermore, the second reporting unit 406 includes:
[0147] The first acquisition module is used to periodically acquire the positioning data of the operating vehicles in the cache, and acquire the reporting control configuration of the city from the distributed configuration center framework; the reporting control configuration at least includes the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages, and the data timeout discard time;
[0148] The locking module is used to lock the city through distributed locks;
[0149] The second acquisition module is used to obtain the last reporting time corresponding to the city from the cache if the city is locked successfully;
[0150] The first verification module is used to verify the interface call frequency according to the last reporting time;
[0151] A second determination module is used to determine that the interface call frequency check has passed if the interface call frequency is equal to 0 and the sum of the last reporting time and the interface call frequency is less than or equal to the current time;
[0152] The third acquisition module is used to obtain the list length of the city's positioning data list under the condition that the interface call frequency check passes; wherein the positioning data list is obtained from the cache in a preset fetching order;
[0153] The second verification module is used to verify the minimum number of packages and the maximum interface call interval through the list length;
[0154] A third determination module is used to determine that the verification of the minimum number of packages and the maximum call interval of the interface has passed if the list length is greater than or equal to the minimum number of packages, and the last reporting time and the maximum call interval of the interface are less than or equal to the current time;
[0155] The reporting module is used to remove the timeout data from the positioning data list under the condition that the minimum packaging quantity and the maximum interface call interval are verified, and obtain the positioning data of the operating vehicles corresponding to the city's reporting control configuration in the cache and report it; among which, the timeout data is determined by the data timeout discard time; the positioning data of the operating vehicles is the data to be reported.
[0156] Furthermore, the vehicle positioning data reporting control device also includes:
[0157] A removal unit is used to remove data that does not meet the timeliness requirement in the positioning data list; wherein the data that does not meet the timeliness requirement is determined by the actual positioning time, the maximum interface call interval and the current time data;
[0158] A judging unit, used to judge whether the length of the city location data list is less than the maximum number of packages;
[0159] The return execution unit is used to return to the step of removing the data in the list whose sum of the actual positioning time and the maximum interface call interval is less than or equal to the current time if the list length is less than the maximum packing number, until there is no data in the cache, or the list length is equal to the maximum packing number, and the scheduled task process ends.
[0160] Furthermore, the vehicle positioning data reporting control device also includes:
[0161] The first termination unit is used to terminate the scheduled task process if the interface call frequency is greater than 0 and the sum of the last reporting time and the interface call frequency is greater than the current time.
[0162] Furthermore, the vehicle positioning data reporting control device also includes:
[0163] The second termination unit is used to terminate the scheduled task process if the list length is less than the minimum packaging quantity and the last reporting time and the maximum interface call interval are less than the current time.
[0164] In the embodiment of the present application, during the operation of the vehicle platform, it is necessary to report the positioning data in accordance with regulatory requirements, and different regulatory departments may have different requirements. This solution does not need to write complex reporting processes for different regulatory requirements. It only needs to determine whether the city to which the operating vehicle belongs meets the preset reporting conditions for controlling the reporting frequency of the same driver determined according to the city's regulatory requirements. If the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city will be reported. If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city that does not meet the preset reporting conditions will be stored in the cache, and the process will be obtained from the cache at a regular interval. According to the positioning reporting control configuration of the city that does not meet the preset reporting conditions, the positioning data of the corresponding operating vehicles in the cache will be reported. The positioning reporting control configuration realizes interface call frequency control, package quantity control, same driver reporting frequency control, data timeliness control, and preset reporting conditions for controlling the reporting frequency of the same driver determined according to the city's regulatory requirements to meet the reporting requirements of each regulatory platform, thereby improving the reusability and timeliness of the positioning data of the operating vehicle reported to the regulatory department to meet the differences in requirements of different regulatory platforms.
[0165] An embodiment of the present application further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned vehicle positioning data reporting control method.
[0166] The present application also provides an electronic device, whose structural diagram is as follows: Figure 5 As shown, it specifically includes a memory 501 and one or more instructions 502, wherein the one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to execute the one or more instructions 502 to execute the above-mentioned vehicle positioning data reporting control method.
[0167] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0168] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0169] The steps in the methods of the embodiments of the present application can be adjusted in order, combined, and deleted according to actual needs.
[0170] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0171] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0172] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for controlling the reporting of vehicle positioning data, characterized in that: The method comprises: Obtain the positioning data of operating vehicles in real time and determine the city to which the operating vehicles belong; Grouping the positioning data of the operating vehicles according to the cities to which the operating vehicles belong; Traverse each city in the grouping result; For each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city will be reported; wherein the preset reporting conditions are conditions determined according to the regulatory requirements of the city for controlling the reporting frequency of the same driver; If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city are stored in the cache; The positioning data of the operating vehicles in the cache are obtained at regular intervals, and the positioning data of the corresponding operating vehicles in the cache are reported according to the positioning reporting control configuration of the city.
2. The method according to claim 1, characterized in that For each city, if the city meets the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city is reported, including: For each city, if the driver reporting frequency control is turned on in the city, and the positioning reporting control is not turned on, it is determined that the city meets the preset reporting conditions; wherein the driver reporting frequency control is used to control the driver to report data within a preset time interval; the positioning reporting control is determined by the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages and the data timeout discard time; If the city meets the preset reporting conditions, the location data list is traversed, and all drivers in the location data list are locked through distributed locks; In the process of traversing the positioning data list, all drivers who failed to lock are eliminated to obtain the drivers to be reported; The positioning data of the operating vehicles of the drivers to be reported corresponding to the city are reported.
3. The method according to claim 2, characterized in that If the city does not meet the preset reporting conditions, storing the location data of the operating vehicles corresponding to the city in the cache includes: If the driver reporting frequency control is not enabled in the city, or the location reporting control is enabled, it is determined that the city does not meet the preset reporting conditions; If the city does not meet the preset reporting conditions, the positioning data of the operating vehicles corresponding to the city are stored in the cache in a preset storage order.
4. The method according to claim 2, characterized in that: Also includes: In the process of locking all drivers in the positioning data list through distributed locks, if the driver fails to lock, it is determined that the driver who failed to lock has reported the positioning data of the operating vehicle within the specified time, and the operation of the driver who failed to lock to report the positioning data of the operating vehicle is stopped.
5. The method according to claim 1, characterized in that The positioning data of the operating vehicles in the cache are obtained periodically, and the positioning data of the corresponding operating vehicles in the cache are reported according to the reporting control configuration of the city, including: Obtain the positioning data of the operating vehicles in the cache at regular intervals, and obtain the reporting control configuration of the city from the distributed configuration center framework; the reporting control configuration at least includes the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages, and the data timeout discard time; Locking the city via distributed locks; If the city is locked successfully, the last reporting time corresponding to the city is obtained from the cache; Verify the interface call frequency by the last reporting time; If the interface call frequency is equal to 0, and the sum of the last reporting time and the interface call frequency is less than or equal to the current time, it is determined that the interface call frequency check has passed; Under the condition that the interface call frequency check passes, the length of the location data list of the city is obtained; wherein the location data list is obtained from the cache in a preset fetching order; Verify the minimum number of packages and the maximum interface call interval by using the list length; If the length of the list is greater than or equal to the minimum number of packages, and the last reporting time and the maximum interface call interval are less than or equal to the current time, it is determined that the verification of the minimum number of packages and the maximum interface call interval has passed; Under the condition that the verification of the minimum number of packages and the maximum call interval of the interface is passed, the timeout data is removed from the positioning data list, and the positioning data of the operating vehicles corresponding to the reporting control configuration of the city in the cache is obtained and reported; wherein, the timeout data is determined by the data timeout discarding time; the positioning data of the operating vehicles is the data to be reported.
6. The method according to claim 5, characterized in that Also includes: Eliminate the data that does not meet the timeliness requirement in the positioning data list; wherein the data that does not meet the timeliness requirement is determined by the actual positioning time, the maximum interface call interval and the current time; Determine whether the length of the location data list of the city is less than the maximum number of packages; If the length of the list is less than the maximum number of packages, return to execute the step of removing the data in the list whose sum of the actual positioning time and the maximum interface call interval is less than or equal to the current time, until there is no data in the cache, or the length of the list is equal to the maximum number of packages, and the scheduled task process ends.
7. The method according to claim 5, characterized in that Also includes: If the interface call frequency is greater than 0, and the sum of the last reporting time and the interface call frequency is greater than the current time, the scheduled task process is terminated.
8. The method according to claim 5, characterized in that Also includes: If the list length is less than the minimum number of packages, and the last reporting time is less than the maximum interface call interval and greater than the current time, the scheduled task process is terminated.
9. A vehicle positioning data reporting control device, characterized in that: The device comprises: A real-time acquisition unit is used to acquire the positioning data of the operating vehicle in real time and determine the city to which the operating vehicle belongs; A grouping unit, used for grouping the positioning data of the operating vehicles according to the cities to which the operating vehicles belong; A traversal unit, used for traversing each city in the grouping result; A first reporting unit is used to report the positioning data of the operating vehicles corresponding to each city if the city meets the preset reporting conditions; wherein the preset reporting conditions are conditions determined according to the regulatory requirements of the city for controlling the reporting frequency of the same driver; A storage unit, for storing the positioning data of the operating vehicles corresponding to the city into a cache if the city does not meet the preset reporting conditions; The second reporting unit is used to periodically obtain the positioning data of the operating vehicles in the cache, and report the corresponding positioning data of the operating vehicles in the cache according to the positioning reporting control configuration of the city.
10. The device according to claim 9, characterized in that The first reporting unit includes: The first determination module is used to determine, for each city, if the driver reporting frequency control is turned on in the city and the positioning reporting control is not turned on, whether the city meets the preset reporting conditions; wherein the driver reporting frequency control is used to control the driver to report data within a preset time interval; the positioning reporting control is determined by the interface call frequency, the maximum interface call interval, the minimum number of packages, the maximum number of packages and the data timeout discard time; A traversal locking module, used to traverse the positioning data list when the city meets the preset reporting conditions, and lock all drivers in the positioning data list through a distributed lock; The elimination module is used to eliminate all drivers who have failed to lock in the process of traversing the positioning data list, and obtain the drivers to be reported; The first reporting module is used to report the positioning data of the operating vehicles of the drivers to be reported in the city.