Data forwarding method and apparatus, and electronic device and storage medium

By obtaining vehicle information and forwarding task lists, filtering unexecuted tasks and utilizing multi-threaded asynchronous forwarding, the problems of data extraction duplication, loss and low efficiency in Internet of Vehicles data forwarding are solved, and efficient and reliable data forwarding to the data processing platform is achieved. .

WO2024188253A1PCT designated stage expired Publication Date: 2024-09-19CHERY AUTOMOBILE CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/081294
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-15
Filing Date
2024-03-13
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

Existing Internet of Vehicles data forwarding methods have problems such as repeated data extraction, loss, complex processes, low forwarding efficiency, and the inability to resume interrupted transmissions, especially when using the HBase database and Kettle tools.

Method used

By obtaining the vehicle information list and forwarding task list, we filter out the vehicles that have not performed the forwarding task, and use multi-threaded asynchronous method to store their driving data in the ring queue to achieve efficient forwarding to the data processing platform to ensure that the data is not duplicated or leaked, and Update execution status in the forwarding task list.

Benefits of technology

It achieves efficient access to driving data and ensures that the data is forwarded to the data processing platform without duplication or leakage. It solves the problems of repeated data extraction, loss, complex processes, low forwarding efficiency and inability to resume transmission during the data synchronization process, improving Improve the efficiency and reliability of data forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081294_19092024_PF_FP_ABST
    Figure CN2024081294_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a data forwarding method and apparatus, and an electronic device and a storage medium. The method comprises: acquiring a first vehicle information list to determine first vehicles, which have data processing requirements; acquiring a forwarding task list to determine an execution condition of a forwarding task of each first vehicle, so as to screen vehicle information in the first vehicle information list; removing vehicle information of vehicles, which have executed the forwarding task, so as to obtain a second vehicle information list; then, executing a forwarding task of each second vehicle on the basis of the second vehicle information list, and in combination with an annular queue, forwarding driving data of each second vehicle to a data processing platform by means of multi-thread asynchronous forwarding, such that the data processing platform performs subsequent processing on the driving data; and updating the execution condition of each forwarding task in the forwarding task list. In this way, extracted driving data can be efficiently accessed, and it is ensured that the driving data is forwarded to a data processing platform without being repeated and omitted.
Need to check novelty before this filing date? Find Prior Art

Description

Data forwarding method, device, electronic device and storage medium

[0001] This disclosure is based on a Chinese patent application filed on March 15, 2023, with application number 202310268779.4, and with the title “Data extraction asynchronous forwarding method, device, electronic device and storage medium”, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this disclosure as a reference. Technical Field

[0002] The present application relates to the field of vehicle networking technology, and in particular to a data forwarding method, device, electronic device, and storage medium. Background Art

[0003] With the rapid development of the automotive industry, the Internet of Vehicles (IoV) has become a growing trend. As IoV generates more and more data, there is an urgent need to synchronize driving data stored in IoV databases to data processing platforms for data processing and analysis.

[0004] In related technologies, an HBase database is used to store vehicle driving data, and Kettle (a data conversion tool) is used to extract and parse the data in the HBase database and then forward it to a data processing platform so that the data processing platform can perform subsequent processing on the received data.

[0005] Summary of the Invention

[0006] The present application provides a data forwarding method, device, electronic device and storage medium, and the technical solution is as follows.

[0007] A first aspect of the present application provides a data forwarding method, comprising the following steps: obtaining a first vehicle information list, the first vehicle information list including vehicle information of multiple first vehicles, the vehicle information of the first vehicles indicating vehicles with data processing requirements, the data processing requirements referring to data processing of driving data of the first vehicles by a data processing platform; obtaining a forwarding task list, the forwarding task list including execution status of forwarding tasks for each first vehicle, the forwarding task of the first vehicle referring to forwarding the driving data of the first vehicle in a database to the data processing platform, the database being used to store driving data uploaded by vehicles through an Internet of Vehicles; based on the forwarding task list, filtering the vehicle information in the first vehicle information list to obtain a second vehicle information list, the second vehicle information list including vehicle information of at least one second vehicle, the vehicle information of the second vehicle indicating vehicles among the multiple first vehicles for which forwarding tasks have not been executed; based on the second vehicle information list, executing the forwarding task for each second vehicle, and updating the execution status of the forwarding task for each second vehicle in the forwarding task list, wherein executing the forwarding task for the second vehicle includes: storing the driving data of the second vehicle in the database in a circular queue, and forwarding the driving data in the circular queue to the data processing platform using a multi-threaded asynchronous forwarding method.

