Operation vehicle data reporting method and device, equipment and medium
By introducing a fuse mechanism and timing reconnection task in the reporting system of the operating vehicle platform, the reporting system instability caused by abnormal supervision system is solved, and higher stability and reliability are achieved.
Patent Information
- Application Number
- CN202411811414.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-11
AI Technical Summary
The operating vehicle platform reporting system frequently throws abnormalities when the supervision system is abnormal, resulting in an increase in load and affecting the stability of the platform.
A fuse mechanism is introduced, and whether to report data is determined based on the fuse status of the downstream platform before reporting, and the fuse status is updated according to the results after reporting, and the fuse status is processed through the timing reconnection task.
It effectively avoids the load increase caused by continuous call to abnormal downstream platforms, and improves the stability and reliability of the reporting system of the operating vehicle platform.
Smart Images

Figure CN119814875A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and medium for reporting operating vehicle data. Background Art
[0002] In accordance with relevant regulatory requirements, the operating vehicle platform needs to report the operating vehicle data during the operation process to the regulatory system of the regulatory department platform through the reporting system. During the specific implementation process, the reporting system directly calls the interface of the regulatory system for reporting.
[0003] However, in the actual environment, because the supervision system may have anomalies, such as system upgrades or system errors, the reporting system fails to call the supervision system interface. At this time, the reporting system will frequently throw exceptions, causing the load to increase, affecting the stability of the entire operating vehicle platform. Therefore, a reporting method is urgently needed to improve the stability of the reporting system of the operating vehicle platform. Summary of the invention
[0004] The present application provides a method, device, equipment and medium for reporting operating vehicle data, which can improve the stability of the operating vehicle platform reporting system.
[0005] In a first aspect, the present application provides a method for reporting operating vehicle data, the method comprising:
[0006] Acquire operating vehicle data and determine the downstream platform corresponding to the operating vehicle data;
[0007] If the fuse status of the downstream platform is not blown, reporting the operating vehicle data to the downstream platform;
[0008] If the downstream platform turns on the fuse function, obtain the reporting result of the operating vehicle data;
[0009] According to the reporting result, updating the fuse status in the cache;
[0010] Obtain a list of downstream platforms with the fuse function enabled at regular intervals, and traverse the downstream platforms with the fuse function enabled in the list of downstream platforms with the fuse function enabled;
[0011] According to the blown circuit state and reconnection interval configuration of the downstream platform with the blown circuit function enabled, reconnect to the downstream platform with the blown circuit function enabled, and return to the downstream platform with the blown circuit function enabled in the list of downstream platforms with the blown circuit function enabled, until the last downstream platform with the blown circuit function enabled in the list of downstream platforms with the blown circuit function enabled is obtained.
[0012] Optionally, updating the fuse status in the cache according to the reporting result includes:
[0013] If the reporting result is successful, obtain the number of reporting errors of the downstream platform;
[0014] When the number of reported errors is greater than 0, the number of reported errors of the downstream platform and the fuse status of the downstream platform in the cache are deleted.
[0015] Optionally, updating the fuse status in the cache according to the reporting result includes:
[0016] If the reporting result is unsuccessful, the number of reported errors of the downstream platform is increased by 1 to obtain an updated number of reported errors;
[0017] Get the maximum number of consecutive error reports from the distributed configuration center framework;
[0018] When the updated number of reported errors is greater than or equal to the maximum number of consecutive reported errors, the fuse state of the downstream platform in the cache is set to blown.
[0019] Optionally, the reconnecting to the downstream platform with the fuse function enabled according to the fuse state and reconnection interval configuration of the downstream platform with the fuse function enabled includes:
[0020] Obtaining the fuse status of the downstream platform with the fuse function enabled;
[0021] If the fuse status of the downstream platform with the fuse function enabled is blown, obtain the last reconnection time corresponding to the downstream platform with the fuse function enabled from the cache;
[0022] Obtaining the reconnection interval configuration of the downstream platform from the distributed configuration center framework;
[0023] Performing a reconnection interval check according to the last reconnection time and the reconnection interval configuration;
[0024] If the sum of the last reconnection time and the reconnection interval configuration is less than or equal to the current time, it is determined that the reconnection interval check passes;
[0025] Under the condition that the reconnection interval check passes, reconnecting to the downstream platform with the fuse function enabled;
[0026] Get the reconnection result and update the reconnection time of the downstream platform with the circuit breaker function enabled in the cache.
[0027] Optionally, the reconnecting to the downstream platform with the fuse function enabled under the condition that the reconnection interval check passes includes:
[0028] Under the condition that the reconnection interval check passes, the record of the last failed report is obtained from the cache; the record of the last failed report includes the operating vehicle data corresponding to the downstream platform with the fuse function turned on;
[0029] The downstream platform with the fuse function enabled performs the reporting of the operating vehicle data, obtains the reporting result of the operating vehicle data, and updates the fuse status in the cache according to the reporting result.
[0030] Optionally, obtaining the reconnection result and updating the reconnection time of the downstream platform with the fuse function enabled in the cache includes:
[0031] Determine whether the reconnection is successful;
[0032] If the reconnection is successful, the reconnection time of the downstream platform with the fuse function enabled in the cache is deleted;
[0033] If the reconnection fails, the last reconnection time of the downstream platform with the fuse function enabled in the update cache is used as the current reconnection time.
[0034] Optionally, the method further comprises:
[0035] If the fuse status of the downstream platform with the fuse function enabled is already blown, the reporting process is terminated.
[0036] Optionally, the method further comprises:
[0037] If the downstream platform does not have the circuit breaker function enabled, the reporting process is terminated.
[0038] In a second aspect, the present application further provides a device for reporting operating vehicle data, the device comprising:
[0039] A first acquisition unit, configured to acquire operating vehicle data and determine a downstream platform corresponding to the operating vehicle data;
[0040] A reporting unit, configured to report the operating vehicle data to the downstream platform if the fuse status of the downstream platform is not blown;
[0041] A second acquisition unit is used to acquire the reporting result of the operating vehicle data if the downstream platform turns on the fuse function;
[0042] An updating unit, used for updating the fuse status in the cache according to the reporting result;
[0043] A third acquisition unit is used to periodically acquire a list of downstream platforms with the fuse function enabled, and traverse the downstream platforms with the fuse function enabled in the list of downstream platforms with the fuse function enabled;
[0044] A reconnection unit is used to reconnect the downstream platform with the fuse function turned on according to the fuse status of the downstream platform with the fuse function turned on and the reconnection interval configuration, and return to the downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on, until the last downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on is obtained.
[0045] Optionally, the updating unit is specifically configured to:
[0046] If the reporting result is successful, obtain the number of reporting errors of the downstream platform;
[0047] When the number of reported errors is greater than 0, the number of reported errors of the downstream platform and the fuse status of the downstream platform in the cache are deleted.
[0048] Optionally, the updating unit is specifically configured to:
[0049] If the reporting result is unsuccessful, the number of reported errors of the downstream platform is increased by 1 to obtain an updated number of reported errors;
[0050] Get the maximum number of consecutive error reports from the distributed configuration center framework;
[0051] When the updated number of reported errors is greater than or equal to the maximum number of consecutive reported errors, the fuse state of the downstream platform in the cache is set to blown.
[0052] Optionally, the reconnection unit comprises:
[0053] A first acquisition module is used to obtain the fuse status of the downstream platform with the fuse function enabled;
[0054] A second acquisition module is used to acquire, from a cache, the last reconnection time corresponding to the downstream platform with the fuse function enabled, if the fuse state of the downstream platform with the fuse function enabled is already blown;
[0055] A third acquisition module is used to acquire the reconnection interval configuration of the downstream platform from the distributed configuration center framework;
[0056] A verification module, configured to perform a reconnection interval verification according to the last reconnection time and the reconnection interval configuration;
[0057] A verification result judgment module, used to determine that the reconnection interval check has passed if the sum of the last reconnection time and the reconnection interval configuration is less than or equal to the current time;
[0058] A reconnection module, used for reconnecting to the downstream platform with the fuse function enabled under the condition that the reconnection interval check passes;
[0059] The update module is used to obtain the reconnection result and update the reconnection time of the downstream platform with the fuse function enabled in the cache.
[0060] Optionally, the reconnection module is specifically used to:
[0061] Under the condition that the reconnection interval check passes, the record of the last failed report is obtained from the cache; the record of the last failed report includes the operating vehicle data corresponding to the downstream platform with the fuse function turned on;
[0062] The downstream platform with the fuse function enabled performs the reporting of the operating vehicle data, obtains the reporting result of the operating vehicle data, and updates the fuse status in the cache according to the reporting result.
[0063] Optionally, the update module is specifically used to:
[0064] Determine whether the reconnection is successful;
[0065] If the reconnection is successful, the reconnection time of the downstream platform with the fuse function enabled in the cache is deleted;
[0066] If the reconnection fails, the last reconnection time of the downstream platform with the fuse function enabled in the update cache is used as the current reconnection time.
[0067] Optionally, the device further comprises a termination unit;
[0068] The termination unit is used to terminate the reporting process if the fuse status of the downstream platform with the fuse function enabled is already blown.
[0069] Optionally, the termination unit is further used to terminate the reporting process if the downstream platform that enables the fuse function does not enable the fuse function.
[0070] In a third aspect, the present application further provides an electronic device, the electronic device comprising a processor and a memory:
[0071] The memory is used to store computer programs;
[0072] The processor is used to execute the method provided in the first aspect according to the computer program.
[0073] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided in the first aspect above.
[0074] It can be seen that this application has the following beneficial effects:
[0075] The present application provides a method, device, equipment and medium for reporting operating vehicle data, in which the operating vehicle data is obtained and the downstream platform corresponding to the operating vehicle data is determined; if the fuse status of the downstream platform is not blown, the operating vehicle data is reported to the downstream platform; if the downstream platform has the fuse function turned on, the reporting result of the operating vehicle data is obtained; according to the reporting result, the fuse status in the cache is updated; the list of downstream platforms with the fuse function turned on is obtained at regular intervals, and the downstream platforms with the fuse function turned on in the list of downstream platforms with the fuse function turned on are traversed; according to the fuse status of the downstream platform with the fuse function turned on and the reconnection interval configuration, the downstream platform with the fuse function turned on is reconnected, and the downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on is returned to execute the traversal until the last downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on is obtained. Thus, compared with the solution of directly calling the external interface in the prior art, the present application introduces a fuse mechanism. Before reporting, it is decided whether to report the operating vehicle data according to the fuse status of the downstream platform. After reporting, the fuse status of the downstream platform in the cache is updated according to the reporting result of the operating vehicle data. Without affecting the original reporting function, the abnormal state of the downstream platform is discovered in time. In this way, when it is found that the downstream platform is continuously abnormal, the fuse status of the downstream platform can be updated to achieve timely fuse, avoiding the load increase caused by the continuous call of the abnormal downstream platform, and improving the stability of the operating vehicle platform reporting system. In addition, the downstream platform with the fuse function turned on is scanned regularly, and the reconnection operation is performed for the downstream platform that has been fused. By turning on the scheduled reconnection task, it can automatically try to re-establish the connection after the connection fails, thereby ensuring the normal reporting of the operating vehicle data, reducing the risk of interruption of the reporting system due to connection failure, and improving the overall stability and reliability of the reporting system. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0077] Figure 1 A flowchart of a method for reporting operating vehicle data in an embodiment of the present application;
[0078] Figure 2 A schematic diagram of the reporting process disclosed in the embodiment of the present application;
[0079] Figure 3 A schematic diagram of the timing task process disclosed in the embodiment of the present application;
[0080] Figure 4A schematic diagram of the structure of a reporting device 400 for operating vehicle data provided in this application;
[0081] Figure 5 A schematic diagram of the structure of an electronic device 500 provided in this application. DETAILED DESCRIPTION
[0082] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0083] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, it should be noted that, for ease of description, only the parts related to the present application are shown in the accompanying drawings, not all structures.
[0084] In the prior art, because the supervision system may have anomalies, such as system upgrades or system errors, the reporting system fails to call the supervision system interface. At this time, the reporting system will frequently throw exceptions, causing the load to increase, affecting the stability of the entire operating vehicle platform. Therefore, there is an urgent need for a reporting method that can improve the stability of the reporting system of the operating vehicle platform.
[0085] Based on this, the present application provides a method, device, equipment and medium for reporting operating vehicle data, in which the operating vehicle data is obtained and the downstream platform corresponding to the operating vehicle data is determined; if the fuse status of the downstream platform is not blown, the operating vehicle data is reported to the downstream platform; if the downstream platform has the fuse function turned on, the reporting result of the operating vehicle data is obtained; according to the reporting result, the fuse status in the cache is updated; the list of downstream platforms with the fuse function turned on is obtained at regular intervals, and the downstream platforms with the fuse function turned on in the list of downstream platforms with the fuse function turned on are traversed; according to the fuse status of the downstream platform with the fuse function turned on and the reconnection interval configuration, the downstream platform with the fuse function turned on is reconnected, and the downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on is returned to execute the traversal until the last downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on is obtained.
[0086] Thus, compared with the solution of directly calling the external interface in the prior art, the present application introduces a fuse mechanism. Before reporting, it is decided whether to report the operating vehicle data according to the fuse status of the downstream platform. After reporting, the fuse status of the downstream platform in the cache is updated according to the reporting result of the operating vehicle data. Without affecting the original reporting function, the abnormal state of the downstream platform is discovered in time. In this way, when it is found that the downstream platform is continuously abnormal, the fuse status of the downstream platform can be updated to achieve timely fuse, avoiding the load increase caused by the continuous call of the abnormal downstream platform, and improving the stability of the operating vehicle platform reporting system. In addition, the downstream platform with the fuse function turned on is scanned regularly, and the reconnection operation is performed for the downstream platform that has been fused. By turning on the scheduled reconnection task, it can automatically try to re-establish the connection after the connection fails, thereby ensuring the normal reporting of the operating vehicle data, reducing the risk of interruption of the reporting system due to connection failure, and improving the overall stability and reliability of the reporting system.
[0087] To facilitate understanding of the specific implementation of the method for reporting operating vehicle data provided in the embodiment of the present application, an explanation will be given below with reference to the accompanying drawings.
[0088] It should be noted that the subject implementing the method for reporting the operating vehicle data may be the reporting device for operating vehicle data provided in the embodiment of the present application, and the reporting device for operating vehicle data may be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method for reporting the operating vehicle data in the embodiment of the present application, for example, an Internet of Things (IoT) device.
[0089] See also Figure 1 , a flow chart of a method for reporting operating vehicle data is provided. In an embodiment of the present application, for example, the following steps may be included:
[0090] S1, obtain the operating vehicle data and determine the downstream platform corresponding to the operating vehicle data.
[0091] It should be noted that the downstream platform is the platform to which the operating vehicle data is to be reported. It is called the downstream platform because it is in the downstream position in the entire data reporting process.
[0092] In the specific implementation process, the downstream platform is the regulatory department platform. After the operating vehicle data is ready, the downstream platform corresponding to the operating vehicle data is determined in order to obtain the fuse status of the downstream platform.
[0093] S2: If the fuse status of the downstream platform is not blown, report the operating vehicle data to the downstream platform.
[0094] It should be noted that, because the interface is part of the downstream platform, obtaining the fuse status of the downstream platform is actually obtaining the fuse status of the interface of the downstream platform.
[0095] In a possible implementation, the method provided in the embodiment of the present application may further include: if the fuse status of the downstream platform is blown, terminating the reporting process.
[0096] In an embodiment of the present application, if the fuse status of the downstream platform is blown, it proves that the downstream platform is in an abnormal state and the reporting process is terminated. If the fuse status of the downstream platform is not blown, the operating vehicle data is reported normally.
[0097] S3: If the downstream platform turns on the fuse function, obtain the reporting results of the operating vehicle data.
[0098] In a possible implementation, the method provided in the embodiment of the present application may further include: if the downstream platform does not enable the fuse function, terminating the reporting process.
[0099] In an embodiment of the present application, it is determined whether the downstream platform to be reported has turned on the fuse function. If the fuse function is not turned on, the reporting process is terminated; if the fuse function is turned on, it is determined whether the report is successful and the reporting result of the operating vehicle data is obtained.
[0100] S4: Update the fuse status in the cache based on the reported result.
[0101] It should be noted that the cache is, for example, redis, and the cache stores the fuse status of the downstream platform.
[0102] In a possible implementation, S4 may include:
[0103] S411: If the reporting result is successful, obtain the number of reporting errors of the downstream platform.
[0104] S412: When the number of reported errors is greater than 0, the number of reported errors of the downstream platform and the fuse status of the downstream platform in the cache are deleted.
[0105] In an embodiment of the present application, if the report is successful, it proves that there is no abnormality in the downstream platform and the report can be made normally. Then, the number of reported errors of the downstream platform is obtained from redis. If the number of reported errors exists and is greater than 0, the number of reported errors and the corresponding fuse status are deleted from redis.
[0106] In a possible implementation, S4 may include:
[0107] S421: If the reporting result is unsuccessful, the number of reported errors of the downstream platform is increased by 1 to obtain an updated number of reported errors.
[0108] S422, obtaining the maximum number of consecutive error reporting times from the distributed configuration center framework.
[0109] S423: When the updated number of reported errors is greater than or equal to the maximum number of consecutive reported errors, the fuse state of the downstream platform in the cache is set to blown.
[0110] If the report fails, the number of reported errors of the downstream platform in redis will be increased by 1 as the latest number of reported errors, and then the maximum number of consecutive reported errors of the downstream platform will be obtained from the distributed configuration center framework (apollo). If the updated number of errors is greater than or equal to the maximum number of consecutive reported errors, the fuse status of the downstream platform in redis will be updated to blown.
[0111] For example, the maximum number of consecutive error reports stored in Apollo for the downstream platform is 5, and this report is the 5th report, that is, the number of reported errors stored in redis for the downstream platform is 4. If this report fails, the number of reported errors + 1 will be used as the updated number of reported errors in redis, that is, the number of reported errors of the downstream platform stored in redis is updated to 5. At this time, because the updated number of reported errors 5 = the maximum number of consecutive error reports 5, the fuse status of the downstream platform in redis is updated to blown.
[0112] S1 to S4 above are the descriptions of the reporting process. For details, please refer to Figure 2 The schematic diagram of the public reporting process shows that stability is a necessary consideration for the long-term normal operation of the system, especially in the process of interacting with external systems, special attention should be paid to the health status of the external system. Compared with the solution of directly calling the external system interface, the method provided in the embodiment of the present application introduces a fuse mechanism. Before reporting, it is determined whether to report based on the fuse status of the downstream platform; after reporting, the number of consecutive errors and the fuse status of the downstream platform are updated based on the success or failure of the reporting result. When the downstream platform is unavailable for a long time, the fuse status of the downstream platform is set to be blown, that is, the interface of the downstream platform is blown, and the reporting of operating vehicle data is suspended to avoid continuous calls to abnormal downstream platforms causing an increase in the load of the operating vehicle platform reporting system, thereby improving the stability of the operating vehicle platform reporting system.
[0113] S5, periodically obtain a list of downstream platforms with the circuit breaker function enabled, and traverse the downstream platforms with the circuit breaker function enabled in the list of downstream platforms.
[0114] In the embodiment of the present application, for example, the scheduled task process of the open source distributed task scheduling framework (xxl-job) can be used to regularly traverse the downstream platforms with the fuse function turned on in the downstream platform list with the fuse function turned on, wherein xxl-job is used to implement task scheduling, and the task execution interval can be adjusted according to the data timeliness requirements, for example, the scheduled task process can be set to execute once every minute (adjusted according to actual needs). After entering the scheduled task process, first obtain the list of downstream platforms with the fuse function turned on and traverse it, and execute step S5 for a single downstream platform with the fuse function turned on during the traversal.
[0115] S6, according to the fuse status of the downstream platform with the fuse function turned on and the reconnection interval configuration, reconnect to the downstream platform with the fuse function turned on, and return to execute the traversal of the downstream platforms with the fuse function turned on in the list of downstream platforms with the fuse function turned on, until the last downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function is obtained.
[0116] In a possible implementation, if the fuse status of the downstream platform with the fuse function enabled is not blown, the scheduled task process is terminated.
[0117] In a possible implementation, S6 provided in the embodiment of the present application may include:
[0118] S61, obtaining the fuse status of the downstream platform with the fuse function enabled.
[0119] S62: If the fuse status of the downstream platform with the fuse function enabled is already blown, obtain the last reconnection time corresponding to the downstream platform with the fuse function enabled from the cache.
[0120] In a possible implementation, if the fuse status of the downstream platform is not blown, the scheduled task process is terminated.
[0121] In the specific implementation process, the last reconnection time of the downstream platform that has the circuit breaker function enabled and is in the circuit breaker state is obtained from redis.
[0122] S63, obtaining the reconnection interval configuration of the downstream platform from the distributed configuration center framework.
[0123] In the specific implementation process, the reconnection interval configuration can be obtained from the distributed configuration center framework (apollo).
[0124] S64, performing a reconnection interval check according to the last reconnection time and the reconnection interval configuration.
[0125] S65: If the sum of the last reconnection time and the reconnection interval configuration is less than or equal to the current time, it is determined that the reconnection interval check has passed.
[0126] If the sum of the last reconnection time and the reconnection interval configuration is greater than the current time, it is determined that the reconnection interval check has failed.
[0127] In an embodiment of the present application, if the last reconnection time exists and the last reconnection time + reconnection interval configuration > current time, it means that it is necessary to wait for a certain period of time before reconnecting, and the scheduled task process is terminated; if the last reconnection time + reconnection interval configuration ≤ current time, it is determined that the reconnection interval check has passed.
[0128] S66, under the condition that the reconnection interval check passes, reconnect to the downstream platform with the fuse function enabled.
[0129] In the embodiment of the present application, reconnection is performed only when the reconnection interval check passes, thereby avoiding frequent reconnection to the downstream platform that has been blown, and improving the stability of the reporting system of the operating vehicle platform to a certain extent.
[0130] In a possible implementation, S66 provided in the embodiment of the present application may include:
[0131] S661, under the condition that the reconnection interval check passes, obtain the record of the last failed report from the cache, and the record of the last failed report includes the operating vehicle data corresponding to the downstream platform with the fuse function enabled.
[0132] S662, reporting the operating vehicle data to the downstream platform with the fuse function turned on, obtaining the reporting results of the operating vehicle data, and updating the fuse status in the cache according to the reporting results.
[0133] It should be noted that reconnection includes obtaining the most recent report failure record and executing the reporting process. The scheduled task process does not include the logic of the number of operation reporting errors and the fuse status, because the reporting process will be executed in the reconnection action, and this logic is already included in the reporting process.
[0134] S67, obtain the reconnection result, and update the reconnection time of the downstream platform with the fuse function enabled in the cache.
[0135] In the embodiment of the present application, if the reconnection is successful, the reconnection time is deleted from redis; otherwise, the reconnection time is updated to redis.
[0136] Then, in the embodiment of the present application, S67 may include:
[0137] S671, determine whether the reconnection is successful.
[0138] S672: If the reconnection is successful, delete the reconnection time of the downstream platform with the fuse function enabled in the cache.
[0139] S673: If the reconnection fails, the last reconnection time of the downstream platform with the fuse function enabled in the cache is updated as the current reconnection time.
[0140] It should be noted that the above S61~S67 can be regarded as a traversal of a single downstream platform with the fuse function turned on in the scheduled task process. For each traversal, the scheduled task process obtains the fuse status of the downstream platform from redis. If it is not blown, the scheduled task process is terminated to terminate the reconnection to the downstream platform. If it is blown, it is reconnected when the reconnection interval check is successful, thereby realizing the scheduled reconnection task. After the reconnection is successful, the fuse status is released and reporting is resumed.
[0141] In this way, in the embodiment of the present application, a fuse mechanism is added, which can promptly detect anomalies of the external system without affecting the original functions. When the downstream platform continues to be abnormal, the interface can be promptly fused to avoid continuous call exceptions affecting the stability of the reporting system of the operating vehicle platform; and, the downstream platforms with the fuse function turned on are scanned periodically, and the reconnection operation is performed for the downstream platforms that have been fused. By turning on the scheduled reconnection task, it can automatically try to re-establish the connection after a connection failure, thereby ensuring the normal reporting of the operating vehicle data, reducing the risk of interruption of the reporting system due to connection failure, and improving the overall stability and reliability of the reporting system.
[0142] See also Figure 4 The embodiment of the present application further provides a device 400 for reporting operating vehicle data, the device 400 comprising:
[0143] The first acquisition unit 401 is used to acquire operating vehicle data and determine a downstream platform corresponding to the operating vehicle data;
[0144] A reporting unit 402, configured to report the operating vehicle data to the downstream platform if the fuse status of the downstream platform is not blown;
[0145] The second acquisition unit 403 is used to acquire the reporting result of the operating vehicle data if the downstream platform turns on the fuse function;
[0146] An updating unit 404, configured to update the fuse status in the cache according to the reporting result;
[0147] The third acquisition unit 405 is used to periodically acquire a list of downstream platforms with the fuse function enabled, and traverse the downstream platforms with the fuse function enabled in the list of downstream platforms with the fuse function enabled;
[0148] The reconnection unit 406 is used to reconnect the downstream platform with the fuse function turned on according to the fuse status of the downstream platform with the fuse function turned on and the reconnection interval configuration, and return to execute the traversal of the downstream platform list with the fuse function turned on, until the last downstream platform with the fuse function turned on in the downstream platform list with the fuse function turned on is obtained.
[0149] Optionally, the updating unit 404 is specifically configured to:
[0150] If the reporting result is successful, the number of reporting errors of the downstream platform is obtained;
[0151] When the number of reported errors is greater than 0, the number of reported errors of the downstream platform and the fuse status of the downstream platform in the cache are deleted.
[0152] Optionally, the updating unit 404 is specifically configured to:
[0153] If the reporting result is unsuccessful, the number of reported errors of the downstream platform is increased by 1 to obtain an updated number of reported errors;
[0154] Get the maximum number of consecutive error reports from the distributed configuration center framework;
[0155] When the updated number of reported errors is greater than or equal to the maximum number of consecutive reported errors, the fuse state of the downstream platform in the cache is set to blown.
[0156] Optionally, the reconnection unit 406 includes:
[0157] A first acquisition module is used to obtain the fuse status of the downstream platform with the fuse function enabled;
[0158] A second acquisition module is used to acquire, from a cache, the last reconnection time corresponding to the downstream platform with the fuse function enabled, if the fuse state of the downstream platform with the fuse function enabled is already blown;
[0159] A third acquisition module is used to acquire the reconnection interval configuration of the downstream platform from the distributed configuration center framework;
[0160] A verification module, configured to perform a reconnection interval verification according to the last reconnection time and the reconnection interval configuration;
[0161] A verification result judgment module, used to determine that the reconnection interval check has passed if the sum of the last reconnection time and the reconnection interval configuration is less than or equal to the current time;
[0162] A reconnection module, used for reconnecting to the downstream platform with the fuse function enabled under the condition that the reconnection interval check passes;
[0163] The update module is used to obtain the reconnection result and update the reconnection time of the downstream platform with the fuse function enabled in the cache.
[0164] Optionally, the reconnection module is specifically used to:
[0165] Under the condition that the reconnection interval check passes, the record of the last failed report is obtained from the cache; the record of the last failed report includes the operating vehicle data corresponding to the downstream platform with the fuse function turned on;
[0166] The downstream platform with the fuse function enabled performs the reporting of the operating vehicle data, obtains the reporting result of the operating vehicle data, and updates the fuse status in the cache according to the reporting result.
[0167] Optionally, the update module is specifically used to:
[0168] Determine whether the reconnection is successful;
[0169] If the reconnection is successful, the reconnection time of the downstream platform with the fuse function enabled in the cache is deleted;
[0170] If the reconnection fails, the last reconnection time of the downstream platform with the fuse function enabled in the update cache is used as the current reconnection time.
[0171] Optionally, the device 400 further includes a termination unit 407;
[0172] The termination unit 407 is configured to terminate the reporting process if the fuse status of the downstream platform with the fuse function enabled is already blown.
[0173] Optionally, the termination unit 407 is further configured to terminate the reporting process if the downstream platform that enables the fuse function does not enable the fuse function.
[0174] In addition, the present application embodiment also provides an electronic device 500, such as Figure 5 As shown, the electronic device 500 includes a processor 501 and a memory 502:
[0175] The memory 502 is used to store computer programs;
[0176] The processor 501 is used to execute according to the computer program Figure 1 , Figure 2 or Figure 3 The method provided.
[0177] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided by the embodiment of the present application.
[0178] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0179] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the goals of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0180] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope of the present application.
Claims
1. A method for reporting operating vehicle data, characterized in that: The method comprises: Acquire operating vehicle data and determine the downstream platform corresponding to the operating vehicle data; If the fuse status of the downstream platform is not blown, reporting the operating vehicle data to the downstream platform; If the downstream platform turns on the fuse function, obtain the reporting result of the operating vehicle data; According to the reporting result, updating the fuse status in the cache; Obtain a list of downstream platforms with the fuse function enabled at regular intervals, and traverse the downstream platforms with the fuse function enabled in the list of downstream platforms with the fuse function enabled; According to the blown circuit state and reconnection interval configuration of the downstream platform with the blown circuit function enabled, reconnect to the downstream platform with the blown circuit function enabled, and return to the downstream platform with the blown circuit function enabled in the list of downstream platforms with the blown circuit function enabled, until the last downstream platform with the blown circuit function enabled in the list of downstream platforms with the blown circuit function enabled is obtained.
2. The method according to claim 1, characterized in that: The updating of the fuse status in the cache according to the reporting result includes: If the reporting result is successful, obtain the number of reporting errors of the downstream platform; When the number of reported errors is greater than 0, the number of reported errors of the downstream platform and the fuse status of the downstream platform in the cache are deleted.
3. The method according to claim 1, characterized in that The updating of the fuse status in the cache according to the reporting result includes: If the reporting result is unsuccessful, the number of reported errors of the downstream platform is increased by 1 to obtain an updated number of reported errors; Get the maximum number of consecutive error reports from the distributed configuration center framework; When the updated number of reported errors is greater than or equal to the maximum number of consecutive reported errors, the fuse state of the downstream platform in the cache is set to blown.
4. The method according to claim 1, characterized in that: The reconnecting to the downstream platform with the fuse function enabled according to the fuse state and the reconnection interval configuration of the downstream platform with the fuse function enabled includes: Obtaining the fuse status of the downstream platform with the fuse function enabled; If the fuse status of the downstream platform with the fuse function enabled is blown, obtain the last reconnection time corresponding to the downstream platform with the fuse function enabled from the cache; Obtaining the reconnection interval configuration of the downstream platform from the distributed configuration center framework; Performing a reconnection interval check according to the last reconnection time and the reconnection interval configuration; If the sum of the last reconnection time and the reconnection interval configuration is less than or equal to the current time, it is determined that the reconnection interval check passes; Under the condition that the reconnection interval check passes, reconnecting to the downstream platform with the fuse function enabled; Get the reconnection result and update the reconnection time of the downstream platform with the circuit breaker function enabled in the cache.
5. The method according to claim 4, characterized in that The step of reconnecting to the downstream platform with the fuse function enabled under the condition that the reconnection interval check passes includes: Under the condition that the reconnection interval check passes, the record of the last failed report is obtained from the cache; the record of the last failed report includes the operating vehicle data corresponding to the downstream platform with the fuse function turned on; The downstream platform with the fuse function enabled performs the reporting of the operating vehicle data, obtains the reporting result of the operating vehicle data, and updates the fuse status in the cache according to the reporting result.
6. The method according to claim 4, characterized in that The obtaining of the reconnection result and updating the reconnection time of the downstream platform with the fuse function enabled in the cache includes: Determine whether the reconnection is successful; If the reconnection is successful, the reconnection time of the downstream platform with the fuse function enabled in the cache is deleted; If the reconnection fails, the last reconnection time of the downstream platform with the fuse function enabled in the update cache is used as the current reconnection time.
7. The method according to claim 1, characterized in that The method further comprises: If the fuse status of the downstream platform with the fuse function enabled is already blown, the reporting process is terminated.
8. A device for reporting operating vehicle data, characterized in that: The device comprises: A first acquisition unit, configured to acquire operating vehicle data and determine a downstream platform corresponding to the operating vehicle data; A reporting unit, configured to report the operating vehicle data to the downstream platform if the fuse status of the downstream platform is not blown; A second acquisition unit is used to acquire the reporting result of the operating vehicle data if the downstream platform turns on the fuse function; An updating unit, used for updating the fuse status in the cache according to the reporting result; A third acquisition unit is used to periodically acquire a list of downstream platforms with the fuse function enabled, and traverse the downstream platforms with the fuse function enabled in the list of downstream platforms with the fuse function enabled; A reconnection unit is used to reconnect the downstream platform with the fuse function turned on according to the fuse status of the downstream platform with the fuse function turned on and the reconnection interval configuration, and return to the downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on, until the last downstream platform with the fuse function turned on in the list of downstream platforms with the fuse function turned on is obtained.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 7 according to the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.