Data generation method, data generation device, electronic device, and storage medium

By standardizing and sorting historical source spatiotemporal data, and generating real-time spatiotemporal data using a preset sending queue, the problem of the spatiotemporal data engine being unable to query in real time was solved, and efficient real-time query function testing was achieved.

CN114647673BActive Publication Date: 2026-02-17JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210313656.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2026-02-17
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

The existing spatiotemporal data engine cannot acquire data in real time, which makes it impossible to test its real-time query function, and the data content and sending efficiency are uncontrollable.

Method used

By unifying and sorting the historical source spatiotemporal data, real-time spatiotemporal data is generated using a preset sending queue, simulating real data transmission, providing a real-time and high-speed data stream for the spatiotemporal data engine, and enabling real-time query function testing.

Benefits of technology

The success rate of generating valid points and trajectories by the spatiotemporal data engine was improved, and the real-time query function of the spatiotemporal data engine was tested.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647673B_ABST
    Figure CN114647673B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data generation method, a data generation device, an electronic device and a storage medium, which are applied to the field of communication. The method comprises: receiving query information, the query information being input by a user in a space-time data engine; obtaining a plurality of historical source space-time data related to the query information; performing unified format processing on the plurality of historical source space-time data to obtain a plurality of first space-time data; sorting the plurality of first space-time data in time sequence; generating real-time space-time data according to the sorted plurality of first space-time data and a preset sending queue, the preset sending queue being used to start a sending process to send the real-time space-time data to the space-time data engine, the real-time space-time data being used to form a real-time track displayed in an interface corresponding to the space-time data engine. In this way, the historical source space-time data is processed and sorted to simulate and construct real-time data, thereby verifying the real-time query function of the space-time data engine.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, and in particular to a data generation method, a data generation apparatus, an electronic device and a storage medium. BACKGROUND

[0002] With the rapid development of global satellite navigation positioning system, sensor network and mobile Internet technologies, more and more terminal devices are connected to the network, thereby generating large-scale space-time location information such as vehicle trajectories, personal trajectories, group activities and wearable device space-time locations. A space-time data engine can record and process time and action trajectory data of people or vehicles, as well as urban geographic location information, to facilitate user access and use.

[0003] The space-time data engine is usually developed and tested based on past accumulated data and desensitized real data,

[0004] However, the time parameter of such data is long, and the data content and sending efficiency are uncontrollable, which cannot verify the real-time data simulation scenario, and thus cannot verify the real-time query function of the space-time data engine. SUMMARY

[0005] Embodiments of the present application provide a data generation method, a data generation apparatus, an electronic device and a storage medium. The historical source space-time data is uniformly formatted and sorted, and real data simulation is realized based on a preset sending queue. The sending process is started by the preset sending queue, real data simulation is realized, real-time and high-speed data flow is provided for the space-time data engine, the success rate of generating effective points and effective trajectories of the space-time data engine is high, and thus the real-time query function test of the space-time data engine is realized.

[0006] In a first aspect, the embodiments of the present application provide a data generation method, comprising: receiving query information, the query information being input by a user in a space-time data engine; obtaining a plurality of historical source space-time data related to the query information; uniformly formatting the plurality of historical source space-time data to obtain a plurality of first space-time data; sorting the plurality of first space-time data in chronological order; generating real-time space-time data according to the sorted plurality of first space-time data and a preset sending queue, the preset sending queue being used to start a sending process to send the real-time space-time data to the space-time data engine, the real-time space-time data being used to form a real-time trajectory displayed in a corresponding interface of the space-time data engine.

[0007] The format of the historical spatio-temporal data is unified, and the spatio-temporal data is sorted according to time, and the simulation of real data is realized based on a preset sending queue. The sending process is started to send, the simulation of real data is realized, and the real-time and high-speed data stream is provided for the spatio-temporal data engine, so that the spatio-temporal data engine generates effective points and effective trajectories. In this way, the real-time query function test of the spatio-temporal data engine is realized.

[0008] Optionally, the real-time spatio-temporal data is generated according to the sorted plurality of first spatio-temporal data and the preset sending queue, including: converting the plurality of sorted first spatio-temporal data into a plurality of object score json strings, the json string including extraction time, position coordinates and license plate number; selecting the json string in a preset time period, the start time of the preset time period being related to the query information; and generating the real-time spatio-temporal data according to the json string in the preset time period and the preset sending queue.

[0009] The json string is a lightweight data exchange format, which can facilitate the reading of the message queue (the preset sending queue) or the server.

[0010] Optionally, the method further includes: sending the real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue.