[0008] In some embodiments, the execution status of the forwarding task includes the execution progress of the forwarding task, and the method also includes: when there is a first forwarding task in the forwarding task list, based on the execution progress of the first forwarding task in the forwarding task list, continue to execute the first forwarding task until the first forwarding task is successfully executed, and the first forwarding task refers to the forwarding task in which the execution is interrupted.

[0009] In some embodiments, the execution status of the forwarding task includes the reason for the execution exception of the forwarding task, and the method also includes: when there is a second forwarding task in the forwarding task list, compensating the second forwarding task based on the reason for the execution exception of the second forwarding task in the forwarding task list, the second forwarding task refers to the forwarding task in which the execution exception occurs.

[0010] In some embodiments, the method also includes at least one of the following: receiving a first scheduled task, the first scheduled task indicating that the forwarding task is executed in a first time period, the first time period refers to a time period in which the frequency of use of driving data is less than or equal to a first threshold; receiving a second scheduled task, the second scheduled task indicating that the forwarding task is not executed in a second time period, the second time period refers to a time period in which the frequency of use of driving data is greater than a second threshold.

[0011] In some embodiments, the execution status of the forwarding task includes at least one of the following: vehicle information of the vehicle corresponding to the forwarding task, task type of the forwarding task, execution status, execution duration, interruption time, execution progress, and execution exception reason.

[0012] The second embodiment of the present application provides a data forwarding device, including: a first acquisition module, used to obtain a first vehicle information list, the first vehicle information list includes vehicle information of multiple first vehicles, the vehicle information of the first vehicle indicates a vehicle with data processing requirements, and the data processing requirements refer to data processing of the driving data of the first vehicle through a data processing platform; a second acquisition module, used to obtain a forwarding task list, the forwarding task list includes the execution status of the forwarding task of each first vehicle, the forwarding task of the first vehicle refers to forwarding the driving data of the first vehicle in the database to the data processing platform, and the database is used to store the driving data uploaded by the vehicle through the Internet of Vehicles; a screening module, used to select the vehicle based on the first vehicle information list. In the forwarding task list, the vehicle information in the first vehicle information list is filtered to obtain a second vehicle information list, the second vehicle information list includes vehicle information of at least one second vehicle, and the vehicle information of the second vehicle indicates the vehicle among the multiple first vehicles that has not executed the forwarding task; a task execution module is used to execute the forwarding task of each second vehicle based on the second vehicle information list, and update the execution status of the forwarding task of each second vehicle in the forwarding task list, wherein executing the forwarding task of the second vehicle includes: storing the driving data of the second vehicle in the database into a circular queue, and forwarding the driving data in the circular queue to the data processing platform using a multi-threaded asynchronous forwarding method.

[0013] In some embodiments, the execution status of the forwarding task includes the execution progress of the forwarding task, and the task execution module is also used to: when there is a first forwarding task in the forwarding task list, continue to execute the first forwarding task based on the execution progress of the first forwarding task in the forwarding task list until the first forwarding task is successfully executed, and the first forwarding task refers to the forwarding task in which execution interruption occurs.

[0014] In some embodiments, the execution status of the forwarding task includes the reason for the execution exception of the forwarding task. The task execution module is also used to: when there is a second forwarding task in the forwarding task list, compensate the second forwarding task based on the reason for the execution exception of the second forwarding task in the forwarding task list, where the second forwarding task refers to the forwarding task in which the execution exception occurs.

[0015] In some embodiments, the device also includes a receiving module, which is used to do at least one of the following: receiving a first scheduled task, the first scheduled task indicating that a forwarding task is to be executed in a first time period, the first time period being a time period in which the frequency of use of driving data is less than or equal to a first threshold; receiving a second scheduled task, the second scheduled task indicating that the forwarding task is not to be executed in a second time period, the second time period being a time period in which the frequency of use of driving data is greater than a second threshold.

[0016] In some embodiments, the execution status of the forwarding task includes at least one of the following: vehicle information of the vehicle corresponding to the forwarding task, task type of the forwarding task, execution status, execution duration, interruption time, execution progress, and execution exception reason.

[0017] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the data forwarding method as described in the above embodiment.

[0018] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the data forwarding method as described in the above embodiment.

[0019] Thus, by obtaining the first vehicle information list, the first vehicle with data processing requirements is determined, and by obtaining the forwarding task list, the execution status of the forwarding task of each first vehicle is determined, thereby filtering the vehicle information in the first vehicle information list, eliminating the vehicle information that has executed the forwarding task, and retaining the vehicle information that has not executed the forwarding task, and obtaining the second vehicle information list, that is, determining the second vehicle to be executed with the forwarding task, and then executing the forwarding task of each second vehicle based on the second vehicle information list, and combining with the circular queue, forwarding the vehicle data of each second vehicle to the data processing platform (such as the cloud platform) using a multi-threaded asynchronous forwarding method, so that the vehicle data can be subsequently processed by the data processing platform, and the execution status of the forwarding task is updated in the forwarding task list. In this way, the extracted driving data can be efficiently accessed and ensured to be forwarded to the data processing platform without duplication or omission.

