Playback data pushing method, device and equipment for marine target spatio-temporal data

Through multi-threading technology, the space-time data of maritime targets is processed and queryed, which solves the problem of data query IO bottleneck in double-speed playback, and realizes efficient double-speed and reverse-order playback, reducing the lag of maritime target monitoring data.

CN119232790AActive Publication Date: 2024-12-31HAINAN HAILAN HUANYU MARINE INFORMATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411212900.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-31
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The existing technology has lag problems in the double-speed playback of sea target spatio-temporal data, which cannot meet the needs of high-speed and smooth playback, mainly due to the low efficiency of data query IO bottlenecks and snapshot data analysis and filtering.

Method used

Multithreading technology is used to perform segmented processing and query the space-time data of maritime targets. The first thread receives query requests, the second thread obtains segmented data from the database, and the third thread pushes data to the client to realize the forward and reverse data. Sequential playback and improve query IO utilization efficiency through time segmentation.

Benefits of technology

It quickly querys target historical data, supports higher speed playback and reverse order playback, reduces the lag problem of double speed playback, and improves query efficiency and IO utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232790A_ABST
    Figure CN119232790A_ABST
Patent Text Reader

Abstract

The invention provides a playback data pushing method, device and equipment for marine target spatio-temporal data, belongs to the technical field of computer information processing, and solves the problem that marine target monitoring data cannot be played at multiple speeds or the multiple-speed playing is blocked. The method of the server comprises the following steps: receiving a query request of target playback data of marine target spatio-temporal data sent by a client; creating a first thread according to the query request data; segmenting the target playback data through the first thread according to the query condition data to obtain query information of at least one segmented target playback data; obtaining at least one second thread from a thread pool; obtaining at least one piece of segmented target playback data from a database through at least one second thread according to the query information of the at least one piece of segmented target playback data; and pushing the at least one segmented target playback data to the client through the third thread. According to the scheme, the client can realize speed multiplication playing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer information processing, and in particular to a method, device and equipment for pushing playback data of marine target spatiotemporal data. Background Art

[0002] In the increasingly busy marine target activities, it is necessary to collect marine target spatiotemporal data through radar, ship automatic identification system, Beidou and other monitoring equipment. However, in the application process, it is usually necessary to replay historical events to analyze the purpose of target activities and analyze a suspicious target within a certain time range. Quickly replay unimportant time to improve the efficiency of analyzing suspicious target activities; the current playback function has problems such as insufficient speed and playback jams. Therefore, when replaying marine target spatiotemporal data, it is necessary to achieve high-speed and smooth playback.

[0003] Most current technical solutions use snapshot storage to store historical targets. Snapshot data is divided by province, with a frequency of 10 seconds, and is stored in ES (elastic search, background distributed storage and full-text retrieval) storage in time and space order; ES is an efficient query database. However, when the amount of data in a single province is large, data processing will be insufficient, and there will be bottlenecks in query IO during double-speed playback. At the same time, since the snapshot needs to be parsed, filtered, and other operations after the data is queried, and the result data is finally sent to the WEB side for rendering, the server-side data input and output pressure increases during double-speed playback, and the data query speed cannot meet the double-speed playback, and there will be a phenomenon of jamming. Summary of the invention

[0004] The present invention provides a playback data push method, device and equipment for marine target spatiotemporal data, which solves the problem that marine target monitoring data cannot be played at double speed or is stuck when played at double speed.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] An embodiment of the present invention provides a playback data push method for marine target spatiotemporal data, which is applied to a server. The method includes:

[0007] Receive a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data;

[0008] Creating a first thread according to the query request data;

[0009] The first thread processes the target playback data in segments according to the query condition data to obtain query information of at least one segmented target playback data;

[0010] Obtain at least one second thread from the thread pool;

[0011] The at least one second thread obtains at least one segmented target playback data from the database according to the query information of the at least one segmented target playback data;

[0012] A third thread pushes the at least one segmented target playback data to the client.

[0013] Optionally, the first thread processes the target playback data in segments according to the query condition data to obtain query information of at least one segmented target playback data, including:

[0014] When the query condition data is that the target playback data needs to be played in the forward chronological order, the first thread processes the target playback data in segments to obtain first query information of at least one segmented target playback data;

[0015] When the query condition data is that the target playback data needs to be played in the reverse chronological order, the first thread processes the target playback data in segments to obtain second query information of at least one segmented target playback data.

[0016] Optionally, when the query condition data is that the target playback data needs to be played in the forward chronological order, the first thread processes the target playback data in segments to obtain first query information of at least one segmented target playback data, including:

[0017] The first thread obtains the playback speed multiple n and the maximum period k of the target playback data;

[0018] When n < k, the target playback data is divided into n - 1 segments with the start time as the starting point and the end time as the ending point, and the duration of each segmented target playback data is (t e -t s ) / (n - 1), where t s is the start time of the target playback data, and t e is the end time of the target playback data;

[0019] When n > k, the target playback data is divided into n - 1 segments with the start time as the starting point and the end time as the ending point, and the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s) / (n - 1) - k;

[0020] Query each segmented target playback data to obtain first query information of at least one segmented target playback data.

