Data recording method and device, electronic equipment and storage medium
By setting the RECORDER mark in the target environment variable of DDS, the client operation data is recorded in a log mode, which solves the problem of cumbersome operation of the DDS recording service, saves resources and improves the user experience.
Patent Information
- Application Number
- CN202411472366.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-24
AI Technical Summary
When recording and replaying data distribution services, a dedicated DDS recording service needs to be started, resulting in additional configuration and management work, cumbersome operations, and wasted user time and system resources.
Set the Recorder mark through the target environment variable of DDS, and enable the logo to record the operating data of the client, without the need to start the additional DDS recording service alone.
Simplified operations, saving system resources and user time, providing flexibility and configurable. Users have no perception of the start and operation of the recording service, which improves the user experience.
Smart Images

Figure CN119363612A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data communication technology, and in particular to a data recording method, device, electronic device and storage medium. Background Art
[0002] When recording and replaying the Data Distribution Service (DDS), you need to create publisher and subscriber entities and understand the Quality of Service (QoS) parameters on both ends. In addition, when performing Topic communication, you also need to use the data type information defined in the Interface Definition Language (IDL) for serialization and deserialization operations, as well as partial QoS support.
[0003] In the related art, in order to record the above data, a special DDS recording service needs to be started. However, the special DDS recording service will bring additional configuration and management work, the operation is cumbersome, and wastes user time and system resources. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a data recording method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a data recording method is provided, comprising parsing a target environment variable of a DDS when a client is started; and recording target data of the client during operation in a log manner when the target environment variable is a preset mark.
[0006] In some embodiments, the method further includes at least one of the following: in response to a first operation of the user, configuring the target environment variable of the DDS as a preset mark; in response to a second operation of the user, stopping recording the target data.
[0007] In some embodiments, the client includes at least one of a publishing end and a subscribing end, and the target data recorded in a log-based manner during the client runtime includes at least one of the following: when the publishing end publishes, the entity information required for the publishing end to create an entity and the published subject data are recorded in a log-based manner; when the subscribing end subscribes, the entity information required for the subscribing end to create an entity and the subscribed subject data are recorded in a log-based manner.
[0008] In some embodiments, when publishing at the publishing end, the entity information required for the publishing end to create an entity and the published subject data are recorded in a log manner, including: when creating a first participant at the publishing end, recording the first participant identifier, the domain identifier to which the first participant belongs, and the service quality policy of the first participant; when creating a first topic at the publishing end, recording the first topic identifier, the first topic information, and the service quality policy of the first topic, and associating the first topic identifier with the first participant identifier; when creating a writer at the publishing end, recording the writer identifier and the writer's service quality parameters, and associating the writer identifier with the first participant identifier and the first topic identifier; when publishing the first subject data at the publishing end, recording the first subject data and the publishing time; when subscribing at the subscriber end, The entity information required for the subscriber to create an entity and the subscribed subject data are recorded in a log-based manner, including: when the subscriber creates a second participant, the second participant identifier, the domain identifier to which the second participant belongs, and the service quality policy of the second participant are recorded; when the subscriber creates a second topic, the second topic identifier, the second topic information, and the service quality policy of the second topic are recorded, and the second topic identifier is associated with the second participant identifier, wherein the second topic created by the subscriber matches the first topic created by the publisher; when the subscriber creates a reader, the reader identifier and the reader's service quality policy are recorded, and the reader identifier is associated with the second participant identifier and the second topic identifier; when the subscriber reads the second topic data, the second topic data and the reading time are recorded.
[0009] In some embodiments, the method further includes: storing the target data corresponding to each topic in a corresponding recording and playback package, and determining the name of the recording and playback package based on the domain identifier, topic identifier, recording start time and recording end time; wherein the recording start time corresponds to the client's running start time, and the recording end time corresponds to the time to stop recording the target data.
[0010] In some embodiments, the log-based recording of target data during client runtime includes: converting entity information required by the publisher to create an entity or entity information required by the subscriber to create an entity into a string to comply with a DDS preset format; serializing the subject data published by the publisher or the subject data read by the subscriber based on a public data representation method; and storing the entity information and serialized subject data that comply with the DDS preset format in a recording and playback service package.
[0011] In some embodiments, the log-based recording of target data during client operation includes: caching the target data obtained from the target interface of the DDS into a buffer in real time during client operation; extracting the target data from the buffer and persistently storing it in a recording and playback package.
[0012] According to a second aspect of an embodiment of the present disclosure, a data recording device is provided, including a parsing module for parsing a target environment variable of a DDS when a client is started; and a recording module for recording target data during client operation in a log manner when the target environment variable is a preset mark.
[0013] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the data recording method provided by the first aspect of the present disclosure.
[0014] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data recording method provided in the first aspect of the present disclosure are implemented.
[0015] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by parsing the target environment variables of DDS when the client is started, and recording the target data of the client runtime in a log manner under specific marking conditions, there is no need to start an additional DDS recording service separately, the operation is simple, and system resources and user time are saved. In addition, whether to record is determined based on preset marks, which increases flexibility and completes data recording without the user's perception, thereby improving the user experience.
[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0018] Figure 1 The figure is a flow chart of a data recording method according to an exemplary embodiment.
[0019] Figure 2 is a flow chart showing another data recording method according to an exemplary embodiment.
[0020] Figure 3 yes Figure 2 A detailed flow chart of step S230 in the illustrated embodiment.
[0021] Figure 4 The figure is a flow chart of a publishing end data recording method according to an exemplary embodiment.
[0022] Figure 5The figure is a flow chart of a method for recording data at a subscriber end according to an exemplary embodiment.
[0023] Figure 6 The figure is a flowchart of generating an RnR bag according to an exemplary embodiment.
[0024] Figure 7 is a block diagram of a data recording device according to an exemplary embodiment.
[0025] Figure 8 is a block diagram of a vehicle according to an exemplary embodiment.
[0026] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail below with reference to the accompanying drawings.
[0028] It should be pointed out that the relevant embodiments and drawings are only for describing exemplary embodiments provided by the present disclosure, rather than all embodiments of the present disclosure, and it should not be understood that the present disclosure is limited to the relevant exemplary embodiments.
[0029] It should be noted that the terms "first", "second", etc. used in the present disclosure are only used to distinguish different steps, devices or modules, etc. The related terms neither represent any specific technical meanings nor indicate the order or interdependence between them.
[0030] It should be noted that the modifications of the terms "one", "multiple", and "at least one" used in the present disclosure are illustrative rather than restrictive. Unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0031] It should be noted that the term "and / or" used in this disclosure is used to describe the association relationship between associated objects, and generally indicates that there are at least three association relationships. For example, A and / or B can at least indicate the existence of three association relationships: A exists alone, A and B exist at the same time, and B exists alone.
[0032] It should be noted that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. Unless otherwise specified, the scope of the present disclosure is not limited by the order of description of the steps in the relevant embodiments.
[0033] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0034] When performing DDS recording and playback, you need to create publisher and subscriber entities and understand the QoS of both ends. In addition, when performing Topic communication, you also need to use the data type information defined by IDL for serialization and deserialization operations, as well as partial QoS support.
[0035] In the related art, in order to record the above data, it is necessary to start a dedicated DDS recording service. However, the dedicated DDS recording service will bring additional configuration and management work, the operation is cumbersome, and it wastes user time and system resources. In addition, since different entities usually support different QoS, when the DDS recording service and playback service are fully created, it is necessary to start the subscriber to dynamically obtain the subscriber QoS, or manually configure it through a dedicated configuration file; when the DDS recording service and playback service are fully created, IDL support is also required. If dynamic loading is used, additional configuration and QOS configuration support are also required.
[0036] In order to solve the above technical problem, the technical concept of the present invention is to set the RECORDER mark through the target environment variable of DDS to start the function of recording the operation data of the client in a log manner.
[0037] Exemplary Methods
[0038] Figure 1 is a flow chart of a data recording method according to an exemplary embodiment. Figure 1 As shown, the data recording method is applied to a terminal device, and a client developed based on DDS is deployed on the terminal device, including the following steps:
[0039] In step S110 , when the client starts, the target environment variables of the DDS are parsed.
[0040] Specifically, DDS is a dynamic database based on which various applications, namely clients, can be developed. When the client is running, it interacts with the DDS dynamic library by calling related functions in the DDS dynamic library. The DDS dynamic library itself contains a configuration file DDS options, which can set related environment variables to affect the behavior and configuration of the DDS dynamic library. At the same time, the client also has its own environment variables for configuring the behavior of the client application.
[0041] When the client starts, DDS will pass system-level environment variables to the client so that the client can use these environment variables to obtain system-level configuration information. For example, through DDS options, the target environment variable DDS log level of the DDS middleware log (DDS log) is set to the "RECORDER" tag, which will be parsed when the client starts.
[0042] In step S120, when the target environment variable is a preset tag, target data during the client runtime is recorded in a log manner.
[0043] Specifically, if the client parses the DDS log level as the "RECORDER" tag, the log mode will be enabled to synchronously record data during runtime; otherwise, the client will run directly without recording.
[0044] In some embodiments, the target data of the client during operation is recorded in a log-based manner in step S120, including: when the client is running, caching the target data obtained from the target interface of the DDS in real time into a buffer; extracting the target data from the buffer and persistently storing it in a recording and playback package.
[0045] Specifically, when the client is running, the target data obtained from the DDS API is cached in real time in a buffer (located in memory), and then the target data is extracted from the buffer and persistently stored on the disk, that is, a record and replay bag (Recorder and Replayer bag, referred to as RnR bag) is generated.
[0046] The data recording method provided in this embodiment parses the target environment variables of DDS when the client is started. When the target environment variables are preset tags, the target data of the client during runtime is recorded in a log manner. There is no need to start an additional DDS recording service separately. The operation is simple, and system resources and user time are saved. By parsing the environment variables and deciding whether to record data based on preset tags, flexibility and configurability are provided, and the recording behavior can be dynamically adjusted as needed. The user does not need to be aware of the startup and operation of the recording service during the data recording process, and its operation will not be interfered with, thereby improving the user experience.
[0047] Based on the above embodiments, Figure 2 is a flow chart of another data recording method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:
[0048] In step S210 , in response to a first operation of the user, a target environment variable of the DDS is configured as a preset tag.
[0049] In step S220, when the client starts, the target environment variables of the DDS are parsed.
[0050] In step S230, when the target environment variable is a preset tag, target data during the client runtime is recorded in a log manner.
[0051] In step S240 , in response to a second operation by the user, recording of the target data is stopped.
[0052] It should be noted that the implementation of steps S220 and S230 in this embodiment is similar to the implementation of steps S110 and S120 in the aforementioned embodiment, and will not be repeated here.
[0053] The difference from the above-mentioned embodiment is that the user can control the behavior of recording data through the two operations of steps S210 and S240. Specifically, in the case of data recording requirements, the technician only needs to set the DDS log level to the "RECORDER" mark; further, if the DDS log level is a null value, the DDS log level can be set to RECORDER, and if the DDS log level is ERROR, the DDS log level can be set to ERROR|RECORDER, which is simpler to operate than the traditional method of starting the DDS recording service separately; after the setting is completed, when the client parses the DDS log level as the "RECORDER" mark at startup, the client's operating data is synchronously recorded based on the log method, and the user is unaware of the entire recording process; when it is necessary to stop recording, the user only needs to execute the stop recording operation, such as pressing the Ctrl+C key combination to indicate to stop recording.
[0054] On the basis of the foregoing embodiments, by responding to the user's first operation, the target environment variable of the DDS is configured as a preset mark, and by responding to the user's second operation, the target data is stopped from being recorded, thereby realizing the function of starting and ending recording at any time according to user needs. Its flexible and convenient recording control method enables users to easily manage the data recording process.
[0055] Based on the above embodiments, Figure 3 for Figure 2 A detailed flow chart of step S230 in the illustrated embodiment is shown in FIG. Figure 3 As shown, the client includes at least one of a publisher and a subscriber, and the target data recorded in the log mode when the client is running in step S230 includes at least one of the following:
[0056] Step S310: When publishing at the publishing end, the entity information required by the publishing end to create the entity and the published subject data are recorded in a log manner.
[0057] Step S320: When the subscriber subscribes, the entity information required for the subscriber to create an entity and the subscribed subject data are recorded in a log manner.
[0058] Specifically, the client developed based on the DDS dynamic library includes a publisher and a subscriber. When the publisher is started, the target environment variable passed by DDS is read. If the variable is marked as "RECORDER", the entity information required for the publisher to create the entity and the published subject data will be synchronously recorded based on the log method during the process of the publisher executing the published data, so as to generate data for playback. When the subscriber is started, the target environment variable passed by DDS is also read. If the variable is marked as "RECORDER", the entity information required for the subscriber to create the entity and the subscribed subject data will be synchronously recorded based on the log method during the process of the subscriber executing the subscribed data, so as to generate data for recording.
[0059] In some embodiments, the step S310 includes the following steps:
[0060] When creating the first participant at the publishing end, recording the first participant identifier, the domain identifier to which the first participant belongs, and the service quality policy of the first participant;
[0061] When creating the first topic at the publishing end, recording the first topic identifier, the first topic information, and the service quality policy of the first topic, and associating the first topic identifier with the first participant identifier;
[0062] When creating a writer at the publishing end, record the writer identifier and the writer's service quality parameters, and associate the writer identifier with the first participant identifier and the first topic identifier;
[0063] When the first topic data is published at the publishing end, the first topic data and the publishing time are recorded;
[0064] The step S320 includes the following steps:
[0065] When creating a second participant at the subscription end, recording the second participant identifier, the domain identifier to which the second participant belongs, and the service quality policy of the second participant;
[0066] When creating a second topic at the subscriber end, recording the second topic identifier, the second topic information, and the service quality policy of the second topic, and associating the second topic identifier with the second participant identifier, wherein the second topic created by the subscriber end matches the first topic created by the publisher end;
[0067] When creating a reader on the subscription side, the reader ID and the reader's service quality policy are recorded, and the reader ID is associated with the second participant ID and the second topic ID;
[0068] When the second topic data is read on the subscription end, the second topic data and the reading time are recorded.
[0069] Specifically, Figure 4is a flow chart of a publishing end data recording method according to an exemplary embodiment. Figure 4 As shown, in the first step, the publisher calls the dds_create_participant function to create a participant, and records the participant entity ID, domain ID, and the participant's quality of service parameters; in the second step, the publisher calls the dds_create_topic function to create a topic, records the topic entity ID and topic information, which includes the topic type and structure, topic name, and the topic quality of service parameters, and associates the topic entity ID with the participant entity ID; in the third step, the publisher calls the dds_create_writer function to create a writer, records the writer ID and the writer's quality of service parameters, and associates the writer entity ID with the participant entity ID and the topic entity ID, thereby establishing a corresponding relationship between the participant entity ID, the topic entity ID, and the writer entity ID as the entity information required by the publisher to create an entity; in the fourth step, the publisher calls the dds_writer function to publish the topic data, and records the topic data and the publishing timestamp. The recorded entity information and subject data of the publisher are recorded in a file and stored in the RnR bag. When the data is played back later, it is played back in the order of the publisher's timestamp.
[0070] Figure 5 is a flowchart of a method for recording data at a subscriber end according to an exemplary embodiment. Figure 5As shown, in the first step, the subscriber calls the dds_create_participant function to create a participant, and records the participant entity ID, domain ID, and the participant's quality of service parameters (participant QoS); in the second step, the subscriber calls the dds_create_topic function to create a topic, and records the topic ID and topic information. The topic information includes the topic type and structure, topic name, and the topic quality of service parameters (topic QoS), and associates the topic entity ID with the participant entity ID. The topic subscribed by the subscriber matches the topic published by the publisher; in the third step, the subscriber calls the dds_create_reader function to create a reader, records the reader ID and the reader's quality of service parameters (readerQoS), and associates the reader entity ID with the participant entity ID and topic entity ID, thereby establishing the participant entity id, topic entity id, and reader entity ID. The corresponding relationship between the ids is used as the entity information required by the subscriber to create an entity; In the fourth step, the subscriber reads the topic data published by the dds_writer function and records the topic data and the reading time. The recorded entity information and topic data of the subscriber are stored according to the reading timestamp to form a record file, which is stored in the RnR bag. It should be noted that in addition to the record file, the RnR bag also includes a record configuration file, a playback configuration file, and an information statistics file.
[0071] In addition, when performing DDS recording and playback, the entity information of the publisher and subscriber, as well as the topic data published by the publisher or the topic data read by the subscriber, can be integrated into an RnR bag for complete playback.
[0072] Figure 6 is a flow chart showing a method of generating an RnR bag according to an exemplary embodiment. Figure 6As shown, the middleware recording thread is implemented in the DDS middleware, which is responsible for caching and persisting the DDS entity information obtained from the DDS API interface and the CDR data published by the DDS writer into the RnR bag. The buffer adopts a chain structure to store the data sent by the DDSAPI. For DDS entity information, it is necessary to associate related entity information and perform persistence processing after processing. For DDS CDR data, it is necessary to extract CDR data, associate related topics, and perform persistence processing after generating timestamps. The persistence processing persists the data into the RnR bag.
[0073] It should be noted that there may be multiple participants under one domain, and one participant may correspond to multiple topics. This embodiment supports recording multiple topics under multiple domains.
[0074] In some embodiments, the method further includes: storing the target data corresponding to each topic in a corresponding recording and playback package, and determining the name of the recording and playback package based on the domain identifier, topic identifier, recording start time and recording end time; wherein the recording start time corresponds to the client's running start time, and the recording end time corresponds to the time to stop recording the target data.
[0075] Specifically, the target data corresponding to each topic will be persistently stored in an RnR bag, that is, each topic will generate an independent RnR bag. The naming method of RnR bag is as follows: dds domain+topic+start timestamp+end timestamp, where the start timestamp refers to the time when the recording service starts running, that is, the start time of the publishing end, and the end timestamp refers to the time when the recording service stops, which is usually the time when the user presses the ctrl+c key combination.
[0076] In the same DDS domain, there may be multiple topics that need to be recorded. Each publisher and subscriber can record according to the above embodiment. All RnR bags in the same DDS domain will be placed in the same directory. If they are not in the same directory, they need to be adjusted manually. This naming and storage method helps to organize and manage the recorded data, making it easy to identify and access.
[0077] In some embodiments, the method further includes: inputting path information of the record and playback package; reading target data in the record and playback package corresponding to the path information into a playback buffer; and extracting the target data from the playback buffer for playback.
[0078] Specifically, when you need to replay different topics under one or more domains, you only need to enter the path information of the RnR bag corresponding to the corresponding topic on the playback device. A playback buffer is set on the playback device. The playback service deployed on the playback device includes a read data processing thread and a playback data processing thread. These two threads run asynchronously. The read data processing thread continuously reads data into the playback buffer, while the playback data processing thread continuously obtains data from the playback buffer for playback, thereby ensuring smooth data transmission and improving the fluency of playback data.
[0079] In some embodiments, the target data of the client runtime is recorded in a log-based manner in step S120, including: converting the entity information required by the publisher to create an entity or the entity information required by the subscriber to create an entity into a string to comply with the DDS preset format; serializing the subject data published by the publisher or the subject data read by the subscriber based on a public data representation method; and storing the entity information and serialized subject data that comply with the DDS preset format in the recording and playback service package.
[0080] Specifically, in order to solve cross-platform problems, such as recording data under the arm architecture and playing back under the x86 architecture, as well as common big-endian and small-endian problems, this embodiment converts entity information into a string to comply with the DDS standard xml format, serializes the subject data in a common data representation (CDR) manner, and stores it in an RnR bag. For example, both arm and x86 use little-endian byte order, so XML and CDR data can be easily read and parsed.
[0081] On the basis of the foregoing embodiments, when the publisher publishes, the entity information required for the publisher to create an entity and the published subject data are recorded in a log manner; when the subscriber subscribes, the entity information required for the subscriber to create an entity and the subscribed subject data are recorded in a log manner; there is no need to specifically start the DDS recording service for recording, saving user time; at the same time, all resources for the recording service and the playback service can be provided, which is also convenient for using the recording service for recording again, and during the recording process, the QoS information of the publisher and the subscriber will be recorded together, so that no additional configuration is required during playback.
[0082] Exemplary Devices
[0083] Figure 7 is a block diagram of a data recording device according to an exemplary embodiment. Figure 7 The device 700 includes a parsing module 710 and a recording module 720.
[0084] The parsing module 710 is used to parse the target environment variables of the DDS when the client starts;
[0085] The recording module 720 is used to record the target data of the client during operation based on the log mode when the target environment variable is a preset mark.
[0086] In some embodiments, the apparatus 700 further includes a first processing module 730 and a second processing module 740;
[0087] The first processing module 730 is used to configure the target environment variable of the DDS as a preset mark in response to a first operation of the user;
[0088] The second processing module 740 is used to stop recording the target data in response to a second operation of the user.
[0089] In some embodiments, the client includes at least one of a publisher and a subscriber, and the recording module 720 is used for at least one of the following:
[0090] When publishing on the publishing end, the entity information required by the publishing end to create the entity and the published subject data are recorded in a log-based manner;
[0091] When the subscriber subscribes, the entity information required for the subscriber to create the entity and the subscribed topic data are recorded in a log-based manner.
[0092] In some embodiments, the recording module 720 is specifically used to:
[0093] When creating the first participant at the publishing end, recording the first participant identifier, the domain identifier to which the first participant belongs, and the service quality policy of the first participant;
[0094] When creating the first topic at the publishing end, recording the first topic identifier, the first topic information, and the service quality policy of the first topic, and associating the first topic identifier with the first participant identifier;
[0095] When creating a writer at the publishing end, record the writer identifier and the writer's service quality parameters, and associate the writer identifier with the first participant identifier and the first topic identifier;
[0096] When the first topic data is published at the publishing end, the first topic data and the publishing time are recorded;
[0097] The recording module 720 is specifically used for:
[0098] When creating a second participant at the subscription end, recording the second participant identifier, the domain identifier to which the second participant belongs, and the service quality policy of the second participant;
[0099] When creating a second topic at the subscriber end, recording the second topic identifier, the second topic information, and the service quality policy of the second topic, and associating the second topic identifier with the second participant identifier, wherein the second topic created by the subscriber end matches the first topic created by the publisher end;
[0100] When creating a reader on the subscription side, the reader ID and the reader's service quality policy are recorded, and the reader ID is associated with the second participant ID and the second topic ID;
[0101] When the second topic data is read on the subscription end, the second topic data and the reading time are recorded.
[0102] In some embodiments, the recording module 720 is further used to store the target data corresponding to each subject in a corresponding recording and playback package, and determine the name of the recording and playback package according to the domain identifier, the subject identifier, the recording start time, and the recording end time;
[0103] The recording start time corresponds to the operation start time of the client, and the recording end time corresponds to the time when the target data is stopped from being recorded.
[0104] In some embodiments, the recording module 720 is specifically used to:
[0105] Convert the entity information required by the publisher to create an entity or the subscriber to create an entity into a string to conform to the DDS preset format;
[0106] Serialize the topic data published by the publisher or read by the subscriber based on the common data representation method;
[0107] Store entity information and serialized subject data in the DDS preset format into the recording and playback service package.
[0108] In some embodiments, the recording module 720 is specifically used to:
[0109] When the client is running, the target data obtained from the target interface of DDS is cached in the buffer in real time;
[0110] The target data is extracted from the buffer and persistently stored in the record and playback package.
[0111] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the data recording device described above and the corresponding beneficial effects can refer to the corresponding process in the aforementioned method example, and will not be repeated here.
[0112] Example Vehicles
[0113] Figure 8 is a block diagram of a vehicle 800 according to an exemplary embodiment. The vehicle 800 may be a fuel vehicle, a hybrid vehicle, an electric vehicle, a fuel cell vehicle or other types of vehicles.
[0114] Reference Figure 8 The vehicle 800 may include multiple subsystems, for example, a driving system 810, a control system 820, a perception system 830, a communication system 840, an information display system 850, and a computing system 860. The vehicle 800 may also include more or fewer subsystems, and each subsystem may also include multiple components, which are not described one by one here.
[0115] The driving system 810 includes components that provide power movement for the vehicle 800, such as an engine, an energy source, a transmission device, etc.
[0116] The control system 820 includes components that provide control for the vehicle 800, such as vehicle control, cockpit equipment control, and driving assistance control.
[0117] The perception system 830 includes components that provide the vehicle 800 with surrounding environment perception, such as a vehicle positioning system, a laser sensor, a voice sensor, an ultrasonic sensor, a camera device, and the like.
[0118] The communication system 840 includes components that provide communication connections for the vehicle 800, such as mobile communication networks (such as 3G, 4G, 5G networks, etc.), WiFi, Bluetooth, and Internet of Vehicles.
[0119] The information display system 850 includes components that provide various information displays for the vehicle 800, such as vehicle information display, navigation information display, entertainment information display, etc.
[0120] The computing and processing system 860 includes components that provide data computing and processing capabilities for the vehicle 800. The computing and processing system 860 may include at least one processor 861 and a memory 862. The processor 861 may execute instructions stored in the memory 862.
[0121] The processor 861 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.
[0122] Memory 862 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0123] In the embodiment of the present disclosure, a set of instruction sets is stored in the memory 862, and the processor 861 can execute the instruction set to implement all or part of the steps of the data recording method described in any of the above exemplary embodiments.
[0124] Exemplary Electronic Devices
[0125] Fig. 9 1 is a block diagram of an electronic device 900 according to an exemplary embodiment. The electronic device 900 may be a vehicle controller, a vehicle terminal, a vehicle computer or other types of electronic devices.
[0126] Reference Fig. 9 , the electronic device 900 may include at least one processor 910 and a memory 920. The processor 910 may execute instructions stored in the memory 920. The processor 910 is communicatively connected to the memory 920 via a data bus. In addition to the memory 920, the processor 910 may also be communicatively connected to an input device 930, an output device 940, and a communication device 950 via a data bus.
[0127] The processor 910 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.
[0128] The memory 920 may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0129] In the embodiment of the present disclosure, executable instructions are stored in the memory 920, and the processor 910 can read the executable instructions from the memory 920 and execute the instructions to implement all or part of the steps of the data recording method described in any of the above exemplary embodiments.
[0130] Exemplary computer-readable storage media
[0131] In addition to the above methods and devices, the exemplary embodiments of the present disclosure may also be a computer program product or a computer-readable storage medium storing the computer program product. The computer product includes computer program instructions that can be executed by a processor to implement all or part of the steps described in any method in the above exemplary embodiments.
[0132] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and also conventional procedural programming languages, such as "C" language or similar programming languages and scripting languages (e.g., Python). The program code may be executed entirely on the user computing device, partially on the user computing device, as an independent software package, partially on the user computing device and partially on the remote computing device, or entirely on the remote computing device or server.
[0133] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of readable storage media include: a static random access memory (SRAM) with one or more wires electrically connected, an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk or an optical disk, or any suitable combination of the above.
[0134] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0135] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data recording method, characterized in that: include: When the client starts, parse the target environment variables of DDS; When the target environment variable is a preset tag, target data when the client is running is recorded in a log manner.
2. The method according to claim 1, characterized in that The method further comprises at least one of the following: In response to a first operation of the user, configuring a target environment variable of the DDS as a preset tag; In response to a second operation by the user, recording of the target data is stopped.
3. The method according to claim 2, characterized in that The client includes at least one of a publisher and a subscriber, and the target data recorded in a log-based manner when the client is running includes at least one of the following: When publishing on the publishing end, the entity information required by the publishing end to create the entity and the published subject data are recorded in a log-based manner; When the subscriber subscribes, the entity information required for the subscriber to create the entity and the subscribed topic data are recorded in a log-based manner.
4. The method according to claim 3, characterized in that When publishing at the publishing end, the entity information required by the publishing end to create the entity and the published subject data are recorded in a log manner, including: When creating the first participant at the publishing end, recording the first participant identifier, the domain identifier to which the first participant belongs, and the service quality policy of the first participant; When creating the first topic at the publishing end, recording the first topic identifier, the first topic information, and the service quality policy of the first topic, and associating the first topic identifier with the first participant identifier; When creating a writer at the publishing end, record the writer identifier and the writer's service quality parameters, and associate the writer identifier with the first participant identifier and the first topic identifier; When the first topic data is published at the publishing end, the first topic data and the publishing time are recorded; When the subscriber subscribes, the entity information required by the subscriber to create the entity and the subscribed subject data are recorded in a log manner, including: When creating a second participant at the subscription end, recording the second participant identifier, the domain identifier to which the second participant belongs, and the service quality policy of the second participant; When creating a second topic at the subscriber end, recording the second topic identifier, the second topic information, and the service quality policy of the second topic, and associating the second topic identifier with the second participant identifier, wherein the second topic created by the subscriber end matches the first topic created by the publisher end; When creating a reader on the subscription side, the reader ID and the reader's service quality policy are recorded, and the reader ID is associated with the second participant ID and the second topic ID; When the second topic data is read on the subscription end, the second topic data and the reading time are recorded.
5. The method according to claim 4, characterized in that The method further comprises: The target data corresponding to each subject is stored in the corresponding recording and playback package, and the name of the recording and playback package is determined according to the domain identifier, the subject identifier, the recording start time and the recording end time; The recording start time corresponds to the operation start time of the client, and the recording end time corresponds to the time when the target data is stopped from being recorded.
6. The method according to any one of claims 3 to 5, characterized in that: The target data recorded in the log mode when the client is running includes: Convert the entity information required by the publisher to create an entity or the subscriber to create an entity into a string to conform to the DDS preset format; Serialize the topic data published by the publisher or read by the subscriber based on the common data representation method; Store entity information and serialized subject data in the DDS preset format into the recording and playback service package.
7. The method according to any one of claims 1 to 5, characterized in that: The target data recorded in the log mode when the client is running includes: When the client is running, the target data obtained from the target interface of DDS is cached in the buffer in real time; The target data is extracted from the buffer and persistently stored in the record and playback package.
8. A data recording device, characterized in that: include: The parsing module is used to parse the target environment variables of DDS when the client starts; The recording module is used to record the target data of the client during operation based on the log mode when the target environment variable is a preset mark.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the data recording method described in any one of claims 1-7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the data recording method described in any one of claims 1 to 7 are implemented.