[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] FIG1 is a flow chart of a data forwarding method provided according to an embodiment of the present application;

[0023] FIG2 is a flow chart of another data forwarding method provided according to an embodiment of the present application;

[0024] FIG3 is a block diagram of a data forwarding device according to an embodiment of the present application;

[0025] FIG4 is a schematic structural diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0027] It should be noted that the vehicle information, forwarding task lists and other information involved in the embodiments of this application are obtained with the full knowledge and authorization of the user and all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0028] The data forwarding method, device, electronic device and storage medium of the embodiment of the present application are described below with reference to the accompanying drawings. In the related art, when the Kettle tool is used to forward data from the HBase database to the data processing platform, there are problems such as data extraction duplication, loss, complex process, low forwarding efficiency, and inability to resume transmission. Based on this, the present application provides a data forwarding method, in which a first vehicle with data processing requirements is determined by obtaining a first vehicle information list, and the execution status of the forwarding task of each first vehicle is determined by obtaining a forwarding task list, thereby filtering the vehicle information in the first vehicle information list, eliminating the vehicle information for which the forwarding task has been executed, retaining the vehicle information for which the forwarding task has not been executed, and obtaining a second vehicle information list, that is, determining the second vehicle to be executed with the forwarding task, then executing the forwarding task of each second vehicle based on the second vehicle information list, combining the ring queue, and forwarding the driving data of each second vehicle to the data processing platform (such as the cloud platform) using a multi-threaded asynchronous forwarding method, so that the driving data is subsequently processed by the data processing platform, and the execution status of the forwarding task is updated in the forwarding task list. In this way, the extracted driving data can be efficiently accessed and forwarded to the data processing platform without duplication or omission.

[0029] Specifically, the data forwarding method provided in this application is executed by an electronic device, such as a terminal or server, which is not limited in this application. The electronic device is communicatively connected to a data processing platform (e.g., via a wired network or a wireless network), which may be a cloud platform for providing cloud computing services, such as a TSP (Telematics Service Provider) platform, which is not limited in this application.

[0030] FIG1 is a flow chart of a data forwarding method provided in an embodiment of the present application. As shown in FIG1 , the data forwarding method is executed by an electronic device and includes the following steps:

[0031] In step S101, a first vehicle information list is obtained, where the first vehicle information list includes vehicle information of multiple first vehicles, where the vehicle information of the first vehicles indicates vehicles with data processing requirements, where the data processing requirements refer to data processing of driving data of the first vehicles through a data processing platform.

[0032] Wherein, the electronic device is able to access a first relational database (such as MySQL, Oracle, etc.), which is used to store a Vehicle table, which includes vehicle information of multiple vehicles. The first relational database can be deployed on a data processing platform or on an electronic device, and this application does not limit this. Wherein, the vehicle information includes a vehicle identification (such as a VIN code, which is a frame number, that is, a unique identifier for each vehicle), a vehicle type, a vehicle production time, etc., and this application does not limit the specific content of the vehicle information. In this step, the electronic device filters out vehicle information that meets the screening conditions from the first relational database, and generates a first vehicle information list based on the filtered vehicle information. Wherein, the screening condition is whether the vehicle has data processing requirements. Schematically, whether the vehicle has data processing requirements can be determined based on the launch time of the target project. In some embodiments, the electronic device determines whether the vehicle has data processing requirements based on the production time of the vehicle in the vehicle information and the launch time of the target project. If the production time of the vehicle is before the launch time of the target project, it indicates that the vehicle has data processing requirements, and the vehicle is determined as the first vehicle. For example, the target project is to collect statistics on vehicle driving data from YY to ZZ in the XX area, etc., and this application does not limit this. In addition, the vehicle driving data includes but is not limited to the vehicle's driving route, fuel consumption, driving time, etc.

[0033] In some embodiments, after filtering out vehicle information of multiple first vehicles from a first relational database, the electronic device sorts the vehicle information of the multiple first vehicles to obtain a first vehicle information list. The first vehicle information list is also referred to as a vinList, i.e., an information list indexed by the vehicle's VIN code. Illustratively, the electronic device sorts the vehicle information of the multiple first vehicles based on their production time to obtain the first vehicle information list. For example, the vehicle information of the multiple first vehicles may be sorted in descending order of production time, although this application is not limited to this.