[0021] Optionally, when the query condition data is that the target playback data needs to be played in reverse chronological order, the first thread is used to segment the target playback data to obtain second query information of at least one segmented target playback data, including:

[0022] Obtain the playback speed n and the maximum period k of the target playback data through the first thread;

[0023] When n < k, divide the target playback data into n - 1 segments with the end time as the starting point and the start time as the ending point, and the duration of each segmented target playback data is (t e -t s ) / (n - 1); where t s is the start time of the target playback data, and t e is the end time of the target playback data;

[0024] When n > k, divide the target playback data into n - 1 segments with the end time as the starting point and the start time as the ending point, and the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n - 1) - k;

[0025] Query each segmented target playback data to obtain second query information of at least one segmented target playback data.

[0026] Optionally, push the at least one segmented target playback data to the client through a third thread, including:

[0027] Cache the at least one segmented target playback data to obtain buffered queue data;

[0028] Receive the sending frequency data sent by the client;

[0029] Compare the sending frequency data with a preset push frequency. When the sending frequency data is less than the preset push frequency, the third thread is in a sleep mode; when the sending frequency data is greater than or equal to the preset push frequency, the third thread sends the buffered queue data to the client.

[0030] An embodiment of the present invention further provides a method for receiving playback data of maritime target spatio-temporal data, which is applied to a client. The method includes:

[0031] Sending a query request for target playback data of marine target spatiotemporal data to a server, wherein the query request carries query condition data;

[0032] Receive at least one segmented target playback data sent by the server through a third thread; the at least one segmented target playback data is that the server creates a first thread according to the query request, and the first thread performs segmentation processing on the target playback data according to the query condition data to obtain query information of at least one segmented target playback data, and obtains at least one second thread from the thread pool; and obtains at least one segmented target playback data from a database through the at least one second thread according to the query information of the at least one segmented target playback data.

[0033] Optionally, the playback data receiving method of the marine target spatiotemporal data further includes:

[0034] The at least one segment target playback data is displayed on a display interface of the client.

[0035] The embodiment of the present invention further provides a playback data push device for marine target spatiotemporal data, which is applied to a server, and the device includes:

[0036] A first transceiver module is used to receive a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data;

[0037] A generating module, configured to create a first thread according to the query request data;

[0038] A processing module, configured to perform segment processing on the target playback data according to the query condition data through the first thread to obtain query information of at least one segmented target playback data;

[0039] A first acquisition module, used to acquire at least one second thread from the thread pool;

[0040] A second acquisition module, configured to acquire at least one segmentation target playback data from a database according to query information of the at least one segmentation target playback data through the at least one second thread;

[0041] The first transceiver module is further configured to push the at least one segment target playback data to the client through a third thread.

[0042] The embodiment of the present invention further provides a playback data receiving device for marine target spatiotemporal data, which is applied to a client, and the device includes:

[0043] A second transceiver module is used to send a query request for target playback data of marine target spatiotemporal data to a server, wherein the query request carries query condition data;

[0044] The second transceiver module is further used to receive at least one segment target playback data sent by the server through the third thread; the at least one segment target playback data is that the server creates a first thread according to the query request, and the first thread performs segment processing on the target playback data according to the query condition data to obtain query information of at least one segment target playback data, and obtains at least one second thread from the thread pool; and obtains at least one segment target playback data from the database according to the query information of the at least one segment target playback data through the at least one second thread;

[0045] The display module is used to display the at least one segment target playback data on the display interface of the client.

[0046] An embodiment of the present invention further provides a computing device, comprising: a processor and a memory storing a computer program, wherein the computer program executes the above method when executed by the processor.

[0047] The technical solution of the present invention includes at least the following effects:

[0048] The above-mentioned scheme of the present invention receives a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data; creates a first thread according to the query request data; performs segmentation processing on the target playback data according to the query condition data by the first thread to obtain query information of at least one segmented target playback data; obtains at least one second thread from the thread pool; obtains at least one segmented target playback data from a database according to the query information of the at least one segmented target playback data by the at least one second thread; pushes the at least one segmented target playback data to the client through a third thread; and realizes forward and reverse playback of data by using multiple threads to perform time segmentation query on a cluster spatiotemporal database in forward and reverse directions, so as to quickly query the historical data of the target, improve the query efficiency, support higher speed playback and reverse playback, reduce the jamming problem of speed playback of marine target monitoring data, and improve the utilization efficiency of query IO through time segmentation, and reduce the risk caused by sudden concentrated increase of IO. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flow chart of a playback data push method for marine target spatiotemporal data provided by an embodiment of the present invention;

[0050] Figure 2It is a schematic diagram of segmenting target playback data in chronological order when the playback multiple is less than the data period provided by an embodiment of the present invention;

[0051] Figure 3 It is a schematic diagram of segmenting target playback data in chronological order when the playback multiple is greater than the data period provided by an embodiment of the present invention;

[0052] Figure 4 It is a schematic diagram of segmenting target playback data in reverse chronological order when the playback multiple is less than the data period provided by an embodiment of the present invention;

[0053] Figure 5 It is a schematic diagram of segmenting the target playback data in reverse chronological order when the playback multiple is greater than the data period provided by an embodiment of the present invention;