[0011] Optionally, the real-time spatio-temporal data is sent to the spatio-temporal data engine through the preset sending queue, including: when the number of real-time spatio-temporal data is greater than or equal to a first threshold, starting a plurality of sending processes to send the real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue; or when the number of real-time spatio-temporal data is less than the first threshold, starting a single sending process to send the real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue.

[0012] In this way, when the number of real-time spatio-temporal data is large, the sending speed and efficiency of the data are improved by using a plurality of sending processes.

[0013] Optionally, the method further includes: when the number of real-time spatio-temporal data is greater than or equal to the first threshold, and the number of real-time spatio-temporal data sent through the preset sending queue reaches a second threshold, sending the real-time spatio-temporal data to the spatio-temporal data engine after a period of time.

[0014] In this way, the congestion problem of the spatio-temporal data engine caused by excessive data can be reduced.

[0015] Optionally, when the number of real-time spatio-temporal data is less than the first threshold, the real-time spatio-temporal data is sent to the spatio-temporal data engine through the preset sending queue by starting a single sending process, including: when the number of real-time spatio-temporal data is less than the first threshold, modifying the time in the real-time spatio-temporal data and then starting a single sending process to send the modified real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue.

[0016] In this way, multiple data are generated, the dispersion degree of the data is reduced, and the case that the real-time space-time data correspond to too few vehicles is reduced.

[0017] Optionally, the multiple first space-time data are sorted in time sequence, including: segmenting the multiple first space-time data in days as a measurement unit; and sorting the segmented multiple first space-time data in time sequence.

[0018] After segmentation by day, the sorting speed is accelerated. In this way, the case that the multiple first space-time data have a large amount of data and result in long sorting time is reduced.

[0019] Optionally, the multiple historical source space-time data are processed in a unified format, including: performing unified format processing on time parameters in the multiple historical source space-time data to replace or delete redundant characters.

[0020] In a second aspect, an embodiment of the present application provides a space-time data engine, including: a communication unit and a processing unit.

[0021] The communication unit is configured to receive query information, the query information being input by a user in the space-time data engine; the communication unit is further configured to acquire multiple historical source space-time data related to the query information; the processing unit is configured to process the multiple historical source space-time data in a unified format to obtain multiple first space-time data; the processing unit is further configured to sort the multiple first space-time data in time sequence; and the processing unit is further configured to generate real-time space-time data according to the sorted multiple first space-time data and a preset sending queue, the preset sending queue being configured to start a sending process to send the real-time space-time data to the space-time data engine, and the real-time space-time data being configured to form a real-time track displayed in an interface corresponding to the space-time data engine.

[0022] Optionally, the processing unit is specifically configured to convert the sorted multiple first space-time data into multiple object score json strings, the json strings including extraction time, position coordinates, and a license plate number; and the processing unit is specifically configured to generate the real-time space-time data according to the json strings in a preset time period and the preset sending queue.

[0023] Optionally, the communication unit is further configured to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0024] Optionally, when the number of real-time space-time data is greater than or equal to a first threshold value, the communication unit is specifically configured to start multiple sending processes to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0025] When the number of real-time space-time data is less than the first threshold value, the communication unit is specifically configured to start a single sending process to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0026] Optionally, when the number of real-time spatio-temporal data is less than the first threshold, the communication unit is specifically configured to send the modified real-time spatio-temporal data to the spatio-temporal data engine by modifying the time in the real-time spatio-temporal data and starting a single sending process through a preset sending queue.

[0027] Optionally, the processing unit is specifically configured to segment the plurality of first spatio-temporal data in units of days; and the processing unit is specifically configured to sort the segmented plurality of first spatio-temporal data in chronological order.

[0028] Optionally, the processing unit is specifically configured to perform uniform format processing on the time parameters in the plurality of historical source spatio-temporal data to replace or delete redundant characters.

[0029] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor. The memory is configured to store program instructions; and the processor is configured to invoke and execute the program instructions in the memory to execute the method of any one of the above.

[0030] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, the method of any one of the above is implemented. BRIEF DESCRIPTION OF DRAWINGS