[0034] In addition, the embodiment of the present application can set a timer task. When the timer task 1 is triggered, the vehicle information before the launch time of the target project in the vehicle table of the first relational database Vehicle is filtered out, and the filtered vehicle information is sorted to obtain a data list vinList, which is the first vehicle information list. Schematically, the electronic device receives a first timer task, and the first timer task instructs to execute a forwarding task in a first time period. The first time period refers to a time period when the frequency of use of driving data is less than or equal to a first threshold. Among them, the forwarding task refers to forwarding the driving data of the vehicle from the database to the data processing platform so that the data processing platform processes the driving data of the vehicle. The first time period is a preset time period, which can be set according to business needs. For example, the first time period refers to 0:00 to 6:00 in the morning. The first threshold is a preset threshold, which can be set according to business needs. For example, the first threshold is a data usage frequency of 10, which is not limited in this application.

[0035] In step S102, a forwarding task list is obtained, which includes the execution status of the forwarding task of each first vehicle. The forwarding task of the first vehicle refers to forwarding the driving data of the first vehicle in the database to the data processing platform. The database is used to store the driving data uploaded by the vehicle through the Internet of Vehicles.

[0036] Among them, the electronic device is able to access a second relational database (such as MySQL, Oracle, etc.), and the second relational database is used to store a forwarding task list, which is represented as "T_COMMERCIAL_TASK" for example. The second relational database can be deployed on a data processing platform or on an electronic device, and this application does not limit this. For any forwarding task of a first vehicle, the execution status of the forwarding task includes at least one of the following: vehicle information of the vehicle corresponding to the forwarding task, the task type of the forwarding task, the execution status, the execution duration, the interruption time, the execution progress, the reason for the execution exception, etc., and this application does not limit this. In this application, the electronic device is able to access a database for storing driving data, such as an HBase database, and the driving data in the database is uploaded by the vehicle through the Internet of Vehicles. It can be understood that the Hbase database has good read and write performance and can support tables with large amounts of data. Therefore, it is suitable for online databases with huge amounts of data and simple businesses, and is responsible for aggregating data from various business systems.

[0037] In step S103, based on the forwarding task list, the vehicle information in the first vehicle information list is filtered to obtain a second vehicle information list, the second vehicle information list includes vehicle information of at least one second vehicle, and the vehicle information of the second vehicle indicates a vehicle among multiple first vehicles that has not performed the forwarding task.

[0038] The electronic device filters the vehicle information in the first vehicle information list based on the execution status of each forwarding task in the forwarding task list, removes vehicle information for which a forwarding task has been executed, and retains vehicle information for which a forwarding task has not been executed, thereby obtaining a second vehicle information list. This process involves removing data from the first vehicle information list that meets an exclusion condition based on the execution status of each forwarding task in the forwarding task list, thereby obtaining the second vehicle information list. The exclusion condition, for example, is removing VIN codes from the first vehicle information list for which a forwarding task has been executed.

[0039] In step S104, based on the second vehicle information list, the forwarding task of each second vehicle is executed, and the execution status of the forwarding task of each second vehicle is updated in the forwarding task list.

[0040] In particular, for multiple second vehicles in the second vehicle information list, the electronic device executes the forwarding tasks for the multiple second vehicles, including: storing the driving data of the second vehicles in the database into a circular queue, and forwarding the driving data in the circular queue to the data processing platform using a multi-threaded asynchronous forwarding method. In particular, the circular queue is, for example, a Disruptor, which can implement storage and retrieval at the same time. Based on this, the electronic device creates multiple threads, and asynchronously forwards the driving data in the circular queue to the data processing platform through the multiple threads. For example, the number of multiple threads is equal to the number of forwarding tasks for the multiple second vehicles. In this way, one forwarding task can be assigned to one thread for execution. For another example, the number of multiple threads is greater than the number of forwarding tasks for the multiple second vehicles. In this way, one forwarding task can be assigned to multiple threads for execution (e.g., thread A is responsible for forwarding a portion of the driving data required to be forwarded by task 1, and thread B is responsible for the remaining driving data), thereby improving data forwarding efficiency. This application does not limit the specific implementation method of the electronic device for asynchronously forwarding driving data through multiple threads.