[0054] Figure 6 It is a schematic diagram of playback push frequency control in the playback data push method for marine target spatiotemporal data provided by an embodiment of the present invention;

[0055] Figure 7 It is an overall flow chart of target data playback in the playback data push method for marine target spatiotemporal data provided by an embodiment of the present invention;

[0056] Figure 8 It is a structural diagram of a playback data push device for marine target spatiotemporal data applied to a server provided by an embodiment of the present invention;

[0057] Fig. 9 It is a structural diagram of a playback data receiving device for marine target spatiotemporal data applied to a client provided by an embodiment of the present invention;

[0058] Fig.10 is a schematic diagram of the structure of a computing device provided by an embodiment of the present invention;

[0059] Among them, 1. Time axis direction; 2. Program running timing. DETAILED DESCRIPTION

[0060] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0061] like Figure 1 As shown, an embodiment of the present invention proposes a playback data push method for marine target spatiotemporal data, which is applied to a server. The method includes:

[0062] Step 11, receiving a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data;

[0063] Step 12, creating a first thread according to the query request data;

[0064] Step 13, performing segmentation processing on the target playback data according to the query condition data through the first thread to obtain query information of at least one segmented target playback data;

[0065] Step 14, obtaining at least one second thread from the thread pool;

[0066] Step 15, obtaining at least one segment target playback data from a database according to query information of the at least one segment target playback data through the at least one second thread;

[0067] Step 16: Push the at least one segment target playback data to the client through a third thread.

[0068] In this example, the server first receives a query request from the client; this request is specific to the playback data of the spatiotemporal data of the marine target, including the query of the historical position, speed, heading and other information of the target; the query request usually carries some query condition data, such as time range (start time and end time), geographical location range (longitude and latitude boundaries), target identifier (such as ship name, number, etc.), etc., which are used to limit the specific content and scope of the query;

[0069] After receiving the query request, the server will create a main thread, i.e. the first thread, based on the request data. The purpose of creating the first thread is to process the query tasks in parallel, avoiding blocking the main thread due to long database queries or data processing, thereby maintaining the responsiveness and efficiency of the system.

[0070] In the first thread, the server processes the target playback data in segments according to the query condition data, including dividing a large amount of spatiotemporal data according to time, space or other logic for parallel processing and query; segment processing can effectively reduce the pressure of a single query operation on the database and improve query efficiency; the result of the processing will be query information of at least one segmented target playback data, which contains the specific parameters required to query each segmented data; in order to improve concurrent processing capabilities and resource utilization, the server usually maintains a thread pool, from which the server can obtain one or more child threads, i.e., the second thread, to perform the next data query task; the advantage of the thread pool is that it can reuse the created threads, reducing the overhead of thread creation and destruction, and can better control The number of threads running simultaneously in the server can avoid excessive resource consumption; each second thread will independently query and obtain the corresponding data from the database according to the query information of the segmented target playback data received from the first thread; this parallel query method can significantly reduce the total query time, especially when processing a large amount of data, each thread will only process the data segment assigned to it, and after completion, it will return the result to the main thread or store it in shared memory for subsequent processing; in order to further optimize data transmission and processing, the server may create a daemon thread, that is, the third thread, to be responsible for pushing the queried data to the client; this can separate the data acquisition and transmission processes, ensuring that even in large-scale data transmission, it will not affect the performance of database queries or other processing tasks. The third thread will assemble and send the collected segmented target playback data to the client in accordance with the appropriate protocol and format, completing the entire query and data transmission process.

[0071] The above-mentioned technical scheme of the present invention realizes the forward and reverse playback of data by using multi-threading to query the cluster spatiotemporal database in forward and reverse directions through time segmentation. It can quickly query the historical data of the target, improve the efficiency of the query, support higher-speed playback and reverse playback, and improve the utilization efficiency of query IO through time segmentation, reducing the risk caused by sudden concentrated increase in IO.

[0072] In an optional embodiment, the embodiment of the present invention provides that step 13 may include:

[0073] Step 131, when the query condition data indicates that the target playback data needs to be played in a chronological order, the target playback data is segmented by the first thread to obtain first query information of at least one segmented target playback data;

[0074] Step 132, when the query condition data is the target playback data that needs to be played in reverse chronological order, through the first thread, perform segmentation processing on the target playback data to obtain second query information of at least one segmented target playback data.

[0075] In this instance, the server first parses the query condition data to determine that the user hopes to play the target playback data in forward chronological order; based on this requirement, the server will perform segmentation processing on the target playback data through the first thread to obtain first query information of at least one segmented target playback data; when it is determined that the user hopes to play the target playback data in reverse chronological order, the server will perform segmentation processing on the target playback data through the first thread to obtain second query information of at least one segmented target playback data.

[0076] Such as Figure 2 and Figure 3 shown, in an optional embodiment proposed by the embodiment of the present invention, step 131 may include:

[0077] Step 1311, obtain the playback speed multiple n and the maximum period k of the target playback data through the first thread;

[0078] Step 1312, when n < k, divide the target playback data into n - 1 segments with the start time as the starting point and the end time as the ending point, and the duration of each segmented target playback data is (t e -t s ) / (n - 1), where t s is the start time of the target playback data, and t e is the end time of the target playback data;