[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and serve to explain the principles of the embodiments of the present application together with the specification.

[0032] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;

[0033] Figure 2 A flowchart of a data generation method provided by an embodiment of the present application;

[0034] Figure 3 A structure diagram of a historical source spatio-temporal data in a possible implementation;

[0035] Figure 4 A structure diagram of a plurality of first spatio-temporal data provided by an embodiment of the present application;

[0036] Figure 5 A structure diagram of a first spatio-temporal data in a possible implementation;

[0037] Figure 6 A flowchart of a historical source spatio-temporal data processing method provided by an embodiment of the present application;

[0038] Figure 7 A flowchart of a sending selected data provided by an embodiment of the present application;

[0039] Figure 8 A structural schematic diagram of a space-time data engine is also provided for the embodiments of the present application.

[0040] Figure 9 A structural schematic diagram of an electronic device is provided for the embodiments of the present application.

[0041] The specific embodiments of the present application have been shown and described in the above drawings, and will be described in more detail hereinafter. These drawings and detailed description are not intended to limit the scope of the concept of the embodiments of the present application in any way, but to explain the concept of the embodiments of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0042] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to indicate the same or similar components. The embodiments described in the following exemplary embodiments are not meant to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0043] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms "first", "second", etc. are used to distinguish the same or similar items or items with basically the same function and role. For example, the first user interface and the second user interface are used to distinguish different response interfaces, and do not limit the order. Those skilled in the art can understand that the terms "first", "second", etc. do not limit the quantity and execution order, and the terms "first", "second", etc. do not necessarily mean different.

[0044] It should be noted that in the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of the words "exemplary" or "for example" is intended to present related concepts in a specific manner.

[0045] The space-time data engine is used to record and process time and action trajectory data of people or vehicles, and city geographical location information. Users can query the vehicle traffic conditions in a certain area at a certain time in the space-time data engine.

[0046] However, in the test of the space-time data engine, due to the privacy of space-time data, etc., the development and test are usually based on test data. The test data includes accumulated data and real data after desensitization.

[0047] In the test phase, the spatiotemporal data engine cannot acquire spatiotemporal data in real time, resulting in that the real-time query function of the spatiotemporal data engine cannot be tested.

[0048] Based on this, the embodiments of the present application provide a data generation method, a spatiotemporal data engine and a storage medium, comprising: receiving query information, the query information being input by a user in the spatiotemporal data engine; acquiring a plurality of historical source spatiotemporal data related to the query information; performing unified format processing on the plurality of historical source spatiotemporal data to obtain a plurality of first spatiotemporal data; sorting the plurality of first spatiotemporal data in time sequence; and sending the sorted plurality of first spatiotemporal data to a server through a sending queue, for the server to return the sorted plurality of first spatiotemporal data to the spatiotemporal data engine, so as to display a track formed by the sorted plurality of first spatiotemporal data in an interface corresponding to the spatiotemporal data engine. In this way, the historical source spatiotemporal data is processed and sorted to simulate real-time data, so as to test the real-time query of the spatiotemporal data engine.

[0049] An exemplary application scenario is shown in FIG. 1. Figure 1 An exemplary application scenario is shown in FIG. 1. Figure 1 As shown in FIG. 1, the application scenario includes a terminal B1, a terminal B2, a server C1 and a terminal D1. The terminal B1 and the terminal B2 both run a spatiotemporal data engine, which is used to display a human or vehicle action track according to query information of a user. The terminal D1 includes a data construction tool. The data construction tool is used to process historical source spatiotemporal data to generate real-time spatiotemporal data, and then simulate real-time data.

[0050] In the test of the spatiotemporal data engine, the terminal D1 acquires and processes a plurality of historical source spatiotemporal data, and sends the processed historical source spatiotemporal data to a message queue (a preset sending queue) of the server C1. The spatiotemporal data engine running on the terminal B1 and the spatiotemporal data engine running on the terminal B2 can both read the processed historical source spatiotemporal data from the message queue of the server C1, and display a track of a human or vehicle corresponding to the processed historical source spatiotemporal data.

[0051] Specifically, the terminal D1 can receive query information from the terminal B1 and the terminal B2, the query information being input by a user in the spatiotemporal data engine. The query information can include time, area, license plate number, etc. After receiving the query information from the terminal B1 and the terminal B2, the terminal D1 acquires a plurality of historical source spatiotemporal data related to the query information, and performs unified format processing and sorting in time sequence on the plurality of historical source spatiotemporal data. The terminal D1 sends the sorted plurality of spatiotemporal data to the server C1 through a sending queue. The terminal B1 and the terminal B2 acquire the sorted plurality of spatiotemporal data in the server C1, and then display a track formed by the sorted plurality of first spatiotemporal data in an interface corresponding to the spatiotemporal data engine of the terminal B1 and the terminal B2.

[0052] The terminal B1, the terminal B2 and the terminal D1 can be a mobile phone, a tablet computer, a smart watch, a smart bracelet, a smart earphone, smart glasses and other terminal devices with a display screen, and the embodiments of the present application are not limited thereto.

[0053] The following describes some terms related to the embodiments of the present application.