[0041] In some embodiments, the electronic device determines whether there is an unfinished forwarding task in the current task list. If there is an unfinished task in the current task list, it locates the last execution node and continues to execute the unfinished task based on the last execution node until there are no unfinished tasks in the current task list. That is, if there is a first forwarding task in the forwarding task list, based on the execution progress of the first forwarding task in the forwarding task list, the first forwarding task is continued to be executed until the first forwarding task is successfully executed. The first forwarding task refers to the forwarding task that has been interrupted. For example, the electronic device determines whether there is an unfinished task in the current task list. If there is an unfinished task in the current task list, it locates the last execution node (that is, the execution progress, such as the driving data to be forwarded includes ABC, the execution progress indicates that the last execution node is A) based on the vin code (that is, the vehicle information) and the stop time (that is, the task interruption time), and continues to execute the unfinished task based on the last execution node, realizing breakpoint resumption, until there are no unfinished tasks in the current task list. If there is no unfinished task in the current task table, the vehicle's driving data (that is, the historical message data of the Internet of Vehicles) is extracted from the Hbase database based on the second vehicle information list, and the extracted driving data is stored in the circular queue. A multi-threaded asynchronous forwarding strategy is adopted to parse the driving data and forward it to the data processing platform for subsequent processing through the data processing platform. The task execution status is persisted to the current task table based on the parsed driving data, that is, the execution status of the forwarding task of each second vehicle is updated in the forwarding task list.

[0042] In some embodiments, the electronic device may first determine whether there is an unfinished forwarding task in the current task table. If so, the unfinished forwarding task is executed first. After no unfinished tasks exist in the current task table, the forwarding task for the second vehicle indicated by the second vehicle information list is executed. For example, a preset extraction strategy is executed, using a multi-threaded approach, with one VIN code corresponding to one forwarding task. The task is extracted backward based on VIN+vehicle type+production time+paging until the launch time of the target project. Specifically, the Internet of Vehicles historical message data is extracted from the Hbase database, and the data of the specified time period is paged and queried using Java API. The extracted data is then placed in a circular queue Disruptor, which is stored and retrieved at the same time. The retrieved data is parsed and forwarded to the TSP platform Kafka using a multi-threaded asynchronous forwarding approach, and the task execution status is persisted to the task table.

[0043] In other embodiments, when there is a second forwarding task in the forwarding task list, the electronic device compensates the second forwarding task based on the execution exception reason of the second forwarding task in the forwarding task list, wherein the second forwarding task refers to the forwarding task in which the execution exception occurs. The execution exception is, for example, that the driving data to be forwarded does not match the driving data that has been forwarded. For example, a forwarding task can forward 10G of driving data, but the driving data of a second vehicle is 12G. The forwarding task of the second vehicle can forward 10G of driving data. If the execution exception occurs, the remaining 2G of driving data can be compensated and forwarded. This compensation process can use manual compensation or automatic compensation, which is not limited in this application.

[0044] In addition, embodiments of the present application can set a scheduled task to stop executing the forwarding task when scheduled task 2 is triggered. For example, the electronic device determines whether a preset sleep command has been received; if so, it stops extracting IoV historical message data from HBase. Illustratively, the electronic device receives a second scheduled task that instructs the forwarding task not to execute during a second time period. The second time period is a time period when the frequency of driving data usage exceeds a second threshold. The second time period is a preset time period that can be set based on business needs, for example, from 7:00 AM to 11:00 PM daily. The second threshold is a preset threshold that can be set based on business needs, for example, a data usage frequency of 10, which is not limited in this application. Specifically, embodiments of the present application execute forwarding tasks during designated time periods based on a sleep strategy, avoiding peak data usage periods, and implement breakpoint-resume functionality based on the execution status of each forwarding task in the forwarding task list. Specifically, upon receiving a preset sleep command, the sleep strategy is executed, halting the forwarding task via thread notification. After processing all the data in the queue, the thread pool is closed. In some embodiments, after receiving a preset sleep instruction, the method further includes: compensating for abnormal items in the current task list based on a preset compensation strategy. That is, after receiving the sleep instruction, if a second forwarding task exists in the forwarding task list, the method further includes compensating for the second forwarding task based on the execution abnormality reason of the second forwarding task in the forwarding task list.

[0045] The above-mentioned data forwarding method is illustrated below with reference to FIG2 . FIG2 is a flowchart of another data forwarding method provided in an embodiment of the present application.

[0046] As shown in Figure 2, after triggering scheduled task 1 (i.e., receiving the first scheduled task), the data in the Vehicle table whose production time is before the launch time of the target project is filtered out and sorted to obtain the first vehicle information table vinList. The vin codes of the forwarding tasks executed in vinList are filtered to obtain the second vehicle information table. It is determined whether there are any unfinished forwarding tasks in the forwarding task list T_COMMERCIAL_TASK. If there are, the last execution node (i.e., execution progress) is located based on the vin code + stop time, and the task is continued to achieve breakpoint resuming. If not, the forwarding task of the second vehicle is executed. In this case, a multi-threaded approach is adopted, with one vin code corresponding to one task. Based on vin + vehicle type + production time + paging, driving data is extracted from the HBase database backward until the launch time of the target project. Based on the data enqueue strategy, the extracted driving data is placed in the circular queue Disruptor. While storing and retrieving, the driving data in the circular queue is parsed and forwarded to the TSP platform Kafka using a multi-threaded asynchronous forwarding approach, and the task execution status is persisted in the forwarding task list.