[0079] Step 1313, when n > k, divide the target playback data into n - 1 segments with the start time as the starting point and the end time as the ending point, and the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n - 1) - k;

[0080] Step 1314, perform a query on each segmented target playback data to obtain first query information of at least one segmented target playback data.

[0081] In this instance, the server first determines the playback speed multiple n when playing the target playback data desired by the user and the maximum period k of the target playback data. The maximum period k can be understood as the maximum time for multiple groups of radar to scan one week, and n = 1 is the normal speed;

[0082] When n < k, at the first query, the start time t0 = t s-k, the time required to query a complete cycle of data for the first time is k, where t0 is the query start time, t s is the start time of the target playback data, which is also the query end time; the target playback data is played back from t s to e Segmentation, where t e is the end time of the target playback data; the segmentation process specifically includes: the start time of time segment 2 is t s , and end time is t2; time segment 3 starts at t2 and ends at t3...; time segment n starts at t n-1 , the end time is t e ; The duration of each segment target playback data is (t e -t s ) / (n-1), use loop logic to query the segment time, query radar target data, AIS target data, and Beidou target data simultaneously through multi-threaded threads, and then merge them into the buffer queue to continue to execute the next time segment in the loop to ensure that the time sequence in the buffer queue is in positive order;

[0083] When n>k, the first query starts at time t0=t s -k, the first query needs to be a complete cycle of data for a period of k, then the query start time is t0, the end time is t s ; from t s to e Segmentation is performed; the segmentation process specifically includes: the start time of time segment 2 is t'2-k, and the end time is t'2; the start time of time segment 3 is t'3-k, and the end time is t'3...; the start time of segment time n is t e -k, end time is t e ; The duration of each segment target playback data is k, and the time interval between two adjacent segment target playback data is (t e -t s ) / (n-1)-k; use loop logic to query the segmented time, query the radar target data, AIS target data, and Beidou target data simultaneously through multi-threaded threads, and then merge them into the buffer queue to continue to execute the next time segment in the loop to ensure that the time sequence in the buffer queue is in positive order; query each segmented target playback data to obtain the first query information of at least one segmented target playback data.

[0084] like Figure 4 and Figure 5 As shown, the embodiment of the present invention proposes an optional embodiment, step 132 may include:

[0085] Step 1321: Obtain the playback speed multiple n and the maximum period k of the target playback data through the first thread;

[0086] Step 1322: When n < k, divide the target playback data into n - 1 segments with the end time as the starting point and the start time as the ending point. The duration of each segmented target playback data is (t e -t s ) / (n - 1); where t s is the start time of the target playback data, and t e is the end time of the target playback data;

[0087] Step 1323: When n > k, divide the target playback data into n - 1 segments with the end time as the starting point and the start time as the ending point. The duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n - 1) - k;

[0088] Step 1324: Query each segmented target playback data to obtain the second query information of at least one segmented target playback data.

[0089] In this example, the server first determines the playback speed multiple n during the playback of the target playback data desired by the user and the maximum period k of the target playback data;

[0090] When n < k, at the first query, the start time t0 = t e + k. The duration of the data for one complete cycle to be queried for the first time is k, so the query start time is t e , and the end time is t0; From t e to t s for segmentation; The specific segmentation process includes: The start time of time segment 2 is t2, and the end time is t e ; The start time of time segment 3 is t3, and the end time is t2...; The start time of time segment n is t s and the end time is t n-1 ; where the duration of each segmented target playback data is (t e -t s ) / (n - 1); Use loop logic to query the segmented time. Simultaneously query radar target data, AIS target data, and Beidou target data through multiple threads, and then merge them into the buffer queue to continue executing the next time segment of the loop to ensure the chronological reverse order in the buffer queue;

[0091] When n > k, at the first query, the start time t0 = t s - k. The duration of the data for one complete cycle to be queried for the first time is k, so the query start time is te , the end time is t0; from t e to s Segmentation is performed; the segmentation process specifically includes: the start time of time segment 2 is t'2+k, and the end time is t'2; the start time of time segment 3 is t'3+k, and the end time is t'3...; the start time of segment time n is t s , the end time is t s + k; where the duration of each segment target playback data is k, and the time interval between two adjacent segment target playback data is (t e -t s ) / (n-1)-k; use loop logic to query the segmented time, query the radar target data, AIS target data, and Beidou target data simultaneously through multi-threaded threads, and then merge them into the buffer queue to continue to execute the next time segment in the loop to ensure the reverse order of the time sequence in the buffer queue; query each segmented target playback data to obtain the second query information of at least one segmented target playback data.

[0092] like Figure 6 and Figure 7 As shown, the embodiment of the present invention proposes an optional embodiment, step 16 may include:

[0093] Step 161, caching the at least one segment target playback data to obtain buffer queue data;

[0094] Step 162, receiving the transmission frequency data sent by the client;

[0095] Step 163, compare the sending frequency data with the preset push frequency. When the sending frequency data is less than the preset push frequency, the third thread is in sleep mode; when the sending frequency data is greater than or equal to the preset push frequency, the third thread sends the buffer queue data to the client.