[0054] 1, Space-time data engine (Just): a big data system, the main function is to record and process the time and action trajectory data of people or vehicles, and the city geographical location information.

[0055] 2, Kafka: an open source message queue middleware, the sender (data construction tool) sends data to kafka, and the consumer (space-time data engine) reads corresponding data from kafka.

[0056] 3, Kafka cluster: multiple servers are interconnected using the cluster capability of kafka, which has higher performance and reliability than a single kafka.

[0057] 4, Multi-process: the program starts other processes to work to improve efficiency and achieve specific functions when running.

[0058] 5, Vehicle trajectory: the space-time data engine uses the stored vehicle position and time information, calculates and arranges it to send to the front end page, and the front end draws the vehicle trajectory of the vehicle on the map in the time period according to the information to provide for the user.

[0059] Figure 2 is a flowchart of a data generation method provided by the embodiments of the present application, as shown in Figure 2 The data generation method provided by the embodiments of the present application includes:

[0060] S201, receiving query information, the query information is input by a user in the space-time data engine.

[0061] Specifically, the data construction tool in the first terminal receives the query information, and the query information is input by a user in the space-time data engine in the second terminal.

[0062] In the embodiments of the present application, the query information can include time, area and license plate number.

[0063] In the embodiments of the present application, the space-time data engine (Just) is a big data system, which is used to record and process the time and action trajectory data of people or vehicles, and the city geographical location information.

[0064] The first terminal can be a terminal device with a communication function, and the terminal device can also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart television, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the first device.

[0065] The second terminal can be a terminal device with a display function, and the terminal device can also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart television, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the first device.

[0066] S202, acquire a plurality of historical source spatio-temporal data related to the query information.

[0067] Specifically, the data construction tool in the first terminal acquires a plurality of historical source spatio-temporal data related to the query information.

[0068] In a possible implementation, the plurality of historical source spatio-temporal data related to the query information is acquired from an external database, or the plurality of historical source spatio-temporal data related to the query information is collected from an external device.

[0069] S203, uniformly format processing the plurality of historical source spatio-temporal data to obtain a plurality of first spatio-temporal data.

[0070] Specifically, the data construction tool in the first terminal uniformly format processes the plurality of historical source spatio-temporal data to obtain a plurality of first spatio-temporal data.

[0071] It can be understood that the historical source spatio-temporal data is acquired from an external database or from a collection device, and the historical source spatio-temporal data may not be consistent in content. Therefore, the plurality of historical source spatio-temporal data needs to be uniformly format processed. In this way, the problem of data not being recognized due to format by the spatio-temporal data engine is reduced, and subsequent sorting and analysis processing of the historical source spatio-temporal data by the data construction tool is facilitated.

[0072] Exemplarily, Figure 3 A structural diagram of one historical source spatio-temporal data in a possible implementation. Figure 3 In the structural diagram, the historical source spatio-temporal data includes content that cannot be processed by the spatio-temporal data engine, such as a character "T" 301 and a character "000Z" 302. The character "T" 301 is in the middle of the day and hour in the data representing time, and the character "000Z" is at the end of the data representing time. The character "T" 301 and the character "000Z" 302 can cause the historical source spatio-temporal data to be unable to be processed in the spatio-temporal data engine, and further cause termination of the processing process.

[0073] In a possible implementation, when uniformly format processing the plurality of historical source spatio-temporal data, the redundant characters in the historical source spatio-temporal data are removed, or the redundant characters in the historical source spatio-temporal data are replaced with spaces.

[0074] Exemplarily, the time parameters in the plurality of historical source spatio-temporal data are uniformly format processed to replace or remove the redundant characters. Exemplarily, Figure 4 A structural diagram of the plurality of first spatio-temporal data provided by the embodiment of the application. Compared with Figure 3 In the structural diagram, Figure 4 In the first spatio-temporal data, the spaces replace the character "T" 301 and the character "000Z" 302. In this way, the non-recognition of the spatio-temporal data engine is reduced, and further subsequent processing of the spatio-temporal data engine is facilitated.

[0075] For example, the date format of the first spatio-temporal data is "%Y-%m-%d %H:%M:%S", i.e., "year-month-day hour:minute:second".

[0076] In a possible implementation, the shell script is used to perform the command sed-i to realize quick text replacement and unify the data format.

[0077] S204, sort the plurality of first spatio-temporal data in time sequence.

[0078] Specifically, the data construction tool in the first terminal sorts the plurality of first spatio-temporal data in time sequence.