[0047] After the scheduled task 2 is triggered (that is, the second scheduled task is received), the sleep strategy is executed, and the forwarding task is stopped (that is, the extraction of driving data from the Hbase database) in the form of thread notification, the existing data in the queue is processed, and the thread pool is closed; and based on the automatic compensation strategy, it is triggered after the sleep strategy is executed, and the forwarding tasks in the forwarding task list that have execution exceptions are compensated. Among them, the sleep strategy means that when the sleep strategy is triggered, the data extraction thread stops and no longer stores data in the queue. The technology of processing the existing data in the queue is completed and the thread pool is closed. The compensation strategy includes automatic compensation and manual compensation. Among them, automatic compensation refers to the compensation of tasks in the task list that have execution exceptions by electronic devices, and manual compensation refers to manual compensation by relevant personnel (such as big data staff) when they find data anomalies or mismatches.

[0048] The forwarding task list is described below with reference to Table 1. Table 1 is a forwarding task list provided by this embodiment. In this embodiment, the electronic device can record the forwarding task execution status in T_COMMERCIAL_TASK of the second relational database Mysql through the data processing platform.

[0049] Table 1

[0050] Among them, the No. 2 field VIN is the vehicle frame number, which is the unique identifier of each vehicle, that is, the vehicle identifier. In the task execution status STATE of the forwarding task, "0 Failure" means that an execution exception occurred, "1 Pause" means that an execution interruption occurred, "2 Executing" means that the forwarding task is being executed, and "3 Success" means that the forwarding task has been executed. Therefore, STATE can be used to quickly filter the executed forwarding tasks and view the current task status. In the task type of the forwarding task, "0 Normal" means that the current task is executing normally, and "1 Compensation" means that the current task is being compensated. The STOPTIME field (that is, the stop time) can be used to locate the last execution node, that is, to determine the execution progress, thereby achieving breakpoint resumption. The ERRORINFO field (that is, the reason for the execution exception) can be used to compensate for the forwarding task.

[0051] In summary, in the data forwarding method proposed in the embodiment of the present application, the first vehicle with data processing needs is determined by obtaining the first vehicle information list, and the execution status of the forwarding task of each first vehicle is determined by obtaining the forwarding task list, so as to filter the vehicle information in the first vehicle information list, eliminate the vehicle information for which the forwarding task has been executed, and retain the vehicle information for which the forwarding task has not been executed, and obtain the second vehicle information list, that is, determine the second vehicle for which the forwarding task is to be executed, and then, execute the forwarding task of each second vehicle based on the second vehicle information list, and combine with the circular queue to forward the vehicle data of each second vehicle to the data processing platform (such as the cloud platform) in a multi-threaded asynchronous forwarding manner, so that the vehicle data can be subsequently processed by the data processing platform, and the execution status of the forwarding task is updated in the forwarding task list. In this way, the extracted driving data can be efficiently accessed and ensured to be forwarded to the data processing platform without duplication or omission. That is, by filtering out vehicle information that meets the filtering conditions from a preset first relational database, generating a first vehicle information list based on the filtered vehicle information, and eliminating the data that meets the elimination conditions in the first vehicle information list, a second vehicle information list is obtained, and it is determined whether there are unfinished tasks in the current forwarding task list. If there are no unfinished tasks in the current forwarding task list, based on the second vehicle information list and the preset extraction strategy, the historical message data of the Internet of Vehicles is extracted from the hbase, and the historical message data is stored in a preset circular queue, and a preset multi-threaded asynchronous forwarding strategy is adopted to parse the historical message data and forward it to the data processing platform, so that the task execution status is persisted to the current forwarding task list based on the parsed historical message data through the data processing platform. In this way, the problems of data extraction duplication, loss, complex process, low forwarding efficiency, and inability to resume transmission during data synchronization are solved, and the extracted data is guaranteed to be non-duplicated and non-missing, and the extracted data is efficiently accessed. Moreover, the extraction task is performed in a specified time period to stagger the peak period of data usage.

[0052] Next, a data forwarding device according to an embodiment of the present application will be described with reference to FIG3 . FIG3 is a block diagram of a data forwarding device according to an embodiment of the present application.

[0053] As shown in FIG3 , the data forwarding device 10 includes a first acquisition module 100 , a second acquisition module 200 , a screening module 300 and a task execution module 400 .

[0054] A first acquisition module 100 is configured to acquire a first vehicle information list, the first vehicle information list including vehicle information of a plurality of first vehicles, the vehicle information of the first vehicles indicating vehicles requiring data processing, the data processing requirement being to process driving data of the first vehicles using a data processing platform;