[0096] In this example, first, the retrieved data is filtered according to conditions to obtain the data stream that the user wants to see. Then, the filtered data is pushed into a buffer queue, which is a blocking queue. When the queue is full, the data acquisition module will pause data acquisition and release the query sub-thread, that is, the second thread. The daemon thread (i.e., the third thread) polls all connected clients an infinite number of times. One round of polling for all clients is considered a cycle. When no client is connected to the service, it is necessary to control the polling frequency to avoid resource consumption due to idling. By setting a push value with a maximum frequency of m (unit: milliseconds per time), when there is no data to be pushed, the daemon thread will sleep for m milliseconds every time it polls. Let the frequency of the daemon thread for pushing one cycle be i (unit: milliseconds per time). If i < m, the daemon thread will enter the sleep stage, and the sleep time is set to m - i milliseconds. According to the maximum sending frequency value i n (unit: milliseconds per time) provided by the client for frequency pushing of a single connection. For example, if the current push timestamp is t1, then the next push time is calculated as: t next = t1 + i n ; The time for the next push is t2. If t2 < t next , then it will not be pushed to the client. If t2 ≥ t next , then it will be pushed to the client.

[0097] In the above embodiments of the present invention, by using multi-threading on the server side to perform time-segmented queries on the cluster spatio-temporal database in both forward and reverse directions, the forward and reverse playback of data is achieved, the historical data of the target can be quickly queried, the query efficiency is improved, higher-speed playback and reverse playback are supported, and through time segmentation, the utilization efficiency of query I / O is improved, and the risk brought by sudden concentrated increase in I / O is reduced. After pushing the playback data to the client, the client can support higher-speed playback and reverse playback, reducing the stuttering problem of high-speed playback of maritime target monitoring data.

[0098] An embodiment of the present invention provides a method for receiving playback data of maritime target spatio-temporal data, which is applied to a client. The method includes:

[0099] Step 21, sending a query request for target playback data of maritime target spatio-temporal data to the server side, where the query request carries query condition data;

[0100] Step 22, receiving at least one segmented target playback data sent by the server through a third thread; the at least one segmented target playback data is that the server creates a first thread according to the query request, and the first thread performs segmentation processing on the target playback data according to the query condition data to obtain query information of at least one segmented target playback data, and obtains at least one second thread from the thread pool; at least one segmented target playback data is obtained from the database through the at least one second thread according to the query information of the at least one segmented target playback data.

[0101] Furthermore, the playback data receiving method of the marine target spatiotemporal data further includes:

[0102] Step 23: Display the at least one segment target playback data on the display interface of the client.

[0103] In this example, the client first sends a query request to the server. The query request is specific to the playback data of the spatiotemporal data of the marine target, including the query of the historical position, speed, heading and other information of the target. The query request usually carries some query condition data, such as time range (start time and end time), geographical location range (longitude and latitude boundaries), target identifier (such as ship name, number, etc.), etc., which are used to limit the specific content and scope of the query. After receiving the query request, the server will create a main thread, i.e., the first thread, based on these request data. The purpose of creating the first thread is to process query tasks in parallel to avoid blocking the main thread due to long-term database query or data processing, thereby maintaining the responsiveness and efficiency of the system. In the first thread, the server performs segmented processing on the target playback data according to the query condition data, including dividing a large amount of spatiotemporal data according to time, space or other logic for parallel processing and query. Segmented processing can effectively reduce the pressure of a single query operation on the database and improve query efficiency. The result of the processing will be query information of at least one segmented target playback data, which contains the query of each segment. Specific parameters required for segmented data; In order to improve concurrent processing capabilities and resource utilization, the server usually maintains a thread pool, from which the server can obtain one or more child threads, namely the second thread, to perform the next data query task; The advantage of the thread pool is that it can reuse the created threads, reducing the overhead of thread creation and destruction, and at the same time can better control the number of threads running simultaneously in the server to avoid excessive resource consumption; Each second thread will independently query and obtain the corresponding data from the database based on the query information of the segmented target playback data received from the first thread; This parallel query method can significantly reduce the total query time, especially when processing a large amount of data, each thread will only process the data segment assigned to it, and after completion, it will return the result to the main thread or store it in shared memory for subsequent processing; In order to further optimize data transmission and processing, the server may create a daemon thread, namely the third thread, to be responsible for pushing the queried data to the client; This can separate the data acquisition and transmission processes, ensuring that even in large-scale data transmission, it will not affect the performance of database queries or other processing tasks. The third thread will assemble and send the collected segmented target playback data to the client in accordance with the appropriate protocol and format, complete the entire query and data transmission process, and finally display the at least one segmented target playback data on the display interface of the client.

[0104] like Figure 6 and Figure 7 As shown, a specific embodiment of the playback data push of the marine target spatiotemporal data provided by the embodiment of the present invention is:

[0105] Step 1: The server starts and creates a daemon thread for pushing playback data and receiving a query request for the target playback data of the spatio-temporal data of maritime targets sent by the client. The query request carries query condition data.

[0106] Step 2: The client initiates a websocket connection. After the backend receives the connection signal, it creates a main thread (the first thread), and the main thread caches the query conditions.

[0107] Step 3: The main thread processes the time to be queried in segments and obtains sub-threads from the thread pool to concurrently query the StarRocks database; it is calculated that the maximum of a complete data cycle is k seconds.

