Detailed Description
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 shows a flowchart of a data acquisition method according to an embodiment of the present application, for a vehicle, the method includes:
S110, responding to the data acquisition request of the data acquisition unit, and acquiring target service information corresponding to the target service requested by the data acquisition request from the target service configuration file.
The target service configuration file comprises service information of each of a plurality of services, the target service configuration file is generated based on a service end message sent by a data acquisition protocol stack in a data acquisition unit, the service end message is sent to the data acquisition protocol stack by a service unit providing the plurality of services, and the service end message is generated by the service unit providing the plurality of services according to the service information aiming at the plurality of services.
The Service may be an SOA (Service-Or iented Architecture oriented architecture) Service in a vehicle, the Service may include a cabin Service, a intelligent driving Service, and an entertainment Service, the cabin Service includes an air conditioning Service, a lighting Service, a seat Service, etc. in a cabin, the intelligent driving Service includes an automatic lane changing Service, an automatic steering Service, an automatic parking Service, etc., and the entertainment Service includes a music Service, a video Service, etc.
The service information of the service is used for describing service attributes of the service, for example, the service information of the service can comprise a service instance, a version, a life cycle, a stage where the service is located, a service availability state and deployment information of the service, wherein the service instance of the service refers to an instance of the service, namely, a service materialization instance, the version of the service refers to a version number of the current service, the life cycle of the service refers to the whole process of creating, starting, running and ending the service, the stage where the service is located refers to a process where the service is located in the whole life cycle, the service availability state refers to whether the service is available or not, and the deployment information of the service can comprise an IP address, a port number and the like of the service.
The unit for providing the foregoing service in the vehicle serves as a service unit, the unit for acquiring data of each service in the vehicle serves as a data acquisition unit, and the data acquisition unit may integrate a data acquisition application to implement the data acquisition method of the present application by the data acquisition application, that is, the data acquisition unit may serve as an execution subject to implement the data acquisition method of the present application.
In still another embodiment, the vehicle may also be an execution subject, and the vehicle integrates a data acquisition application implementing the data acquisition method of the present application, and interacts with the data acquisition unit through the data acquisition application to implement the data acquisition method of the present application.
The vehicle can be an electric vehicle or a fuel oil vehicle, or can be a car, suv, a bus, a truck and the like, and the data acquisition unit can be a central operation component in the vehicle, wherein the central operation component is used for processing and deciding the data acquired by the vehicle.
In this embodiment, one service unit may provide at least one service, and the related multiple services may be provided through at least one service unit, where the service unit refers to a control unit for providing a service in a vehicle, for example Tbox may be one service unit, for example, an entertainment center may be another service unit, for example, an autopilot module may also be one service unit (a sub-module in the autopilot module may also be one service unit, for example, an autopilot sub-module is one service unit).
In this embodiment, the data acquisition unit communicates with the service unit through the data acquisition protocol stack, so as to implement data interaction between the data acquisition unit and the service unit. The data acquisition protocol stack may be a SOME/IP protocol stack, that is, the data acquisition unit communicates with the service unit via the SOME/IP protocol. In addition, different service units can also communicate through SOME/IP protocol, namely, each service unit has a SOME/IP protocol stack, and the service units communicate with each other through the respective SOME/IP protocol stacks.
For each service unit, the service unit may generate an information message (e.g., SOMEIP SD Offer message) based on service information of a service provided by the service unit, as a service end message, where the service end message includes service end messages generated by all service units for providing the plurality of services. All service units for providing the plurality of services can periodically send the service end message to the data acquisition protocol stack in the data acquisition unit. For example, every 1 second or every 2s, all service units for providing the aforementioned plurality of services generate a service-side packet based on service information for the plurality of services, and send the service-side packet to a data acquisition protocol stack in the data acquisition unit.
After the data acquisition protocol stack obtains the service end message, the service end message can be sent, at this time, the vehicle (or a data acquisition unit in the vehicle) receives the service end message sent by the data acquisition protocol stack, extracts a plurality of services and respective service information of the plurality of services from the service end message, and encapsulates the plurality of services and respective service information of the plurality of services to obtain a target service configuration file.
That is, the service unit for providing a plurality of services sends a service side message for a plurality of services (the service side message includes a service side message generated by each service unit), extracts service information corresponding to a service from the service side message, one service corresponds to one service information, and after extracting each service and service information corresponding to each service, may aggregate the plurality of services and the service information corresponding to the plurality of services, and encapsulate the aggregated result to obtain the target service configuration file.
In some embodiments, the data acquisition method may be implemented by a data acquisition application, which may be deployed in a vehicle or a data acquisition unit of the vehicle, and the data acquisition application may be provided with three modules, namely, a dynamic service discovery module, a service information cache module, and a service information management module, so as to implement the data acquisition method of the present application by using the three modules.
Illustratively, the dynamic service discovery module periodically (e.g., every 1s or every 2 s) communicates with the SOME/IP protocol stack (i.e., the aforementioned data acquisition protocol stack) in the data acquisition unit to acquire a service side message (the service side message includes a plurality of services and service information of each of the plurality of services). The SOME/IP protocol stack in the data acquisition unit can receive the service end message sent by the service unit for a plurality of service periods (for example, every 1s or every 2 s), so that the dynamic service discovery module can acquire the service end message from the SOME/IP protocol stack.
And then, the service information caching module gathers service information lists of a plurality of services and service information of the plurality of services in the service end message and caches the service information lists into the service information lists, then, the service information management module acquires service information from the service information lists and packages the service information acquired from the service information lists into an AP I interface (App l icat ion Programming I NTERFACE, an application programming interface) to obtain a service configuration file in a vsomeip.json format, and the service configuration file can be used as a target service configuration file for providing the service information for other unit applications in the vehicle in a SOME/IP service mode.
In some embodiments, before receiving the service side message sent by the data acquisition protocol stack, the method may include sending, by the data acquisition protocol stack, a service information acquisition request to a service unit providing a plurality of services in response to a target event trigger, so that the service unit providing the plurality of services returns the service side message based on the service information acquisition request. The target event may include, among other things, a first start of the data acquisition application, a power-up of the vehicle or a power-up of the data acquisition unit, etc.
That is, in the event of a target event, the vehicle (or the data acquisition unit of the vehicle) actively transmits a service information acquisition request for requesting the service unit providing a plurality of services to return a service-side message to the service unit providing the plurality of services through the data acquisition protocol stack
In this embodiment, the data acquisition request may be generated based on a data acquisition operation of the user for the target service, or may be generated by the vehicle in response to a target event, where the target event may refer to an event requiring acquisition of data of the target service, for example, the target service is an air conditioning service, and the target event may be power-on of the vehicle or the like.
In some embodiments, after the target service configuration file is obtained, a query interface corresponding to the target service may be obtained, and target service information corresponding to the target service is obtained from the target service configuration file through the query interface corresponding to the target service.
In this embodiment, two types of query interfaces may be provided, 1 SOME/IP R/R method interface for querying service information of a single service (for convenience of description, the interface is referred to herein as a first query interface), and 1 SOME/IP R/R method interface for querying service information of all services (for convenience of description, the interface is referred to herein as a second query interface).
When the target service is one or more services, the first query interface of each target service is called, the target service information of the target service is obtained from the target service configuration file, and when the target service is all the services, the second query interface is called, and the service information of all the services is obtained from the target service configuration file as the target service information.
S120, according to the target service information, acquiring a payload return value corresponding to the target service from a target service unit corresponding to the target service, serving as target data requested by a data acquisition request, and returning the target data to the data acquisition unit.
The service unit providing the target service is used as a target service unit, and the vehicle or a data acquisition unit in the vehicle acquires the effective load return value corresponding to the target service from the target service unit corresponding to the target service according to the target service information as target data. If the execution subject of the data acquisition method is a vehicle, the vehicle returns target data to the data acquisition unit, and if the execution subject of the data acquisition method is a data acquisition unit, the data acquisition unit acquires the payload return value corresponding to the target service, and then the payload return value corresponding to the target service can be directly used as the target data to be acquired.
In the application, after the target service information of the target service is obtained from the target service configuration file, the target service which needs to collect SOME/IP data can be determined according to the target service information in a calling or subscribing mode, and then the effective load return value (the format of SOME/IP data) of the target service is obtained from the target service unit corresponding to the target service and is used as the target data requested by the data acquisition request.
After the target data is obtained, the target data can be subjected to data management operation, such as splitting, reorganizing, storing or uploading (uploading to a cloud end connected with the vehicle in a communication way) and the like.
Exemplary, the data acquisition process is shown in fig. 2, where the data acquisition unit on the vehicle is used as an execution subject, and the data acquisition unit is further configured with a dynamic service discovery module, a service information storage module, a service information management module, and an SOME/IP protocol stack, so as to obtain a target service configuration file through the dynamic service discovery module, the service information storage module, and the service information management module, and implement the data acquisition process of S110-S120 through the generated target service configuration file.
Firstly, receiving service information sent by a service unit 1, a service unit 2, a service unit n for a plurality of services through an SOME/IP protocol stack, then, acquiring service information of the plurality of services from the SOME/IP protocol stack by a dynamic service discovery module, summarizing a service information list of the plurality of services by a service information caching module, caching the service information as a service information list, then, acquiring the service information from the service information list by a service information management module, and packaging the service information acquired from the service information list as a target service configuration file.
Then, the data acquisition unit determines target service information of the target service using the target service profile, and then acquires target data according to the target service information.
In this embodiment, the target service configuration file includes service information of each of the plurality of services, and is directly responsive to the data acquisition request, to acquire target service information corresponding to the target service requested by the data acquisition request from the target service configuration file, and then acquire a payload return value corresponding to the target service according to the target service information, as target data requested by the data acquisition request, without having to go to a provider of the target service to acquire the target service information of the target service after receiving the data acquisition request, thereby saving interaction time with a service provider of the target service, improving acquisition efficiency of the target service information, and further improving efficiency of acquiring the target data according to the target service information.
The target service configuration file is generated based on a service end message sent by a data acquisition protocol stack in a data acquisition unit, the service end message is sent to the data acquisition protocol stack by a service unit for providing a plurality of services, the service end message is generated by the service unit for providing the plurality of services according to service information of the plurality of services, and the whole process does not need user participation, so that the process of automatically generating the target service configuration file by a vehicle is realized, the target service configuration file is not required to be manually configured, the time consumption for manually configuring the target service configuration file is reduced, and the generation efficiency of the target service configuration file is improved.
In an embodiment, as shown in fig. 3, step S110 may include:
s210, in response to the data acquisition request, determining whether target service information corresponding to the target service exists in the existing service configuration file.
The existing service configuration file is generated based on an existing service side message sent by the data acquisition protocol stack, the existing service side message is generated by a service unit providing a plurality of existing services and sent to the data acquisition protocol stack, and the existing service side message is generated by the service unit providing the plurality of existing services according to service information aiming at the plurality of existing services.
That is, before the data acquisition request is received, there is already one service profile as an existing service profile, and one service within the existing service profile is an existing service, at which time the existing service profile includes a plurality of existing services and service information corresponding to each of the plurality of existing services.
In this embodiment, the service unit providing the existing service uses the generated information message as the existing service side message according to the service information of the existing service, then the service unit providing the existing service sends the existing service message to the data acquisition protocol stack of the data acquisition unit, then the vehicle (or the data acquisition unit) can receive the existing service side message sent by the data acquisition protocol stack, package the existing service side message into the service configuration file according to the foregoing process based on the existing service side message, and use the service configuration file as the existing service configuration file, and then determine whether the existing service configuration file has the target service information corresponding to the target service when receiving the data acquisition request.
S220, if the existing service configuration file contains the target service information corresponding to the target service, acquiring the existing service configuration file as the target service configuration file, and acquiring the target service information corresponding to the target service from the target service configuration file.
If the existing service configuration file contains the target service information corresponding to the target service, the target service information corresponding to the target service can be obtained from the existing service configuration file, so that the existing service configuration file is directly used as the target service configuration file, and then the target service information corresponding to the target service is obtained from the target service configuration file. At this time, one existing service in the existing service profile is one service in the target service profile.
S230, if the target service information corresponding to the target service does not exist in the existing service configuration file, acquiring an update service end message from a service unit providing the update service through a data acquisition protocol stack, updating the existing service configuration file according to the update service in the update service end message and the service information corresponding to the update service to obtain the target service configuration file, and acquiring the target service information corresponding to the target service from the target service configuration file.
The update service side message is generated by a service unit for providing update service according to service information aiming at the update service.
If the existing service configuration file does not have the target service information corresponding to the target service, which means that the target service information corresponding to the target service cannot be acquired from the existing service configuration file, at this time, an update service end message (an information message generated by a service unit for providing the update service according to the service information for the update service) may be acquired from a service unit for providing the update service, after the update service end message is acquired, the update service and the service information corresponding to the update service may be extracted from the update service end message, and then the update service and the service information corresponding to the update service may be added to the existing service configuration file to implement updating of the existing service configuration file, thereby obtaining the target service configuration file.
In general, all services related to the vehicle are fixed, and the existing services in the existing service profile are all or a part of all services related to the vehicle, however, the existing service profile does not have target service information corresponding to the target service, which means that the existing services in the existing service profile are only a part of all services related to the vehicle, and the existing service profile lacks at least the service information of the target service, at this time, the target service may be acquired as an update service, or all services related to the vehicle may be acquired, other services than the existing services included in the existing service profile are removed as update services, and then the update service side message is acquired from a service unit that provides the update service.
In some embodiments, if there is no target service information corresponding to the target service in the existing service configuration file, all the services related to the vehicle may be directly obtained as update services, and the update service end message is obtained from the service unit that provides the update services, and then the service configuration file is used as the target service configuration file according to the foregoing process based on the update service end message. At this time, after the target service configuration file is obtained, the existing service configuration file can be deleted, so that storage of redundant repeated data is avoided, and storage space is released.
In this embodiment, if there is target service information corresponding to a target service in an existing service configuration file, target service information corresponding to the target service is directly obtained from the existing service configuration file, if there is no target service information corresponding to the target service in the existing service configuration file, the existing service configuration file is updated to obtain the target service configuration file, and then the target service information corresponding to the target service is obtained from the target service configuration file, so that real-time update of service information of each of a plurality of services is realized, and the target service information of the target service is accurately and rapidly obtained.
Referring to fig. 4, fig. 4 is a block diagram illustrating a data acquisition device according to an embodiment of the present application. For a vehicle, the apparatus 800 includes:
the response module 810 is configured to respond to a data acquisition request of the data acquisition unit, and acquire target service information corresponding to a target service requested by the data acquisition request from a target service configuration file, where the target service configuration file includes service information of each of a plurality of services;
The acquiring module 820 is configured to acquire, from a target service unit corresponding to the target service according to the target service information, a payload return value corresponding to the target service, as target data requested by the data acquisition request, and return the target data to the data acquisition unit.
Optionally, the response module 810 is further configured to receive a service side message sent by the data acquisition protocol stack, extract a plurality of services and service information of each of the plurality of services from the service side message, and package the plurality of services and service information of each of the plurality of services to obtain a target service configuration file.
Optionally, the response module 810 is further configured to send, in response to the target event trigger, a service information acquisition request to a service unit that provides a plurality of services through the data acquisition protocol stack, so that the service unit that provides the plurality of services returns a service side packet based on the service information acquisition request.
Optionally, the response module 810 is further configured to determine whether target service information corresponding to the target service exists in the existing service configuration file in response to the data acquisition request, where the existing service configuration file is generated based on an existing service side packet sent by the data acquisition protocol stack, the existing service side packet is generated by a service unit providing a plurality of existing services and sent to the data acquisition protocol stack, the existing service side packet is generated by a service unit providing a plurality of existing services according to service information corresponding to the plurality of existing services, if target service information corresponding to the target service exists in the existing service configuration file, the existing service configuration file is obtained as the target service configuration file, and target service information corresponding to the target service is obtained from the target service configuration file.
Optionally, the response module 810 is further configured to obtain, if no target service information corresponding to the target service exists in the existing service configuration file, an update service end message from the service unit that provides the update service through the data acquisition protocol stack, where the update service end message is generated by the service unit that provides the update service according to the service information corresponding to the update service, update the existing service configuration file according to the update service in the update service end message and the service information corresponding to the update service, obtain the target service configuration file, and obtain the target service information corresponding to the target service from the target service configuration file.
Optionally, the response module 810 is further configured to obtain a query interface corresponding to the target service, and obtain, from the target service configuration file, target service information corresponding to the target service through the query interface corresponding to the target service.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In addition, each function in each embodiment of the present application may be integrated into one processing module, each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
In addition, each function in each embodiment of the present application may be integrated into one processing module, each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
In addition, each function in each embodiment of the present application may be integrated into one processing module, each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
Referring to fig. 5, a block diagram of a vehicle according to an embodiment of the present application is shown. The vehicle 500 of the present application may include one or more of a processor 510, a memory 520, and one or more application programs. Wherein one or more application programs may be stored in the memory 520 and configured to be executed by the one or more processors 510, the one or more program(s) configured to perform the methods as described in the foregoing method embodiments.
Processor 510 may include one or more processing cores. The processor 510 utilizes various interfaces and lines to connect various portions of the overall vehicle 500, perform various functions of the vehicle 500 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 520, and invoking data stored in the memory 520. Alternatively, the processor 510 may be implemented in hardware in at least one of digital signal processing (DI GITA L SIGNA L processor i ng, DSP), field programmable gate array (Fie l d-Programmab L E GATE ARRAY, FPGA), programmable logic array (Programmab l e Logic Array, PLA). The processor 510 may integrate one or a combination of several of a central processing unit (Centra l Process i ng Unit, CPU), an image processor (Graphics Process i ng Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like, the GPU is used for rendering and drawing display contents, and the modem is used for processing wireless communication. It will be appreciated that the modem may not be integrated into the processor 510 and may be implemented solely by a single communication chip.
Memory 520 may include random access Memory (Random Access Memory, RAM) or Read-only Memory (ROM). Memory 520 may be used to store instructions, programs, code sets, or instruction sets. The memory 520 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described below, etc. The storage data area may also store data created by the vehicle 500 in use (e.g., phonebook, audio-video data, chat-record data), etc.
In another aspect, the present application also provides a computer readable storage medium having stored therein program code that can be invoked by a processor to perform the method described in the above method embodiments.
The computer readable storage medium may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a cluster of ROMs. Optionally, the computer readable storage medium comprises a non-volatile computer readable storage medium (non-trans itory computer-readab l e storage med i um). The computer readable storage medium has storage space for program code to perform any of the method steps described above. The program code can be read from or written to one or more computer program products. The program code may be compressed, for example, in a suitable form.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the above-mentioned embodiments, it will be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or replacements do not drive the essence of the corresponding technical solution to deviate from the spirit and scope of the technical solution of the embodiments of the present application.