Vehicle-mounted bus data processing method and device
By independently setting up a processor management structure for each data platform and selecting a target processor for data processing, the problems of high business logic coupling and poor system scalability in the prior art are solved, lower coupling and higher scalability are achieved, and system performance and maintenance simplicity are improved.
Patent Information
- Application Number
- CN202510181922.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-10
AI Technical Summary
In the existing on-board bus data processing methods, the high degree of business logic coupling and poor system scalability lead to difficult code maintenance, poor scalability and degradation of performance.
By independently setting up a processor management structure for each data platform and selecting the target processor for data processing according to the current service type of on-board bus data to be processed, the coupling degree of business logic is reduced and the scalability of the system is improved.
It realizes reducing business logic coupling and improving system scalability, simplifying code maintenance and data platform expansion, and improving system performance.
Smart Images

Figure CN120123110A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle networking, and in particular, to a method and device for processing in-vehicle bus data. Background Art
[0002] With the rapid development of the automotive industry towards intelligent networking, in-vehicle systems usually need to support the data access requirements of multiple cloud platforms simultaneously, such as: Telematics Service Provider (TSP), national standard platform (GB), enterprise private platform (Private Equity, PE), etc. These platforms all need to perform real-time processing and distribution of data from in-vehicle buses (such as CAN, LIN, FlexRay). To meet the above-mentioned in-vehicle bus data processing requirements, the prior art usually adopts a centralized data processing architecture, for example: a single data processing module is used to uniformly receive and distribute data streams from multiple cloud platforms.
[0003] However, adopting the above-mentioned centralized processing method, although it can achieve data interaction between multiple platforms to a certain extent, there are problems of high business logic coupling degree and poor system scalability. Summary of the Invention
[0004] In view of this, the purpose of the present application is to provide a method and device for processing in-vehicle bus data to solve the problems of high business logic coupling degree and poor system scalability in the existing in-vehicle bus data processing.
[0005] In a first aspect, an embodiment of the present application provides a method for processing in-vehicle bus data, including:
[0006] For each data platform, a processor management structure for recording the processor information of the data platform is set based on the number of business types of the data platform;
[0007] For the in-vehicle bus data to be processed, the target data platform corresponding to the current business type in the in-vehicle bus data to be processed is determined;
[0008] Using the target processor management structure, the target processor under the target data platform corresponding to the current business type is obtained, so as to use the target processor to process the in-vehicle bus data to be processed.
[0009] In an optional implementation manner, before setting the processor management structure for recording the processor information of the data platform based on the number of business types of the data platform, it further includes: setting the business types to be processed and a numerical mark for representing the number of business types for each data platform.
[0010] In an alternative embodiment, a processor management structure for recording the processor information of the data platform is set based on the number of service types of the data platform, including: for each data platform, creating a processor management structure for recording the processor information; based on the numerical label of the data platform, allocating storage space for the processor management structure corresponding to the data platform, where the processor information includes a platform mutex; and initializing the platform mutex corresponding to the data platform.
[0011] In an alternative embodiment, after initializing the platform mutex corresponding to the data platform, it further includes: in response to a registration instruction for a service to be registered in the target data platform, obtaining the processor information to be registered and the service type to be registered; based on the service type to be registered, storing the processor information to be registered in the processor management structure corresponding to the service to be registered; and releasing the platform mutex corresponding to the target data platform.
[0012] In an alternative embodiment, using the target processor management structure to obtain the target processor under the target data platform corresponding to the current service type includes: obtaining the target processor information corresponding to the current service type from the target processor management structure; and using the processor indication identifier recorded in the target processor information to obtain the target processor.
[0013] In an alternative embodiment, obtaining the target processor information corresponding to the current service type from the target processor management structure includes: accessing the target processor management structure using the current service type as an index to obtain the target processor information from the target processor management structure.
[0014] In an alternative embodiment, after accessing the target processor management structure using the current service type as an index, it further includes: checking whether the processor corresponding to the current service type is valid; if the processor corresponding to the current service type is valid, obtaining the processor indication identifier recorded in the target processor information to obtain the target processor using the processor indication identifier.
[0015] In an alternative embodiment, the method further includes: receiving a cancellation request for a service to be cancelled in the target data platform, where the cancellation request includes the service type to be cancelled; clearing the processor information corresponding to the service type to be cancelled in the target data platform, and releasing the service mutex corresponding to the service to be cancelled.
[0016] In an alternative embodiment, after releasing the service mutex corresponding to the service to be cancelled, it further includes: releasing the storage space in the processor management structure corresponding to the service to be cancelled, and destroying the service mutex.
[0017] In a second aspect, an embodiment of the present application further provides an in-vehicle bus data processing device, where the device includes:
[0018] A processor information configuration module, which is used to set a processor management structure for recording the processor information of each data platform based on the number of business types of the data platform for each data platform;
[0019] A data platform determination module, which is used to determine a target data platform corresponding to the current business type in the to-be-processed in-vehicle bus data for the to-be-processed in-vehicle bus data;
[0020] A bus data processing module, which is used to obtain a target processor under the target data platform corresponding to the current business type by using the target processor management structure, so as to perform data processing on the to-be-processed in-vehicle bus data by using the target processor.
[0021] The embodiments of the present application bring the following beneficial effects:
[0022] An in-vehicle bus data processing method and device provided by the embodiments of the present application can independently set a processor management structure for recording processor information for different data platforms, and when performing data processing, select a target processor according to the current business type of the to-be-processed in-vehicle bus data, so as to perform data processing by using the target processor, reduce the coupling degree of business logic, and when it is necessary to increase data platform processing, only need to set a corresponding processor for the data platform, improve the scalability of the system, and compared with the in-vehicle bus data processing method in the prior art, solve the problems of high coupling degree of business logic and poor system scalability.
[0023] To make the above objects, features, and advantages of the present application more obvious and understandable, the following specific preferred embodiments are given below in conjunction with the accompanying drawings and are described in detail as follows. Description of the Drawings
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative efforts.
[0025] Figure 1 Shows a flowchart of the in-vehicle bus data processing method provided by the embodiments of the present application;
[0026] Figure 2 Shows a flowchart of the TBox initialization method provided by the embodiments of the present application;
[0027] Figure 3 Shows a flowchart of the processor registration method provided by the embodiments of the present application;
[0028] Figure 4 The flowchart of the processor cancellation method provided by the embodiments of the present application is shown;
[0029] Figure 5 The structural schematic diagram of the in-vehicle bus data processing device provided by the embodiments of the present application is shown;
[0030] Figure 6 The structural schematic diagram of the electronic device provided by the embodiments of the present application is shown. Detailed implementation manners
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0032] It is worth noting that before the present application was proposed, with the rapid development of the automotive industry towards the intelligent network connection direction, in-vehicle systems usually needed to support the data access requirements of multiple cloud platforms simultaneously, such as: the remote diagnosis platform (Telematics Service Provider, TSP), the national standard platform (GB), the enterprise private platform (Private Equity, PE), etc. These platforms all need to perform real-time processing and distribution on the data from in-vehicle buses (such as CAN, LIN, FlexRay). To meet the above in-vehicle bus data processing requirements, the prior art usually adopts a centralized data processing architecture, for example: a single data processing module is used to uniformly receive and distribute the data streams from multiple cloud platforms. However, adopting the above centralized processing method, although it can achieve data interaction between multiple platforms to a certain extent, there are the following problems:
[0033] High code coupling degree: The business processing logics of each data service platform in the prior art are usually coupled in the same code module, resulting in difficult code maintenance and complex dependency relationships between modules.
[0034] Poor scalability: When new data service platforms or processing logics need to be added, the original code needs to be modified, which easily introduces new errors and does not conform to the open-closed principle.
[0035] Low execution efficiency: The processing method based on conditional judgment requires multiple comparison operations, especially when dealing with a large amount of CAN data, which will lead to a decline in system performance.
[0036] Poor business isolation: The business processing logics of different business platforms are mixed together, and effective business isolation cannot be achieved, increasing the complexity and maintenance difficulty of the system.
[0037] Based on this, the embodiments of the present application provide a method for processing in-vehicle bus data to reduce the coupling degree of business logics and improve business scalability.
[0038] Please refer to Figure 1 , Figure 1 which is a flowchart of a method for processing in-vehicle bus data provided by the embodiments of the present application. As Figure 1 shown, the method for processing in-vehicle bus data provided by the embodiments of the present application includes:
[0039] Step S101, for each data platform, set a processor management structure for recording the processor information of the data platform based on the number of business types of the data platform;
[0040] Step S102, for the in-vehicle bus data to be processed, determine the target data platform corresponding to the current business type in the in-vehicle bus data to be processed;
[0041] Step S103, use the target processor management structure to obtain the target processor under the target data platform corresponding to the current business type, so as to use the target processor to process the in-vehicle bus data to be processed.
[0042] The method for processing in-vehicle bus data provided by the embodiments of the present application can independently set a data structure for recording processor information for different data platforms, and when performing data processing, select the target processor according to the current business type of the in-vehicle bus data to be processed, so as to use the target processor for data processing, reducing the coupling degree of business logics. When it is necessary to add data platform processing, only the corresponding processor needs to be set for the data platform, improving the scalability of the system and solving the problems of high coupling degree of business logics and poor system scalability.
[0043] For the convenience of understanding this embodiment, the following takes the application of the method for processing in-vehicle bus data to a remote communication terminal (such as a Telematics Box, TBox) as an example to separately illustrate the above exemplary steps provided by the embodiments of the present application.
[0044] In step S101, for each data platform, set a processor management structure for recording the processor information of the data platform based on the number of business types of the data platform.
[0045] In this step, the data platform may refer to a cloud platform used to receive in-vehicle bus data and process business data. The data platform includes, but is not limited to: a remote diagnosis platform (TSP), a national standard platform (GB), and an enterprise private platform (PE). The data platform is used to perform real-time processing and distribution of the received in-vehicle bus data.
[0046] In the embodiments of the present application, in order to enable different data platforms to process in-vehicle bus data under their respective services, before setting the data structure for recording processor information for the data platform, the service type to be processed and the numerical flag for characterizing the number of service types may be set for each data platform. For example: the platform type, the service type of each data platform, and the processor management structure may be defined respectively.
[0047] When defining the platform type, the platform type may be defined by enumeration. The platform types include: TSP, GB, and PE.
[0048] When defining the service type of each data platform, it may be defined by an enumeration type, and a member may be added to each data platform at the end of the enumeration type. This member is the numerical flag for characterizing the number of service types. At the same time, a service type identifier is set for each enumeration type. The service type identifier is a continuous integer value used to implement direct addressing of the array. For example: the service types defined by the TSP platform include remote diagnosis service, remote control service, and vehicle parameters. Then the enumeration type may be defined by the following code:
[0049] TSP_BUSINESS_REMOTE_DIAGNOSIS = 0,
[0050] TSP_BUSINESS_REMOTE_CONTROL = 1,
[0051] TSP_BUSINESS_VEHICLE_STATUS = 2,
[0052] TSP_BUSINESS_MAX;
[0053] Among them, TSP_BUSINESS_REMOTE_DIAGNOSIS represents the remote diagnosis service under the TSP platform, TSP_BUSINESS_REMOTE_CONTROL represents the remote control service under the TSP platform, TSP_BUSINESS_VEHICLE_STATUS represents the vehicle parameters under the TSP platform, and TSP_BUSINESS_MAX is the numerical flag. The value of the numerical flag is automatically set to the total number 3 of service types, which is used to represent the number of service types under the TSP platform.
[0054] When defining the processor management structure, the processor management structure may refer to the processor management structure of the data platform. The processor management structure is a data structure that includes: a processor function pointer, a processor validity flag, processor description information, and a mutex lock. Among them, the processor function pointer is used to store the business processing function; the processor validity flag is used to mark whether the processor at the corresponding index position is valid; the processor description information is used to store the description information of the processor; the mutex lock is a platform mutex lock, and the platform mutex lock is used to ensure thread safety during concurrent access by different platforms.
[0055] In one example, after completing the above data structure definition, the TBox can be initialized when the vehicle is powered on for the first time.
[0056] The following refers to Figure 2 to introduce the process of system initialization of the TBox.
[0057] Figure 2 The flowchart of the TBox initialization method provided by the embodiments of the present application is shown. As Figure 2 shown, the TBox initialization method includes:
[0058] Step S1011, for each data platform, create a processor management structure for recording processor information for the data platform.
[0059] The processor management structure may refer to a data structure for storing processor information. As an example, the processor management structure can be a structure. At this time, a processor management structure for recording processor information can be created for each of the above three data platforms.
[0060] Among them, the processor management structure includes a processor information array, an array size, and a service mutex lock. The service mutex lock can also be called a processor mutex lock. The service mutex lock is used to perform mutex processing on different services under the same platform. The service mutex lock can also be reused when registering different data platforms.
[0061] Each element in the processor information array is used to store the processor information corresponding to a service type. The processor information corresponding to each service type includes a processor function pointer, processor description information, a processor validity flag, and a processor context. For example: The TSP platform has a total of three service types, so the number of elements in the processor information array is 3, and each element corresponds to a service type respectively, so as to describe the processor information corresponding to the service type through this element.
[0062] Step S1012, based on the numerical label of the data platform, allocate storage space for the processor management structure corresponding to the data platform.
[0063] Taking the TSP platform as an example, obtain the maximum value of the business type corresponding to the TSP platform, that is, obtain the value of the numerical tag TSP_BUSINESS_MAX of the TSP platform. Then, according to the value of the numerical tag TSP_BUSINESS_MAX, dynamically allocate a storage space for the processor information array in the processor management structure for the data platform TSP, and record the allocated space size in the array size of the processor management structure for subsequent boundary checks.
[0064] Step S1013, initialize the platform mutex corresponding to the data platform.
[0065] Initialize the platform mutex object to protect concurrent access between data platforms. At the same time, set all processor function pointers, processor description information, and processor contexts under the data platform to NULL, and initialize all processor validity flags under the data platform to invalid.
[0066] In an alternative embodiment, after initialization, processor registration is also required. The following refers to Figure 3 to introduce the processor registration process in detail.
[0067] Figure 3 shows a flowchart of the processor registration method provided by an embodiment of the present application. As Figure 3 shown, the processor registration method includes:
[0068] Step S1014, in response to a registration instruction for a business to be registered for a target data platform, verify the validity of the registration parameters.
[0069] The registration instruction includes multiple registration parameters, and the multiple registration parameters include a platform type, a business type to be registered, and processor information to be registered. Among them, the processor information to be registered may refer to the processor information corresponding to the business to be registered, and the processor information to be registered includes a processor function pointer and processor description information.
[0070] In an embodiment of the present application, after receiving the registration instruction, obtain the processor information corresponding to the business to be registered and the business type to be registered through the registration parameters in the registration instruction. According to the platform type in the registration parameters, determine whether the target data platform is a TSP or a GB, and according to the business type to be registered in the registration parameters, determine which services under the target data platform need to be registered. At the same time, obtain the processor information to be registered in the registration parameters.
[0071] Determine whether there is a preset platform type in multiple preset platform types (TSP, GB, PE) that matches the platform type in the registration parameters. If there is a matching preset platform type, determine that the registration parameter of the platform type in the registration parameters is valid. If there is no matching preset platform type, determine that the registration parameter of the platform type in the registration parameters is invalid. Similarly, it is also necessary to perform validity verification on the business type to be registered and the processor information to be registered in the registration parameterization.
[0072] Step S1015, store the processor information to be registered in the processor management structure corresponding to the business to be registered;
[0073] Use the business type identifier as an index to find the storage space location of the processor management structure corresponding to the target data platform. After finding the storage space location of the processor management structure, store the processor information to be registered (such as processor function pointers and processor description information) in the array element corresponding to the business to be registered in this storage space.
[0074] Then, set the processor validity flag corresponding to the business to be registered in this processor management structure to valid.
[0075] Step S1016, release the business mutex corresponding to the business to be registered.
[0076] Since a processor management structure has been created for each data platform, the business mutex corresponding to the business to be registered can be obtained from the processor management structure corresponding to the target data platform, and the business mutex corresponding to the business to be registered is released.
[0077] In addition, if all the businesses of the target data platform have been registered, obtain the platform mutex corresponding to the target data platform and release the platform mutex.
[0078] In step S102, for the in-vehicle bus data to be processed, determine the target data platform corresponding to the current business type in the in-vehicle bus data to be processed.
[0079] In this step, the in-vehicle bus data to be processed is collected via in-vehicle sensors or other in-vehicle devices, and the TBox receives the in-vehicle bus data to be processed collected by the in-vehicle sensors or other in-vehicle devices.
[0080] The in-vehicle bus data includes the current business type, data length, and data payload. Among them, the data payload can refer to specific bus data, such as: data such as the voltage, current, and temperature of in-vehicle devices.
[0081] In an embodiment of the present application, each data platform is traversed to determine whether there is a business type that matches the current business type among the registered business types to be processed of the data platform. If there is a matching business type, the data platform is used as the target data platform; if there is no matching business type, it is determined that the data platform is not the target data platform.
[0082] For example: both the TSP platform and the GB platform have registered the remote diagnosis service. Then, when the current business type in the in-vehicle bus data is the remote diagnosis service, the TSP platform and the GB platform are the target data platforms.
[0083] In step S103, using the target processor management structure, the target processor under the target data platform corresponding to the current business type is obtained, so as to use the target processor to process the to-be-processed in-vehicle bus data.
[0084] In this step, the target processor management structure may refer to the processor management structure corresponding to the target data platform.
[0085] In an implementation of the present application, since the processor information of different business types under the target data platform is stored in the target processor management structure, the target processor information corresponding to the current business type can be obtained from the target processor management structure. When obtaining the target processor information, the current business type can be used as an index to access the target processor management structure to obtain the target processor information from the target processor management structure.
[0086] For example: the current business type is the remote diagnosis service. If the TSP platform is the target data platform, since the business type identifier of the current business type is TSP_REMOTE_DIAGNOSIS and the value of TSP_REMOTE_DIAGNOSIS is 0, the processor information array in the target processor management structure can be accessed using the index value 0, so as to obtain the target processor information corresponding to the remote diagnosis service.
[0087] Then, the processor validity flag recorded in the target processor information is obtained, and it is checked whether the processor validity flag is valid. For example: if the value of the processor validity flag is 1, it is determined that the processor is valid; if the value of the processor validity flag is 0, it is determined that the processor is invalid. If the validity of the processor is valid, the processor indication identifier recorded in the target processor information is obtained to obtain the target processor using the processor indication identifier.
[0088] Obtain the target processor by using the processor indication identifier recorded in the target processor information. As an example, the processor indication identifier may refer to a processor function pointer, and the target processor function can be obtained through the processor function pointer. The target processor function is the target processor, and the business data processing can be performed by calling the target processor function.
[0089] In one example, when a certain business of a data platform is no longer processed, the business can be cancelled. Cancelling the business is equivalent to cancelling the processor corresponding to the business type. At this time, a cancellation request for the business to be cancelled in the target data platform can be received. In response to the cancellation request, the processor cancellation process is started. Among them, the cancellation request can be a request sent by the cloud platform. The target data platform where the business to be cancelled is located can be determined through the platform type in the cancellation request. The cancellation request includes multiple cancellation parameters, and the multiple cancellation parameters include the platform type and the business type to be cancelled.
[0090] The following refers to Figure 4 to introduce the cancellation process of the processor in detail.
[0091] Figure 4 shows the flowchart of the processor cancellation method provided by the embodiment of the present application. As Figure 4 shown, the processor cancellation method includes:
[0092] Step S1031, verify the validity of the cancellation parameters.
[0093] In response to the cancellation request, obtain multiple cancellation parameters in the cancellation request, and verify the validity of each cancellation parameter.
[0094] For example: determine whether there is a preset platform type in multiple preset platform types (such as TSP, GB, PE) that matches the platform type in the cancellation request. If there is a matching preset platform type, it is determined that the cancellation parameter of the platform type passes the validity verification.
[0095] Step S1032, clear the processor information corresponding to the business to be cancelled.
[0096] Use the business type to be cancelled as an index to query the processor information corresponding to the business to be cancelled, and clear the processor information.
[0097] Step S1033, set the processor corresponding to the business to be cancelled to invalid.
[0098] Set the processor validity flag in the processor information corresponding to the business to be cancelled to invalid.
[0099] Step S1034, release the business mutex corresponding to the business to be cancelled.
[0100] Obtain the business mutex corresponding to the business to be cancelled, and release the business mutex corresponding to the business to be cancelled.
[0101] In one example, after completing the processor cancellation process corresponding to the business to be cancelled, it is also necessary to release the memory space occupied by the business to be cancelled. At this time, the memory space occupied by the processor information array of the processor management structure to be cancelled can be released, and the business mutex object corresponding to the business to be cancelled can be destroyed.
[0102] It should be noted that only after all the businesses under the target data platform are cancelled can the memory space occupied by the processor management structure corresponding to the target data platform be released, and the business mutex objects corresponding to each business to be cancelled under the target data platform be destroyed. Finally, obtain and release the platform mutex corresponding to the target data platform. If there are business mutexes and platform mutexes, the business mutexes need to be released first, and then the platform mutexes.
[0103] In addition, the platform mutex and the business mutex can be reused, which can simplify the design by using a single mutex and avoid the complexity brought by multiple mutexes.
[0104] Based on the same inventive concept, an on-vehicle bus data processing device corresponding to the on-vehicle bus data processing method is also provided in an embodiment of the present application. Since the principle of solving problems by the device in the embodiment of the present application is similar to that of the above on-vehicle bus data processing method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0105] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of an on-vehicle bus data processing device provided by an embodiment of the present application. As Figure 5 shown in
[0106] The processor information configuration module 201 is used to set a processor management structure for recording the processor information of each data platform based on the number of business types of the data platform;
[0107] The data platform determination module 202 is used to determine the target data platform corresponding to the current business type in the on-vehicle bus data to be processed for the on-vehicle bus data to be processed;
[0108] The bus data processing module 203 is used to obtain the target processor under the target data platform corresponding to the current business type by using the target processor management structure, so as to perform data processing on the on-vehicle bus data to be processed by using the target processor.
[0109] Please refer to Figure 6 , Figure 6The following is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 6 shown in the figure, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0110] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 runs, the processor 310 communicates with the memory 320 through the bus 330. When the machine-readable instructions are executed by the processor 310, the steps of the in-vehicle bus data processing method in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here. Figure 1 shown in the figure, the steps of the in-vehicle bus data processing method in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here.
[0111] The embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the in-vehicle bus data processing method in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here. Figure 1 shown in the figure, the steps of the in-vehicle bus data processing method in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here.
[0112] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.
[0113] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed with each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0114] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0115] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0116] When the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0117] Finally, it should be noted that the above-mentioned embodiments are only specific implementation manners of the present application, used to illustrate the technical solutions of the present application, rather than limiting them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present application can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes, or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application and should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A vehicle bus data processing method, characterized in that: include: For each data platform, a processor management structure for recording processor information of the data platform is set based on the number of business types of the data platform; For the vehicle bus data to be processed, determining a target data platform corresponding to the current service type in the vehicle bus data to be processed; The target processor management structure is used to obtain the target processor under the target data platform corresponding to the current business type, so as to use the target processor to perform data processing on the vehicle bus data to be processed.
2. The method according to claim 1, characterized in that: Before setting the processor management structure for recording the processor information of the data platform based on the number of business types of the data platform, the method further includes: The business types to be processed and the numerical tags used to characterize the number of business types are set for each data platform.
3. The method according to claim 2, characterized in that The processor management structure for recording processor information of the data platform is set based on the number of business types of the data platform, including: For each data platform, create a processor management structure for recording processor information for the data platform; Allocate storage space for a processor management structure corresponding to the data platform based on the numerical tag of the data platform, wherein the processor information includes a platform mutex lock; Initialize the platform mutex lock corresponding to the data platform.
4. The method according to claim 3, characterized in that After the platform mutex lock corresponding to the data platform is initialized, the method further includes: In response to a registration instruction for a service to be registered in a target data platform, obtaining information of a processor to be registered and a type of service to be registered; Based on the type of the service to be registered, storing the processor information to be registered in a processor management structure corresponding to the service to be registered; Release the platform mutex corresponding to the target data platform.
5. The method according to claim 1, characterized in that The using the target processor management structure to obtain the target processor under the target data platform corresponding to the current business type includes: Acquire target processor information corresponding to the current service type from the target processor management structure; The target processor is acquired by using the processor indication identifier recorded in the target processor information.
6. The method according to claim 5, characterized in that The acquiring the target processor information corresponding to the current service type from the target processor management structure includes: The target processor management structure is accessed by using the current service type as an index to obtain target processor information from the target processor management structure.
7. The method according to claim 5, characterized in that After accessing the target processor management structure using the current service type as an index, the method further includes: Check whether the processor corresponding to the current service type is valid; If the processor corresponding to the current service type is valid, the processor indication identifier recorded in the target processor information is obtained, so as to obtain the target processor by using the processor indication identifier.
8. The method according to claim 1, characterized in that The method further comprises: Receiving a deregistration request for a service to be deregistered in a target data platform, wherein the deregistration request includes a type of service to be deregistered; Clear the processor information corresponding to the service type to be deregistered in the target data platform, and release the service mutex corresponding to the service to be deregistered.
9. The method according to claim 8, characterized in that After releasing the service mutex corresponding to the service to be cancelled, the method further includes: The storage space in the processor management structure corresponding to the service to be cancelled is released, and the service mutex is destroyed.
10. A vehicle bus data processing device, characterized in that: include: A processor information configuration module, used to set, for each data platform, a processor management structure for recording processor information of the data platform based on the number of business types of the data platform; A data platform determination module, used for determining, for the vehicle bus data to be processed, a target data platform corresponding to the current service type in the vehicle bus data to be processed; The bus data processing module is used to use the target processor management structure to obtain the target processor under the target data platform corresponding to the current business type, so as to use the target processor to process the vehicle bus data to be processed.