[0108] (1) When playing back in chronological order, the start time of the playback passed by the client is t s , the end time is t e , and the playback speed is n; when n = 1, it is the normal playback speed. When n < k, at the first query, the start time t0 = t s - k, and the duration of the data for the first query to obtain a complete cycle is k. Among them, t0 is the query start time, and t s is the start time of the target playback data and also the query end time; the target playback data is segmented from t s to t e . Among them, t e is the end time of the target playback data; the segmentation process specifically includes: the start time of time segment 2 is t s , the end time is t2; the start time of time segment 3 is t2, the end time is t3...; the start time of time segment n is t n-1 , the end time is t e ; the duration of each segmented target playback data is (t e - t s ) / (n - 1). Use a loop logic to query the segmented time, simultaneously query radar target data, AIS target data, and Beidou target data through multiple threads, and then merge them into the buffer queue to continue executing the next time segment of the loop, ensuring that the time sequence in the buffer queue is in chronological order; when n > k, at the first query, the start time t0 = t s - k, and the duration of the data for the first query to obtain a complete cycle is k, then the query start time is t0, and the end time is t s ; segment from t s to t e ; the segmentation process specifically includes: the start time of time segment 2 is t'2 - k, the end time is t'2; the start time of time segment 3 is t'3 - k, the end time is t'3...; the start time of segmented time n is t e-k, with the end time being t e ; where the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n - 1) - k; Use loop logic to query the segmented time, simultaneously query radar target data, AIS target data, and Beidou target data through multi-threaded threads, and then merge and put them into the buffer queue to continue executing the next time segment of the loop, ensuring that the time sequence in the buffer queue is in ascending order;

[0109] (2) When the playback is played in reverse chronological order, the start time of the playback passed by the client is t s , and the end time is t e . When n < k, the start time t0 = t e +k for the first query. The duration of the data for the first query of a complete cycle is k, so the query start time is t e , and the end time is t0; From t e to t s for segmentation; The specific segmentation process includes: the start time of time segment 2 is t2, and the end time is t e ; the start time of time segment 3 is t3, and the end time is t2...; the start time of time segment n is t s , and the end time is t n-1 ; where the duration of each segmented target playback data is (t e -t s ) / (n - 1); Use loop logic to query the segmented time, simultaneously query radar target data, AIS target data, and Beidou target data through multi-threaded threads, and then merge and put them into the buffer queue to continue executing the next time segment of the loop, ensuring that the time sequence in the buffer queue is in reverse order; When n > k, the start time t0 = t s -k for the first query. The duration of the data for the first query of a complete cycle is k, so the query start time is t e , and the end time is t0; From t e to t s for segmentation; The specific segmentation process includes: the start time of time segment 2 is t'2 + k, and the end time is t'2; the start time of time segment 3 is t'3 + k, and the end time is t'3...; the start time of segmented time n is t s , and the end time is t s +k; where the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s) / (n - 1) - k; Use loop logic to query segmented time. Query radar target data, AIS target data, and Beidou target data simultaneously through multi-threaded threads, and then merge them into the buffer queue to continue executing the next time segment of the loop, ensuring the reverse order of time series in the buffer queue;

[0110] Step 4, obtain at least one second thread from the thread pool;

[0111] Step 5, obtain at least one segmented target playback data from the database through the at least one second thread according to the query information of the at least one segmented target playback data;

[0112] Step 6, push the at least one segmented target playback data to the client through the third thread;

[0113] Perform conditional filtering on the queried data to obtain the data stream that the user wants to see; then push the filtered data into the buffer queue. This buffer queue is a blocking queue. When the queue is full, the data acquisition module will pause data acquisition and release the query sub-thread, that is, the second thread; the daemon thread (i.e., the third thread) polls all connected clients an infinite number of times. One round of polling for all clients is one cycle. When no client is connected to the service, it is necessary to control the polling frequency to avoid idling and consuming resources; by setting a maximum frequency of m (unit: milliseconds / time) for the push value, when there is no data to push, then the daemon thread will sleep for m milliseconds every time it polls; let the frequency of the daemon thread pushing one cycle be i (unit: milliseconds / time). If i < m, then the daemon thread will enter the sleep stage, and the sleep time is set to m - i milliseconds; according to the maximum sending frequency value i given by the client n (unit: milliseconds / time) to perform frequency push for a single connection. For example, if the current push timestamp is t1, then calculate the next push time as: t next = t1 + i n ; The time for the next push is t2. If t2 < t next , then it will not be pushed to the client. If t2 ≥ t next , then it will be pushed to the client.

[0114] Step 7, the client terminates the websocket connection, releases all main threads and sub-threads, and terminates the push of the playback data.

[0115] The above method proposed by the present invention realizes the forward and reverse playback of data by using multi-threading to perform time segmentation query on the cluster spatiotemporal database in forward and reverse directions, can quickly query the historical data of the target, improves the query efficiency, supports higher-speed playback and reverse playback, and improves the utilization efficiency of query IO through time segmentation, reduces the risk caused by sudden concentrated increase in IO, and after pushing the playback data to the client, the client can support higher-speed playback and reverse playback, reducing the jamming problem of high-speed playback of maritime target monitoring data.