[0079] It can be understood that the plurality of historical source spatio-temporal data can also have the problem of disordered data. The trajectory data is strongly related to time, and if the data is sent in disorder, different time points can be mixed and cannot reproduce the trajectory completely. Therefore, sorting the plurality of first spatio-temporal data in time sequence can facilitate the processing of the spatio-temporal data engine and improve the success rate of effective points and effective trajectories.

[0080] For example, Figure 5 FIG. 1 shows a structure of a first spatio-temporal data in a possible implementation. Figure 5 The historical source spatio-temporal data can have the problem of disordered data. The historical source spatio-temporal data from September 1 to September 5 is distributed in disorder. In this way, the spatio-temporal data engine can not be able to generate the vehicle trajectory according to Figure 5 FIG. 2 shows the first spatio-temporal data generating the vehicle trajectory.

[0081] Considering that the data amount of the plurality of first spatio-temporal data can be large, which can result in long sorting time, the spatio-temporal data engine sorts the plurality of first spatio-temporal data in segments.

[0082] Specifically, the file segmentation and sorting can be completed by using a shell script, which is a Linux operating system filtering and outputting command tool "grep" and a sorting command tool "sort" to output the data of the same day in the file by day and sort the plurality of first spatio-temporal data in time.

[0083] For example, as shown in Figure 4 FIG. 3, Figure 4 the first spatio-temporal data on September 1 and the first spatio-temporal data on September 2 in the plurality of first spatio-temporal data are sorted separately. The first spatio-temporal data on September 1 is sorted in time.

[0084] S205, generate real-time spatio-temporal data according to the plurality of sorted first spatio-temporal data and a preset sending queue, the preset sending queue is used to start a sending process to send the real-time spatio-temporal data to the spatio-temporal data engine, and the real-time spatio-temporal data is used to form a real-time trajectory displayed in the interface corresponding to the spatio-temporal data engine.

[0085] Specifically, the data construction tool in the first terminal sends the sorted plurality of first space-time data to the space-time data engine through the preset sending queue, or the data construction tool in the first terminal sends the sorted plurality of first space-time data to the space-time data engine through the server and the preset sending queue.

[0086] In summary, the embodiment of the present application provides a data generation method. By unifying the format of historical source space-time data, sorting according to time, and implementing simulated real data based on a preset sending queue, the simulated real data is sent through a preset sending queue to start a sending process, which realizes simulated real data sending, provides real-time and high-speed data flow for the space-time data engine, and enables the space-time data engine to generate effective points and effective trajectories. In this way, real-time query function testing of the space-time data engine is realized.

[0087] Optionally, generating real-time space-time data according to the plurality of first space-time data and the preset sending queue comprises: converting the sorted plurality of first space-time data into a plurality of object score json strings, the json string including an extraction time, a position coordinate, and a license plate number; selecting a json string in a preset time period, a start time of the preset time period being related to the query information; and generating real-time space-time data according to the json string in the preset time period and the preset sending queue.

[0088] It can be understood that the sorted plurality of first space-time data is stored in the preset sending queue in a list manner. The json string is a lightweight data exchange format, which can facilitate reading of a message queue, a server, and a space-time data engine.

[0089] In the embodiment of the present application, the preset time period is an arbitrary time period, and the length of the preset time period can be 1 minute or 30 seconds. For example, when the query information is used to indicate a trajectory at a current time (for example, m hours and n minutes), the start time of the preset time period is the current time (for example, m hours and n minutes). In a possible implementation manner, the query information also carries information for indicating the length of the preset time period.

[0090] For example, when the start time of the preset time period is m hours and n minutes, and the length of the preset time period is 1 minute, the preset time period is m hours and n minutes-m hours and n+1 minute. The time in the json string in the range of m hours and n minutes-m hours and n+1 minute is real-time space-time data.

[0091] Optionally, the method further comprises: sending the real-time space-time data to the space-time data engine through the preset sending queue. In this way, the real-time space-time data is sent to the space-time data engine, so that the space-time data engine generates a real-time trajectory based on the real-time space-time data, thereby verifying a simulated real-time data scenario.

[0092] Optionally, the real-time space-time data is sent to the space-time data engine through the preset sending queue, including: when the number of real-time space-time data is greater than or equal to the first threshold, starting multiple sending processes to send the real-time space-time data to the space-time data engine through the preset sending queue; or, when the number of real-time space-time data is less than the first threshold, starting a single sending process to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0093] In this way, when the number of real-time space-time data is large, the data is sent through multiple sending processes, improving the sending speed of the data and improving the sending efficiency.

[0094] Optionally, the method further includes: when the number of real-time space-time data is greater than or equal to the first threshold, and the number of real-time space-time data sent through the preset sending queue reaches a second threshold, sending the real-time space-time data to the space-time data engine after a period of time.

