A session information division method, device and equipment of time series data and medium
By using timestamps to divide time-series data into session information in the autonomous driving system, the problem of inaccurate session information caused by data loss or abnormal restarts is solved, and the accuracy of session information query is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU WERIDE TECH LTD CO
- Filing Date
- 2022-11-22
- Publication Date
- 2026-04-24
AI Technical Summary
In autonomous driving scenarios, time-series data may be lost or the process may restart abnormally during the upload process, making it impossible to accurately distinguish session information when querying.
By sending a time-series data query command to the database from the client, receiving and processing a set of timestamps, and using the timestamps as the session start time to query the session end time, the time-series data is divided into multiple session information.
It improves the accuracy of session information segmentation when querying time-series data, and avoids inaccurate session information segmentation caused by data loss or abnormal restarts.
Smart Images

Figure CN115757544B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of session information processing technology, and in particular to a method, apparatus, device and medium for session information segmentation of time-series data. Background Technology
[0002] In autonomous driving scenarios, different operational behaviors of autonomous vehicles during driving will generate corresponding sessions, which will be uploaded to the database in the form of time-series data.
[0003] However, during the upload process, time-series data may be lost. This could be due to direct loss during upload or data loss caused by abnormal process restarts, resulting in incomplete time-series data received by the database. This can lead to inaccurate differentiation between different sessions when querying the time-series data. For example, data loss might cause the same session to be mistakenly identified as two separate sessions; or an abnormal restart might mistakenly identify two sessions as the same. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and medium for partitioning session information in time-series data, which solves the technical problem of inaccurate session information partitioning when querying session information due to data loss or abnormal restarts during time-series data transmission.
[0005] This invention provides a method for partitioning session information of time-series data, applied to a client that communicates with a database; the method includes:
[0006] Send a time-series data query command to the database;
[0007] Receive the time-series data and timestamp set returned by the database in response to the time-series data query command;
[0008] Obtain the target timestamp from the set of timestamps;
[0009] Each target timestamp is used as the session start time, and the corresponding session end time is queried from the time series data.
[0010] The time-series data is divided into multiple session information based on the session start time and the session end time.
[0011] Optionally, before the step of sending a session query instruction to the database, the method further includes:
[0012] Acquire initial timing data, which includes multiple initial session information entries;
[0013] Obtain the first message of each initial session and extract the timestamp of the first message;
[0014] The timestamp and the corresponding initial session information are used to generate the sending data;
[0015] The data is sent to the database, and the database generates the time-series data based on the reception status of the data and stores the timestamp in the timestamp set.
[0016] Optionally, the timestamp set contains multiple timestamps; the step of obtaining the target timestamp from the timestamp set includes:
[0017] The target timestamp is obtained by deduplicating all timestamps in the timestamp set.
[0018] Optionally, the step of querying the corresponding session end time in the time series data, using each of the target timestamps as the session start time, includes:
[0019] Each of the target timestamps is used as the session start time, and the associated timestamps adjacent to each session start time are obtained from all the target timestamps; the associated timestamps are greater than the session start time.
[0020] In the time series data, the maximum time point between the session start time and the associated timestamp is obtained, and the maximum time point is determined as the session end time corresponding to the session start time.
[0021] Optionally, the step of generating the transmission data using the timestamp and the corresponding initial session information includes:
[0022] Obtain the historical loss rate and target reception rate of the initial session information;
[0023] The number of times the timestamp is generated is based on the historical loss rate and the target reception rate;
[0024] Sending data is generated based on the number of times sent, the timestamp, and the corresponding initial session information.
[0025] The present invention also provides a session information partitioning device for time-series data, applied to a client, the client communicating with a database; the device includes:
[0026] A time-series data query instruction sending module is used to send time-series data query instructions to the database;
[0027] The time series data and timestamp set receiving module is used to receive the time series data and timestamp set returned by the database in response to the time series data query command;
[0028] The target timestamp acquisition module is used to acquire the target timestamp from the timestamp set;
[0029] The session end time query module is used to query the corresponding session end time in the time series data, taking each of the target timestamps as the session start time;
[0030] The session information segmentation module is used to divide the time-series data into multiple session information segments using the session start time and the session end time.
[0031] Optionally, it also includes:
[0032] An initial timing data acquisition module is used to acquire initial timing data, which includes multiple initial session information entries.
[0033] The timestamp extraction module is used to obtain the first message of each initial session information and extract the timestamp of the first message;
[0034] A data generation module is used to generate data to be sent using the timestamp and the corresponding initial session information.
[0035] A storage module is used to send the transmitted data to the database, and the database generates the time-series data according to the reception status of the transmitted data and stores the timestamp in the timestamp set.
[0036] Optionally, the timestamp set includes multiple timestamps; the target timestamp acquisition module includes:
[0037] The target timestamp acquisition submodule is used to deduplicate all timestamps in the timestamp set to obtain the target timestamp.
[0038] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0039] The memory is used to store program code and transmit the program code to the processor;
[0040] The processor is configured to execute the session information partitioning method for timing data as described above, according to the instructions in the program code.
[0041] The present invention also provides a computer-readable storage medium for storing program code for executing the session information partitioning method for time-series data as described in any of the preceding claims.
[0042] As can be seen from the above technical solutions, the present invention has the following advantages: The present invention provides a method for partitioning session information of time-series data, including: sending a time-series data query instruction to a database; receiving time-series data and a timestamp set returned by the database in response to the time-series data query instruction; obtaining a target timestamp from the timestamp set; using each target timestamp as a session start time, querying the corresponding session end time in the time-series data; and partitioning the time-series data into multiple session information using the session start time and session end time. The present invention partitions time-series data into multiple session information by querying the timestamps in the time-series data, thus avoiding the situation where session information cannot be accurately partitioned when querying session information due to loss of time-series data during transmission or abnormal restart of session information. This improves the accuracy of session information partitioning when querying time-series data. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A flowchart illustrating the steps of a session information partitioning method for time-series data provided in an embodiment of the present invention;
[0045] Figure 2 A flowchart illustrating the steps of a session information partitioning method for time-series data, provided in another embodiment of the present invention;
[0046] Figure 3 This is a structural block diagram of a session information partitioning device for time-series data provided in an embodiment of the present invention. Detailed Implementation
[0047] This invention provides a method, apparatus, device, and medium for partitioning session information in time-series data, which solves the technical problem of inaccurate session information partitioning when querying session information due to data loss or abnormal restarts during time-series data transmission.
[0048] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0049] Please see Figure 1 , Figure 1 A flowchart illustrating the steps of a session information partitioning method for time-series data provided in an embodiment of the present invention.
[0050] This invention provides a method for partitioning session information of time-series data, applied to a client-side communication between the client and a database; specifically, it may include the following steps:
[0051] Step 101: Send a time-series data query command to the database;
[0052] Time series data refers to data collected over time, which is a series of data recorded in chronological order based on the same unified indicator. All data points within the same data series must be of the same statistical caliber and be comparable. Time series data can be data for a specific period or data for a specific point in time.
[0053] In this embodiment of the invention, time series data is stored in a database, and the client can query the time series data by sending a time series data query command to the database.
[0054] Step 102: Receive the time series data and timestamp set returned by the database response time series data query command;
[0055] A timestamp is data generated using digital signature technology. The object being signed includes original file information, signature parameters, and the signing time. The main function of a timestamp is to authenticate the time when data was generated through certain technical means, thereby verifying whether the data has been tampered with since its creation.
[0056] After receiving a time-series data query command from the client, the database can return time-series data and a set of timestamps to the client.
[0057] The timestamp set contains the timestamps of each session in the time-series data.
[0058] Step 103: Obtain the target timestamp from the timestamp set;
[0059] In real-world scenarios, there may be duplicate timestamps in the timestamp set. Therefore, after obtaining the timestamp set, the client can deduplicate the timestamps to obtain multiple unique target timestamps.
[0060] Step 104: Using each target timestamp as the session start time, query the corresponding session end time in the time series data;
[0061] Step 105: Divide the time-series data into multiple session information using session start time and session end time.
[0062] In computing, especially in web applications, a session object stores the attributes and configuration information required for a specific user session. This ensures that variables stored in the session object are not lost when a user navigates between web pages within the application, but persist throughout the entire user session.
[0063] After obtaining the target timestamp, each target timestamp can be used as the session start time of the session information. Then, the corresponding session end time can be found in the time series data. Based on the session start time and session end time, several session information can be divided from the time series data.
[0064] This invention divides time-series data into multiple session information segments by querying the timestamps within the data. This avoids situations where session information cannot be accurately segmented when querying session information due to data loss during transmission or abnormal restarts of session information. This improves the accuracy of session information segmentation when querying time-series data.
[0065] Please see Figure 2 , Figure 2 A flowchart illustrating the steps of a method for partitioning session information in time-series data, provided in another embodiment of the present invention. Specifically, this embodiment may include the following steps:
[0066] Step 201: Obtain initial timing data, which contains multiple initial session information entries;
[0067] Step 202: Obtain the first message of each initial session and extract the timestamp of the first message;
[0068] Step 203: Generate sending data using the timestamp and the corresponding initial session information;
[0069] In this embodiment of the invention, the client can upload initial time-series data to the database in real time. This initial time-series data contains multiple initial session information entries. To prevent data loss during transmission from blurring the boundaries between initial session information entries, this embodiment of the invention allows for the simultaneous uploading of the timestamp of the first message of each initial session information entry when sending the time-series data to the database.
[0070] In one example, the step of generating send data using a timestamp and corresponding initial session information may include the following sub-steps:
[0071] S31, Obtain the historical loss rate and target reception rate of the initial session information;
[0072] S32, generate the number of times timestamps are sent based on the historical loss rate and the target reception rate;
[0073] S33 generates sending data based on the number of transmissions, timestamps, and corresponding initial session information.
[0074] In the specific implementation, when each initial session is started, the client can obtain the timestamp of the first message and store it in the session_start_time field of the initial session information for uploading.
[0075] Since data is subject to loss during transmission, multiple identical timestamps can be sent consecutively to reduce the possibility of timestamp loss during transmission.
[0076] Assuming the historical loss rate of initial session information is 1%, and the target reception rate is 99.99%, then the same timestamp will be sent twice (the probability of both being lost simultaneously is 0.01*0.01). By writing the same timestamps that need to be sent consecutively into the `session_start_time` field of the initial session information, the sent data can be obtained.
[0077] Step 204: Send the data to the database. The database generates time-series data based on the reception status of the sent data and stores the timestamps in the timestamp set.
[0078] Because data loss may occur during transmission, the time-series data actually received by the database is not the same as the initial time-series data sent by the client. After receiving the time-series data, the database can obtain the timestamp from the session_start_time field and save it as a timestamp set for that time-series data.
[0079] Step 205: Send a time-series data query command to the database;
[0080] Step 206: Receive the time series data and timestamp set returned by the database response time series data query command;
[0081] Steps 205-206 are the same as steps 101-102. For details, please refer to the description of steps 101-102. They will not be repeated here.
[0082] Step 207: Obtain the target timestamp from the timestamp set;
[0083] In one example, step 207 may include: deduplicating all timestamps in the timestamp set to obtain the target timestamp.
[0084] In real-world scenarios, there may be duplicate timestamps in the timestamp set. Therefore, after obtaining the timestamp set, the client can deduplicate the timestamps to obtain multiple unique target timestamps.
[0085] Step 208: Using each target timestamp as the session start time, query the corresponding session end time in the time series data;
[0086] After obtaining the target timestamp, each target timestamp can be used as the session start time of the session information, and then the corresponding session end time can be found in the time series data.
[0087] In one example, the step of querying the corresponding session end time in the time series data using each target timestamp as the session start time can include the following sub-steps:
[0088] S81, take each target timestamp as the session start time, and obtain the associated timestamps adjacent to each session start time from all target timestamps; the associated timestamps are greater than the session start time;
[0089] S82, in the time series data, obtain the maximum time point between the session start time and the associated timestamp, and determine the maximum time point as the session end time corresponding to the session start time.
[0090] In a practical implementation, each target timestamp can be used as the session start time, and the timestamps adjacent to the session start time that are greater than the session start time can be used as associated timestamps. Then, the maximum time point in the time series data that is greater than the session start time and less than the associated timestamp can be used as the session end time corresponding to the session start time.
[0091] Step 209: Divide the time-series data into multiple session information using session start time and session end time.
[0092] After obtaining the session start time and the corresponding session end time, the data between the session start time and the session end time can be used as session information, and several session information can be divided from the time series data.
[0093] This invention divides time-series data into multiple session information segments by querying the timestamps within the data. This avoids situations where session information cannot be accurately segmented when querying session information due to data loss during transmission or abnormal restarts of session information. This improves the accuracy of session information segmentation when querying time-series data.
[0094] Please see Figure 3 , Figure 3 This is a structural block diagram of a session information partitioning device for time-series data provided in an embodiment of the present invention.
[0095] This invention provides a session information partitioning device for time-series data, applied to a client that communicates with a database; the device includes:
[0096] The time-series data query instruction sending module 301 is used to send time-series data query instructions to the database;
[0097] The time series data and timestamp set receiving module 302 is used to receive the time series data and timestamp set returned by the database response to the time series data query command;
[0098] The target timestamp acquisition module 303 is used to acquire the target timestamp from the timestamp set;
[0099] The session end time query module 304 is used to query the corresponding session end time in the time series data, using each target timestamp as the session start time.
[0100] The session information segmentation module 305 is used to divide the time-series data into multiple session information based on the session start time and session end time.
[0101] In this embodiment of the invention, it further includes:
[0102] The initial timing data acquisition module is used to acquire initial timing data, which contains multiple initial session information.
[0103] The timestamp extraction module is used to obtain the first message of each initial session and extract the timestamp of the first message;
[0104] The data generation module is used to generate data to be sent using a timestamp and the corresponding initial session information.
[0105] The storage module is used to send data to the database. The database generates time-series data based on the reception of the data and stores the timestamps in a timestamp set.
[0106] In this embodiment of the invention, the timestamp set contains multiple timestamps; the target timestamp acquisition module 304 includes:
[0107] The target timestamp acquisition submodule is used to deduplicate all timestamps in the timestamp set to obtain the target timestamp.
[0108] In this embodiment of the invention, the session end time query module 304 includes:
[0109] The associated timestamp acquisition submodule is used to take each target timestamp as the session start time and retrieve the associated timestamps adjacent to each session start time from all target timestamps; the associated timestamp is greater than the session start time.
[0110] The session end time determination submodule is used to obtain the maximum time point between the session start time and the associated timestamp in the time series data, and determine the maximum time point as the session end time corresponding to the session start time.
[0111] In this embodiment of the invention, the data generation module includes:
[0112] The historical loss rate and target reception rate acquisition submodule is used to acquire the historical loss rate and target reception rate of the initial session information;
[0113] The transmission count generation submodule is used to generate the transmission count with timestamps based on the historical loss rate and the target reception rate;
[0114] The data generation submodule is used to generate sending data based on the number of sending attempts, timestamps, and corresponding initial session information.
[0115] This invention also provides an electronic device, which includes a processor and a memory:
[0116] The memory is used to store program code and transfer the program code to the processor;
[0117] The processor is used to execute the session information partitioning method for timing data according to the instructions in the program code of this invention.
[0118] This invention also provides a computer-readable storage medium for storing program code, which is used to execute the session information partitioning method for timing data according to this invention.
[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0120] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0121] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0122] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0123] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0125] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0126] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0127] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 invention.
Claims
1. A method for partitioning session information in time-series data, characterized in that, Applied to a client, the client communicates with a database; the method includes: Send a time-series data query command to the database; Receive the time-series data and timestamp set returned by the database in response to the time-series data query command; Obtain the target timestamp from the set of timestamps; Each target timestamp is used as the session start time, and the corresponding session end time is queried from the time series data. The time-series data is divided into multiple session information segments using the session start time and the session end time; The step of querying the corresponding session end time in the time series data, using each target timestamp as the session start time, includes: Each of the target timestamps is used as the session start time, and the associated timestamps adjacent to each session start time are obtained from all the target timestamps; the associated timestamps are greater than the session start time. In the time series data, the maximum time point between the session start time and the associated timestamp is obtained, and the maximum time point is determined as the session end time corresponding to the session start time; Prior to the step of sending a session query instruction to the database, the method further includes: Acquire initial timing data, which includes multiple initial session information entries; Obtain the first message of each initial session and extract the timestamp of the first message; The timestamp and the corresponding initial session information are used to generate the sending data; The data is sent to the database, and the database generates the time-series data based on the reception status of the data and stores the timestamp in the timestamp set.
2. The method according to claim 1, characterized in that, The timestamp set contains multiple timestamps; the step of obtaining the target timestamp from the timestamp set includes: The target timestamp is obtained by deduplicating all timestamps in the timestamp set.
3. The method according to claim 1, characterized in that, The step of generating and sending data using the timestamp and the corresponding initial session information includes: Obtain the historical loss rate and target reception rate of the initial session information; The number of times the timestamp is generated is based on the historical loss rate and the target reception rate; Sending data is generated based on the number of times sent, the timestamp, and the corresponding initial session information.
4. A device for partitioning session information of time-series data, characterized in that, Applied to a client, the client communicates with a database; the device includes: A time-series data query instruction sending module is used to send time-series data query instructions to the database; The time series data and timestamp set receiving module is used to receive the time series data and timestamp set returned by the database in response to the time series data query command; The target timestamp acquisition module is used to acquire the target timestamp from the timestamp set; The session end time query module is used to query the corresponding session end time in the time series data, taking each of the target timestamps as the session start time; A session information segmentation module is used to divide the time-series data into multiple session information segments using the session start time and the session end time; The session end time query module includes: The associated timestamp acquisition submodule is used to take each target timestamp as the session start time and retrieve the associated timestamps adjacent to each session start time from all target timestamps; the associated timestamp is greater than the session start time. The session end time determination submodule is used to obtain the maximum time point between the session start time and the associated timestamp in the time series data, and determine the maximum time point as the session end time corresponding to the session start time; This also includes: An initial timing data acquisition module is used to acquire initial timing data, which includes multiple initial session information entries. The timestamp extraction module is used to obtain the first message of each initial session information and extract the timestamp of the first message; A data generation module is used to generate data to be sent using the timestamp and the corresponding initial session information. A storage module is used to send the transmitted data to the database, and the database generates the time-series data according to the reception status of the transmitted data and stores the timestamp in the timestamp set.
5. The apparatus according to claim 4, characterized in that, The timestamp set contains multiple timestamps; The target timestamp acquisition module includes: The target timestamp acquisition submodule is used to deduplicate all timestamps in the timestamp set to obtain the target timestamp.
6. An electronic device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the session information partitioning method for timing data according to any one of claims 1-3, based on the instructions in the program code.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the session information partitioning method for time-series data according to any one of claims 1-3.
Citation Information
Patent Citations
Conversation merging method, conversation merging device and computer equipment
CN107958024A