[0116] like Figure 8 As shown, the embodiment of the present invention further provides a playback data push device 80 for marine target spatiotemporal data, which is applied to a server. The device 80 includes:

[0117] The first transceiver module 81 is used to receive a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data;

[0118] A generating module 82, configured to create a first thread according to the query request data;

[0119] A processing module 83 is used to perform segment processing on the target playback data according to the query condition data through the first thread to obtain query information of at least one segmented target playback data;

[0120] A first acquisition module 84, configured to acquire at least one second thread from the thread pool;

[0121] The second acquisition module 85 is further configured to acquire at least one segmentation target playback data from the database according to the query information of the at least one segmentation target playback data through the at least one second thread;

[0122] The first transceiver module 81 is further configured to push the at least one segment target playback data to the client through a third thread.

[0123] Optionally, the processing module 83 is specifically used for:

[0124] When the query condition data indicates that the target playback data needs to be played in a chronological order, the target playback data is segmented by the first thread to obtain first query information of at least one segmented target playback data;

[0125] When the query condition data indicates that the target playback data needs to be played in reverse chronological order, the target playback data is segmented through the first thread to obtain second query information of at least one segmented target playback data.

[0126] Optionally, when the query condition data is target playback data that needs to be played in chronological order, the first thread is used to segment the target playback data to obtain first query information for at least one segmented target playback data, including:

[0127] Obtain the playback speed n and the maximum period k of the target playback data through the first thread;

[0128] When n < k, divide the target playback data into n - 1 segments with the start time as the starting point and the end time as the ending point, and the duration of each segmented target playback data is (t e -t s ) / (n - 1), where t s is the start time of the target playback data, and t e is the end time of the target playback data;

[0129] When n > k, divide the target playback data into n - 1 segments with the start time as the starting point and the end time as the ending point, and the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n - 1) - k;

[0130] Query each segmented target playback data to obtain first query information for at least one segmented target playback data.

[0131] Optionally, when the query condition data is target playback data that needs to be played in reverse chronological order, the first thread is used to segment the target playback data to obtain second query information for at least one segmented target playback data, including:

[0132] Obtain the playback speed n and the maximum period k of the target playback data through the first thread;

[0133] When n < k, divide the target playback data into n - 1 segments with the end time as the starting point and the start time as the ending point, and the duration of each segmented target playback data is (t e -t s ) / (n - 1); where t s is the start time of the target playback data, and t e is the end time of the target playback data;

[0134] When n > k, divide the target playback data into n - 1 segments with the end time as the starting point and the start time as the ending point, and the duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n - 1) - k;

[0135] A query is performed on each segment target playback data to obtain second query information of at least one segment target playback data.

[0136] Optionally, the first transceiver module 81 is specifically used for:

[0137] Cache the at least one segment target playback data to obtain buffer queue data;

[0138] Receive the sending frequency data sent by the client;

[0139] The sending frequency data is compared with the preset push frequency. When the sending frequency data is less than the preset push frequency, the third thread is in sleep mode; when the sending frequency data is greater than or equal to the preset push frequency, the third thread sends the buffer queue data to the client.

[0140] It should be noted that the device is a device corresponding to the above-mentioned server-side method, and all implementation methods of the above-mentioned server-side method are applicable to the embodiments of the device and can achieve the same technical effects.

[0141] like Fig. 9 As shown, the embodiment of the present invention further provides a playback data receiving device 90 for marine target spatiotemporal data, which is applied to a client, and the device 90 includes:

[0142] The second transceiver module 91 is used to send a query request for target playback data of marine target spatiotemporal data to the server, wherein the query request carries query condition data;

[0143] The second transceiver module 91 is also used to receive at least one segmented target playback data sent by the server through the third thread; the at least one segmented target playback data is created by the server according to the query request, and the target playback data is segmented according to the query condition data through the first thread to obtain query information of at least one segmented target playback data, and at least one second thread is obtained from the thread pool; at least one segmented target playback data is obtained from the database through the at least one second thread according to the query information of the at least one segmented target playback data.

[0144] Optionally, the device 90 further includes:

[0145] The display module 92 is used to display the at least one segment target playback data on the display interface of the client.

[0146] It should be noted that this device is a device corresponding to the above-mentioned method on the client side, and all implementation methods in the above-mentioned method embodiment on the client side are applicable to this embodiment and can achieve the same technical effect.

[0147] like Fig.10 As shown, an embodiment of the present invention further provides a computing device 100, including a processor 101, a memory 102, a program or instruction stored in the memory 102 and executable on the processor 101, and when the program or instruction is executed by the processor 101, each process of the above-mentioned playback data push method embodiment of the marine target spatiotemporal data is implemented, and the same technical effect can be achieved. To avoid repetition, it is not described here. It should be noted that the computing device in the embodiment of the present invention includes the above-mentioned mobile electronic device and non-mobile electronic device.

[0148] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0150] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0153] Stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0154] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0155] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general-purpose device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code for implementing a method or device. That is to say, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0156] The above are preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A playback data push method for marine target spatiotemporal data, characterized in that: Applied to a server, the method comprises: Receive a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data; Creating a first thread according to the query request data; The target playback data is segmented and processed by the first thread according to the query condition data to obtain query information of at least one segmented target playback data; Obtain at least one second thread from the thread pool; Acquire at least one segmentation target playback data from a database according to query information of the at least one segmentation target playback data by the at least one second thread; The at least one segment target playback data is pushed to the client through a third thread.