[0095] In this way, the congestion problem of the space-time data engine caused by too much data can be reduced.

[0096] Optionally, when the number of real-time space-time data is less than the first threshold, starting a single sending process to send the real-time space-time data to the space-time data engine through the preset sending queue includes: when the number of real-time space-time data is less than the first threshold, modifying the time in the real-time space-time data and then starting a single sending process to send the modified real-time space-time data to the space-time data engine through the preset sending queue.

[0097] In this way, multiple data are generated, the dispersion degree of the data is reduced, and the case that the number of vehicles corresponding to the real-time space-time data is too small is reduced.

[0098] Optionally, the plurality of first space-time data is sorted in chronological order, including: segmenting the plurality of first space-time data by day; and sorting the segmented plurality of first space-time data in chronological order.

[0099] After segmentation by day, the sorting speed is accelerated. In this way, the case that the plurality of first space-time data has a large amount of data and causes a long sorting time is reduced.

[0100] Optionally, the plurality of historical source space-time data is processed in a unified format, including: performing unified format processing on the time parameters in the plurality of historical source space-time data to replace or delete redundant characters.

[0101] In this way, the subsequent reading, sorting, and format conversion of the data can be facilitated. In a possible implementation, the time data in the plurality of historical source space-time data is uniformly processed into the format of year-month-day hour: minute: second.

[0102] Exemplarily, Figure 6A flowchart of a historical source spatio-temporal data processing method provided by an embodiment of the present application. The spatio-temporal data construction tool can send data in real time, and the sending process includes data preprocessing, data extraction, and data sending. The data preprocessing process includes S601-S603. The data extraction process includes S604. The data sending process includes S605.

[0103] As shown in Figure 6 The historical source spatio-temporal data processing method includes the following steps.

[0104] S601, data acquisition.

[0105] The data construction tool in the terminal device acquires historical source spatio-temporal data from a database.

[0106] S602, data formatting.

[0107] Specifically, the format of the historical source spatio-temporal data is unified.

[0108] In a possible implementation manner, a shell script is used to execute the sed-i command to perform quick text replacement, thereby realizing format unification.

[0109] In a possible implementation manner, the grep command and the sort command are used to separate and output the data of the same day in the historical source spatio-temporal data after format unification and sort the data by time.

[0110] S603, data content modification.

[0111] Specifically, the sorted historical source spatio-temporal data is converted into a json string.

[0112] It can be understood that the sorted historical source spatio-temporal data is stored in a list (a data table). The data table stored in the spatio-temporal data engine has multiple parameters, among which the record time, the generation time, the point information, and the license plate number are important information for the test data.

[0113] The data construction tool initializes the sorted historical source spatio-temporal data into a json string, the key of the json string corresponds to the field of the data table one by one, the time, the location coordinate, and the license plate number taken from the data file are filled into the corresponding values, and then the preset sending queue is added.

[0114] S604, data selection according to sending parameters.

[0115] For example, if the statistical analysis of the original data can obtain the following two conclusions. The first conclusion: the data volume of each hour in the working hours (08:00-19:00) is generally in the same order, between 46000-48000. The second conclusion: the data is unevenly distributed in each minute of the hour, with a maximum of about 1300-1400, and a minimum of about 200-300. Therefore, the maximum value of the data per minute is about 1400.

[0116] The data selection time interval in the sending parameter (the length of the preset time period) can be one minute. The threshold value in the sending parameter can be 5 seconds. The selected data is, starting from the queue, querying the data, when the record time of the data is less than 5 seconds from the current time, recording the position x of the current data, and then retrieving the data within 60 seconds from x, recording the stop position y, and sending the data in the interval (x, y). The length of the preset time period and other sending parameters in the embodiments of the application are not specifically limited.

[0117] S605, sending the selected data.

[0118] When the number of selected data is large, the selected data is divided into three parts, and three sending processes are started.

[0119] For example, Figure 7 A flowchart for sending selected data is provided in the embodiments of the application. As Figure 7 shown, when the number of real-time spatio-temporal data (selected data) in the preset sending queue is large, the real-time spatio-temporal data (selected data) is divided into three sub-queues (sub-queue 1, sub-queue 2 and sub-queue 3) and sent to the spatio-temporal data engine through the cluster of kafka.

[0120] According to another aspect of the embodiments of the application, the embodiments of the application also provide a spatio-temporal data engine, as Figure 8 shown, comprising a communication unit 11 and a processing unit 21.