[0055] a second acquisition module 200 for acquiring a forwarding task list, the forwarding task list including the execution status of a forwarding task for each first vehicle, the forwarding task for each first vehicle being to forward the driving data of the first vehicle in a database to the data processing platform, the database being used to store the driving data uploaded by the vehicle via the Internet of Vehicles;

[0056] a screening module 300 configured to screen the vehicle information in the first vehicle information list based on the forwarding task list to obtain a second vehicle information list, the second vehicle information list including vehicle information of at least one second vehicle, the vehicle information of the second vehicle indicating a vehicle among the plurality of first vehicles for which a forwarding task has not been executed;

[0057] The task execution module 400 is used to execute the forwarding task of each second vehicle based on the second vehicle information list, and update the execution status of the forwarding task of each second vehicle in the forwarding task list, wherein the execution of the forwarding task of the second vehicle includes: storing the driving data of the second vehicle in the database into a circular queue, and forwarding the driving data in the circular queue to the data processing platform using a multi-threaded asynchronous forwarding method.

[0058] In some embodiments, the execution status of the forwarding task includes the execution progress of the forwarding task, and the task execution module is also used to: when there is a first forwarding task in the forwarding task list, continue to execute the first forwarding task based on the execution progress of the first forwarding task in the forwarding task list until the first forwarding task is successfully executed, and the first forwarding task refers to the forwarding task in which execution interruption occurs.

[0059] In some embodiments, the execution status of the forwarding task includes the reason for the execution exception of the forwarding task. The task execution module is also used to: when there is a second forwarding task in the forwarding task list, compensate the second forwarding task based on the reason for the execution exception of the second forwarding task in the forwarding task list, where the second forwarding task refers to the forwarding task in which the execution exception occurs.

[0060] In some embodiments, the apparatus further includes a receiving module configured to:

[0061] receiving a first scheduled task, the first scheduled task instructing to execute a forwarding task in a first time period, the first time period being a time period in which a usage frequency of driving data is less than or equal to a first threshold;

[0062] A second scheduled task is received, where the second scheduled task indicates that the forwarding task is not executed in a second time period, where the second time period is a time period when the usage frequency of the driving data is greater than a second threshold.

[0063] In some embodiments, the execution status of the forwarding task includes at least one of the following: vehicle information of the vehicle corresponding to the forwarding task, task type of the forwarding task, execution status, execution duration, interruption time, execution progress, and execution exception reason.

[0064] It should be noted that the above explanation of the data forwarding method embodiment is also applicable to the data forwarding device of this embodiment, and will not be repeated here.

[0065] According to the data forwarding device proposed in the embodiment of the present application, the first vehicle with data processing requirements is determined by obtaining a first vehicle information list, and the execution status of the forwarding task of each first vehicle is determined by obtaining a forwarding task list, thereby filtering the vehicle information in the first vehicle information list, eliminating the vehicle information for which the forwarding task has been executed, and retaining the vehicle information for which the forwarding task has not been executed, to obtain a second vehicle information list, that is, determining the second vehicle for which the forwarding task is to be executed. Then, based on the second vehicle information list, the forwarding task of each second vehicle is executed, and combined with the circular queue, the vehicle data of each second vehicle is forwarded to the data processing platform (such as a cloud platform) using a multi-threaded asynchronous forwarding method, so that the vehicle data can be subsequently processed by the data processing platform, and the execution status of the forwarding task is updated in the forwarding task list. In this way, the extracted driving data can be efficiently accessed and ensured to be forwarded to the data processing platform without duplication or omission.

[0066] FIG4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0067] Memory 401 , processor 402 , and computer programs stored in the memory 401 and executable on the processor 402 .

[0068] When the processor 402 executes the program, the data forwarding method provided in the above embodiment is implemented.

[0069] Furthermore, the electronic device further includes:

[0070] The communication interface 403 is used for communication between the memory 401 and the processor 402 .

[0071] The memory 401 is used to store computer programs that can be run on the processor 402 .

[0072] The memory 401 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0073] If memory 401, processor 402, and communication interface 403 are implemented independently, communication interface 403, memory 401, and processor 402 can be interconnected via a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of illustration, FIG4 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0074] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.

[0075] The processor 402 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0076] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the above data forwarding method when executed by a processor.