2. The playback data push method of marine target spatiotemporal data according to claim 1, characterized in that: The target playback data is segmented and processed by the first thread according to the query condition data to obtain query information of at least one segmented target playback data, including: When the query condition data indicates that the target playback data needs to be played in chronological order, the target playback data is segmented by the first thread to obtain first query information of at least one segmented target playback data; When the query condition data indicates that the target playback data needs to be played in reverse chronological order, the target playback data is segmented through the first thread to obtain second query information of at least one segmented target playback data.

3. The playback data push method of marine target spatiotemporal data according to claim 2 is characterized in that: When the query condition data indicates that the target playback data needs to be played in chronological order, the target playback data is segmented by the first thread to obtain first query information of at least one segmented target playback data, including: Acquire the playback speed n and the maximum period k of the target playback data through the first thread; When n < k, divide the target playback data into n - 1 segments with the start time as the starting point and the end time as the ending point. The duration of each segmented target playback data is (t e - t s ) / (n - 1), where t s is the start time of the target playback data, and t e is the end time of the target playback data; When n>k, the target playback data is divided into n-1 segments with the start time as the starting point and the end time as the end point. The duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n-1)-k; A query is performed on each segment target playback data to obtain first query information of at least one segment target playback data.

4. The playback data push method of marine target spatiotemporal data according to claim 2, characterized in that: When the query condition data indicates that the target playback data needs to be played in reverse chronological order, the target playback data is segmented through the first thread to obtain second query information of at least one segmented target playback data, including: Acquire the playback speed n and the maximum period k of the target playback data through the first thread; When n < k, divide the target playback data into n - 1 segments starting from the end time and ending at the start time, and the duration of each segmented target playback data is (t e - t s ) / (n - 1); where t s is the start time of the target playback data, and t e is the end time of the target playback data; When n>k, the target playback data is divided into n-1 segments with the end time as the starting point and the start time as the end point. The duration of each segmented target playback data is k, and the time interval between two adjacent segmented target playback data is (t e -t s ) / (n-1)-k; A query is performed on each segment target playback data to obtain second query information of at least one segment target playback data.

5. The playback data push method of marine target spatiotemporal data according to claim 1, characterized in that: Pushing the at least one segment target playback data to the client through a third thread includes: Cache the at least one segment target playback data to obtain buffer queue data; Receive the sending frequency data sent by the client; The sending frequency data is compared with the preset push frequency. When the sending frequency data is less than the preset push frequency, the third thread is in sleep mode; when the sending frequency data is greater than or equal to the preset push frequency, the third thread sends the buffer queue data to the client.

6. A playback data receiving method for marine target spatiotemporal data, characterized in that: Applied to a client, the method comprises: Sending a query request for target playback data of marine target spatiotemporal data to a server, wherein the query request carries query condition data; Receive at least one segmented target playback data sent by the server through a third thread; the at least one segmented target playback data is that the server creates a first thread according to the query request, and the first thread performs segmentation processing on the target playback data according to the query condition data to obtain query information of at least one segmented target playback data, and obtains at least one second thread from the thread pool; and obtains at least one segmented target playback data from a database through the at least one second thread according to the query information of the at least one segmented target playback data.

7. The playback data receiving method of marine target spatiotemporal data according to claim 6, characterized in that: Also includes: The at least one segment target playback data is displayed on a display interface of the client.

8. A playback data push device for marine target spatiotemporal data, characterized in that: Applied to a server, the device comprises: A first transceiver module is used to receive a query request for target playback data of marine target spatiotemporal data sent by a client, wherein the query request carries query condition data; A generating module, configured to create a first thread according to the query request data; A processing module, configured to perform segment processing on the target playback data according to the query condition data through the first thread to obtain query information of at least one segmented target playback data; A first acquisition module, used to acquire at least one second thread from the thread pool; A second acquisition module, configured to acquire at least one segmentation target playback data from a database according to query information of the at least one segmentation target playback data through the at least one second thread; The first transceiver module is further configured to push the at least one segment target playback data to the client through the third thread.

9. A playback data receiving device for marine target spatiotemporal data, characterized in that: Applied to a client, the device comprises: A second transceiver module is used to send a query request for target playback data of marine target spatiotemporal data to a server, wherein the query request carries query condition data; The second transceiver module is also used to receive at least one segmented target playback data sent by the server through the third thread; the at least one segmented target playback data is created by the server according to the query request, and the target playback data is segmented according to the query condition data through the first thread to obtain query information of at least one segmented target playback data, and at least one second thread is obtained from the thread pool; at least one segmented target playback data is obtained from the database through the at least one second thread according to the query information of the at least one segmented target playback data.

10. A computing device, characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 7 is executed.

Citation Information

Patent Citations

  • Radar used for marine law enforcement and video data quick positioning method

    CN107959892A

  • Method and device for playing back live video

    CN110113626A

  • Database-based playback method and system, server and client

    CN110858223A

  • Video playing method and device

    CN110971978A

  • Monitoring video playing method and device and readable storage medium

    CN112437270A