[0121] The communication unit 11 is configured to receive query information, which is input by a user in the spatio-temporal data engine; the communication unit 11 is also configured to obtain a plurality of historical source spatio-temporal data related to the query information; the processing unit 21 is configured to perform unified format processing on the plurality of historical source spatio-temporal data to obtain a plurality of first spatio-temporal data; the processing unit 21 is also configured to sort the plurality of first spatio-temporal data in time sequence; the processing unit 21 is also configured to generate real-time spatio-temporal data according to the sorted plurality of first spatio-temporal data and a preset sending queue, the preset sending queue is configured to start a sending process to send the real-time spatio-temporal data to the spatio-temporal data engine, and the real-time spatio-temporal data is configured to form a real-time trajectory displayed in the interface corresponding to the spatio-temporal data engine.

[0122] Optionally, the processing unit 21 is specifically configured to convert the sorted plurality of first space-time data into a plurality of object score JSON strings, the JSON strings including extraction time, position coordinates and license plate number; and the processing unit 21 is specifically configured to generate real-time space-time data according to the JSON strings in a preset time period and a preset sending queue.

[0123] Optionally, the communication unit 11 is further configured to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0124] Optionally, when the number of real-time space-time data is greater than or equal to a first threshold value, the communication unit 11 is specifically configured to start a plurality of sending processes to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0125] When the number of real-time space-time data is less than the first threshold value, the communication unit 11 is specifically configured to start a single sending process to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0126] Optionally, when the number of real-time space-time data is less than the first threshold value, the communication unit 11 is specifically configured to start a single sending process to send the real-time space-time data to the space-time data engine through the preset sending queue.

[0127] Optionally, the processing unit 21 is specifically configured to divide the plurality of first space-time data by day as a unit of measurement; and the processing unit 21 is specifically configured to sort the divided plurality of first space-time data in chronological order.

[0128] Optionally, the processing unit 11 is specifically configured to perform uniform format processing on the time parameters in the plurality of historical source space-time data to replace or delete redundant characters.

[0129] The data generation device of the embodiment can be used to execute the method of any of the above embodiments, and has similar implementation principles and technical effects, which will not be described here.

[0130] According to another aspect of the embodiments of the present application, the embodiments of the present application further provide a mobile terminal, which comprises the device of any of the above embodiments.

[0131] According to another aspect of the embodiments of the present application, the embodiments of the present application further provide an electronic device, which comprises a memory and a processor.

[0132] The memory is configured to store the memory of the processor executable instructions;

[0133] When the instructions in the memory are executed, the processor is configured to implement the method of any of the above embodiments.

[0134] Please refer to Figure 9 ,Figure 9 FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present application.

[0135] As shown in FIG. 1, the electronic device includes a processor 131 and a memory 132. Figure 9

[0136] The processor 131 executes computer-executed instructions stored in the memory, so that the processor 131 performs the solutions in the above embodiments.

[0137] The processor 131 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by integrated logic circuits or instructions in the form of software in the processor. The processor described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The steps of the method applied in combination with the embodiments of the present application can be directly embodied as a hardware coding processor for execution, or be executed in combination with a hardware and software module in the coding processor. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method.

[0138] The memory 132 stores computer-executed instructions, and can include a random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory. Optionally, the device can further include a system bus 133, and the memory 132 can be connected with the processor 131 through the system bus 133 and complete communication between each other, and can use the Internet, a wide area network, a local area network, a metropolitan area network, etc.

[0139] ​The system bus 133 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0140] For example, the electronic device includes a terminal device, which can also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart television, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. Embodiments of the present application do not limit the specific technology and specific device form of the terminal device.

[0141] According to another aspect of the embodiments of the present application, the embodiments of the present application further provide a computer readable storage medium, the computer readable storage medium storing computer execution instructions, the computer execution instructions being executed by a processor to implement the method of any of the above embodiments.

[0142] It should be understood by the reader that the use of the terms "an embodiment" or "embodiments", "an example" or "examples", "a specific example" or "specific examples", or "some examples" in the description above, is intended to convey that the particular feature, structure, or characteristic described is included in at least one embodiment or example of the present application. The appearance of the above terms in various places in the description are not necessarily all referring to the same embodiment or example. Also, the description is not intended to limit the application to the described embodiments or examples. Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described apparatus and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

[0144] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are merely schematic, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0145] The unit described as a separate component can or can not be physically separated, and the component displayed as a unit can or can not be a physical unit, that is, it can be located in one place, or it can be distributed to a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiments of the present application.