[0077] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0078] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0079] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0080] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0081] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0082] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A data forwarding method, characterized in that: The following steps are involved: Acquire a first vehicle information list, the first vehicle information list including vehicle information of a plurality of first vehicles, the vehicle information of the first vehicles indicating vehicles having data processing requirements, the data processing requirements referring to performing data processing on driving data of the first vehicles through a data processing platform; Obtaining a forwarding task list, the forwarding task list including execution status of a forwarding task of each first vehicle, the forwarding task of the first vehicle being to forward driving data of the first vehicle in a database to the data processing platform, the database being used to store driving data uploaded by the vehicle through the Internet of Vehicles; Based on the forwarding task list, the vehicle information in the first vehicle information list is screened to obtain a second vehicle information list, wherein the second vehicle information list includes vehicle information of at least one second vehicle, and the vehicle information of the second vehicle indicates a vehicle among the plurality of first vehicles that has not performed a forwarding task; Based on the second vehicle information list, execute the forwarding task of each second vehicle, and update the execution status of the forwarding task of each second vehicle in the forwarding task list, wherein executing the forwarding task of the second vehicle includes: storing the driving data of the second vehicle in the database into a circular queue, and forwarding the driving data in the circular queue to the data processing platform in a multi-threaded asynchronous forwarding manner.

2. The method according to claim 1, characterized in that The execution status of the forwarding task includes the execution progress of the forwarding task, and the method further includes: When there is a first forwarding task in the forwarding task list, based on the execution progress of the first forwarding task in the forwarding task list, continue to execute the first forwarding task until the first forwarding task is successfully executed, and the first forwarding task refers to the forwarding task whose execution is interrupted.

3. The method according to claim 1, characterized in that The execution status of the forwarding task includes a reason for an execution exception of the forwarding task, and the method further includes: In the case that there is a second forwarding task in the forwarding task list, compensation is performed on the second forwarding task based on the execution exception reason of the second forwarding task in the forwarding task list, where the second forwarding task refers to the forwarding task in which the execution exception occurs.

4. The method according to claim 1, characterized in that: The method further comprises at least one of the following: receiving a first scheduled task, where the first scheduled task indicates that a forwarding task is to be performed in a first time period, where the first time period refers to a time period in which a usage frequency of driving data is less than or equal to a first threshold; A second scheduled task is received, where the second scheduled task indicates that the forwarding task is not executed in a second time period, where the second time period refers to a time period in which the usage frequency of the driving data is greater than a second threshold.

5. The method according to claim 1, characterized in that The execution status of the forwarding task includes at least one of the following: vehicle information of the vehicle corresponding to the forwarding task, task type of the forwarding task, execution status, execution duration, interruption time, execution progress, and execution exception reason.

6. A data forwarding device, characterized in that: include: a first acquisition module, configured to acquire a first vehicle information list, wherein the first vehicle information list includes vehicle information of a plurality of first vehicles, wherein the vehicle information of the first vehicles indicates vehicles having data processing requirements, wherein the data processing requirements refer to data processing of driving data of the first vehicles through a data processing platform; a second acquisition module, configured to acquire a forwarding task list, wherein the forwarding task list includes execution status of a forwarding task of each first vehicle, wherein the forwarding task of the first vehicle refers to forwarding driving data of the first vehicle in a database to the data processing platform, and the database is used to store driving data uploaded by the vehicle through the Internet of Vehicles; a screening module, configured to screen the vehicle information in the first vehicle information list based on the forwarding task list to obtain a second vehicle information list, wherein the second vehicle information list includes vehicle information of at least one second vehicle, and the vehicle information of the second vehicle indicates a vehicle among the plurality of first vehicles that has not executed the forwarding task; A task execution module is used to execute the forwarding task of each second vehicle based on the second vehicle information list, and update the execution status of the forwarding task of each second vehicle in the forwarding task list, wherein the execution of the forwarding task of the second vehicle includes: storing the driving data of the second vehicle in the database into a circular queue, and forwarding the driving data in the circular queue to the data processing platform in a multi-threaded asynchronous forwarding manner.

7. The device according to claim 6, characterized in that The execution status of the forwarding task includes the execution progress of the forwarding task, and the task execution module is further used to: When there is a first forwarding task in the forwarding task list, based on the execution progress of the first forwarding task in the forwarding task list, continue to execute the first forwarding task until the first forwarding task is successfully executed, and the first forwarding task refers to the forwarding task whose execution is interrupted.

8. The device according to claim 6, characterized in that The execution status of the forwarding task includes the execution abnormality reason of the forwarding task, and the task execution module is further used to: In the case that there is a second forwarding task in the forwarding task list, compensation is performed on the second forwarding task based on the execution exception reason of the second forwarding task in the forwarding task list, where the second forwarding task refers to the forwarding task in which the execution exception occurs.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the data forwarding method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the data forwarding method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Vehicle data processing method, processing platform and readable storage medium

    CN113472757A

  • Vehicle log remote monitoring method and device, electronic equipment and storage medium

    CN115225629A

  • Data processing method, device and system

    CN115378946A

  • Vehicle state data processing method and device, electronic equipment and storage medium

    CN115439076A

  • Driving data processing method and device and storage medium

    CN115497194A