[0146] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0147] If the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned computer readable medium can include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is targeted at carrying or storing desired program codes in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately called a computer readable medium. For example, if software is transmitted from a website, server or other remote source using a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of the medium. As used herein, magnetic disks and optical disks include compact disks, laser disks, optical disks, digital versatile disks (DVDs), floppy disks and Blu-ray disks, wherein magnetic disks usually magnetically reproduce data, and optical disks optically reproduce data with laser. The above combinations should also be included in the scope of the computer readable medium.

[0148] It should also be understood that the size of the sequence number of the above-mentioned processes in the embodiments of the present application does not mean the order of execution, and the execution order of the processes should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0149] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any skilled person in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data generating method characterized by comprising: Applied to a first terminal comprising a data construction tool, the method comprises: receiving query information, the query information being input by a user in a spatio-temporal data engine; obtaining a plurality of historical source spatio-temporal data related to the query information from an external database; performing unified format processing on the plurality of historical source spatio-temporal data to obtain a plurality of first spatio-temporal data; sorting the plurality of first spatio-temporal data in chronological order; generating real-time spatio-temporal data according to the sorted plurality of first spatio-temporal data and a preset sending queue, the preset sending queue being used to start a sending process to send the real-time spatio-temporal data to the spatio-temporal data engine to simulate real data sending, provide data flow for the spatio-temporal data engine, and test real-time query functions of the spatio-temporal data engine, the real-time spatio-temporal data being used to form real-time trajectories displayed in an interface corresponding to the spatio-temporal data engine.

2. The method of claim 1, wherein, The generating real-time spatio-temporal data according to the sorted plurality of first spatio-temporal data and the preset sending queue comprises: converting the sorted plurality of first spatio-temporal data into a plurality of object score json strings, the json strings including extraction time, position coordinates, and license plate numbers; selecting the json strings in a preset time period, a start time of the preset time period being related to the query information; generating real-time spatio-temporal data according to the json strings in the preset time period and the preset sending queue.

3. The method of claim 2, wherein, The method further comprises: sending the real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue.

4. The method of claim 3, wherein, The sending the real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue comprises: when the number of real-time spatio-temporal data is greater than or equal to a first threshold, starting a plurality of sending processes through the preset sending queue to send the real-time spatio-temporal data to the spatio-temporal data engine; or, when the number of real-time spatio-temporal data is less than the first threshold, starting a single sending process through the preset sending queue to send the real-time spatio-temporal data to the spatio-temporal data engine.

5. The method of claim 4, wherein, Further comprising: when the number of real-time spatio-temporal data is greater than or equal to the first threshold, and the number of real-time spatio-temporal data sent through the preset sending queue reaches a second threshold, sending the real-time spatio-temporal data to the spatio-temporal data engine after a period of time.

6. The method of claim 4, wherein, The sending the real-time spatio-temporal data to the spatio-temporal data engine through the preset sending queue when the number of real-time spatio-temporal data is less than the first threshold comprises: when the number of real-time spatio-temporal data is less than the first threshold, modifying the time in the real-time spatio-temporal data and then starting a single sending process through the preset sending queue to send the modified real-time spatio-temporal data to the spatio-temporal data engine.

7. The method according to any one of claims 1 to 6, characterized in that, The sorting the plurality of first spatio-temporal data in chronological order comprises: segmenting the plurality of first spatio-temporal data by day; sorting the segmented plurality of first spatio-temporal data in chronological order.

8. The method according to any one of claims 1 to 6, characterized in that, The performing unified format processing on the plurality of historical source spatio-temporal data comprises: performing unified format processing on time parameters in the plurality of historical source spatio-temporal data to replace or delete redundant characters.

9. A data generating apparatus characterized by comprising: Set in a first terminal comprising a data construction tool, comprising: a communication unit for receiving query information, the query information being input by a user in a space-time data engine; the communication unit is also used to obtain a plurality of historical source space-time data related to the query information from an external database; a processing unit for uniformly formatting the plurality of historical source space-time data to obtain a plurality of first space-time data; the processing unit is also used to sort the plurality of first space-time data in time sequence; the processing unit is also used to generate real-time space-time data according to the sorted plurality of first space-time data and a preset sending queue, the preset sending queue is used to start a sending process to send the real-time space-time data to the space-time data engine to simulate real data sending, provide data flow for the space-time data engine, test the real-time query function of the space-time data engine, and the real-time space-time data is used to form a real-time track displayed in the interface corresponding to the space-time data engine.

10. An electronic device, comprising: comprising: a memory for storing program instructions; a processor for calling and executing the program instructions in the memory, executing the method of any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to realize the method of any one of claims 1-8.

Citation Information

Patent Citations

  • APP pushing method and engine system

    CN107609086A

  • Spatio-temporal big data trajectory analysis platform, method, server and storage medium

    CN109376178A