A method and system for displaying real-time location of personnel from multiple data sources
By collecting, processing and integrating the real-time location data of terminal devices, the problem of different terminal devices being unable to display simultaneously is solved, and the unified display and redundancy removal of the real-time locations of people from multiple data sources are achieved, which improves the system's response speed and user experience.
Patent Information
- Application Number
- CN202211703956.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-12-28
AI Technical Summary
The existing technology cannot simultaneously display the real-time location information of multiple terminal devices held by different types of people in one function, and there is a problem of redundant display.
By collecting real-time location data from multiple terminal devices, adding data source identification, using message queues for asynchronous processing, performing data fusion, outputting unified data formats, and obtaining accurate real-time locations based on pre-configured strategies, the real-time location of personnel from multiple data sources can be displayed in one function.
It realizes the simultaneous display of the real-time location of personnel from multiple data sources, eliminates redundancy, improves the scalability and response speed of the system, and facilitates user viewing.
Smart Images

Figure CN115982301B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of real-time positioning technology, and mainly to a method and system for displaying the real-time location of personnel from multiple data sources. Background Art
[0002] Relevant industries use the terminal devices held by personnel to collect and report the location information of personnel, thereby realizing the display of personnel's real-time location. Terminal devices include handheld intercoms, law enforcement recorders, mobile terminals, vehicle-mounted stations, vehicle-mounted control balls, etc. Currently, there are many types of personnel in relevant departments, and different types of personnel hold different terminal devices, or one person holds multiple terminal devices. Since each terminal device is an independent location reporting system, customers cannot view personnel location information in one function. Even if the real-time location information of personnel from multiple terminal devices can be displayed in one function, redundancy cannot be eliminated for the case where the same person holds different terminal devices, and multiple real-time locations may be displayed. The data display is not flexible and friendly enough. Therefore, designing a method or system that can collect location information from multiple terminal devices and eliminate redundancy has become an urgent problem to be solved. Summary of the Invention
[0003] In response to the above technical problems in the prior art, the inventors have proposed a method and system for displaying the real-time location of personnel based on multiple data sources.
[0004] According to one aspect of the present invention, a method for displaying the real-time location of a person from multiple data sources is proposed, comprising the following steps:
[0005] S1: Collect real-time location data corresponding to multiple terminal devices and add a data source identifier to each real-time location data;
[0006] S2: Write some real-time location data into the message queue;
[0007] S3: Reads several real-time location data in the message queue, processes the data according to the data source identifier of each real-time location data, and outputs the data in a unified format;
[0008] S4: Data fusion is performed on multiple real-time location data collected by multiple terminal devices held by the same person, and the accurate real-time location of the person is obtained according to the pre-configured strategy;
[0009] S5: The real-time location data after data processing and data fusion is stored in the database, and the real-time location of personnel from multiple data sources is displayed as needed.
[0010] The message queue is used to isolate data collection and data processing logic, decouple the system, asynchronously process data in the channel, control traffic peaks, match collection programs and data processing programs of different speeds, and improve the response of the collection program. Asynchronous processing avoids problems such as slow response speed and large number of failures caused by large data processing volume, improves the scalability of the system, and processes data to output multiple real-time location data in a unified data format. When a person holds multiple terminal devices, data redundancy is removed through data fusion, and finally the real-time location of people from multiple data sources is displayed simultaneously, which is convenient for users to view.
[0011] Preferably, in S1, a number of real-time location data are collected through a number of terminal devices, specifically including a data-driven method or a task-driven method, the data-driven method is a database binlog method or a database notify method or a socket method, and the task-driven method is an incremental SQL query method or an http current location query method.
[0012] The data-driven approach is based on a process of information entry, display, and query. There is no complex data business logic processing, so it is highly practical and fast to implement. The task-driven approach does not require modifying the source database and is more flexible to use.
[0013] Preferably, the database binlog mode is specifically as follows: opening the binlog function of the MySQL database, using canal to subscribe to the binlog of the MySQL database, simulating the master-slave mode of the database, and collecting real-time changes of the database.
[0014] The database binlog method uses a mature data collection method and can achieve real-time collection of trajectory data without custom code.
[0015] Preferably, the database notification method is specifically:
[0016] S100: Write a function in the PostgreSQL database to convert a row of data in the data table into JSON and then send it to the database's notify message queue;
[0017] S101: Create a trigger on the trace table of the source database. When data is added or modified, a function is called to send a notify message.
[0018] S102: Write Java code to subscribe to the database's notify and then loop to listen for messages;
[0019] S103: Process the message and forward the message queue to realize real-time data collection.
[0020] The database notify method uses the database's built-in message mechanism to monitor data changes in real time. Only a small amount of customized code is required to achieve real-time data collection.
[0021] Preferably, the socket method includes:
[0022] Use the TCP or UDP port of the socket to listen, connect to the data system of other manufacturers, directly push or forward the location information to the collection program, parse the trajectory data according to the protocol, encapsulate it into JSON format, and then put the data into the message queue.
[0023] Socket is used for data collection. The data source does not have a database scenario, and private label data can be dynamically parsed.
[0024] Preferably, the incremental SQL query method is specifically as follows:
[0025] S110: Automatically specify an executor based on the database type, and query the database incremental data based on the incremental field and the last execution record by concatenating the query SQL;
[0026] S111: Record the last query location of the data for use in the next query of incremental data;
[0027] S112: Encapsulate the queried data into JSON format and then put the data into the message queue.
[0028] The incremental SQL query method is flexible in customization and supports multiple databases such as MySQL, Oracle, SQL Server, and Mongo. It only requires data query permissions and does not require modification of the source database.
[0029] Preferably, the http current location query method is specifically:
[0030] S120: Regularly query and capture the latest coordinate data or trajectory data of the most recent period;
[0031] S121: Remove useless configurations such as status codes from the queried data according to the configuration, extract only the data part, encapsulate it into JSON format and put it into the message queue.
[0032] The HTTP current location query method uses the splicing HTTP request query data interface method, supports post and get request methods, supports message header and parameter customization, does not require access to the database, and is faster.
[0033] Preferably, in S2, the message queue is a Kafka message queue.
[0034] Kafka is a high-throughput distributed publish-subscribe messaging system message queue that supports multiple producers and consumers. It has better performance, reliability, and scalability and can easily handle huge message streams.
[0035] Preferably, in S3, the specific manner of performing data processing according to the data source identifier of each real-time location data is:
[0036] By identifying the data source and matching it with pre-defined configuration files, the real-time location data fields are parsed and formatted into a unified output data format and field name. This data processing ensures that multiple real-time location data from different terminal devices are in a unified format and can be distinguished by different field names, allowing them to be displayed simultaneously on a single function.
[0037] Preferably, in S4, multiple real-time location data collected by multiple terminal devices held by the same person are fused to obtain the accurate real-time location of the person according to a pre-configured strategy, specifically in the following manner:
[0038] S41: Create a personnel and terminal equipment association table;
[0039] S42: Update the latest real-time location data of the terminal device in the association table;
[0040] S43: Pre-configure the strategy. Based on the pre-configured strategy, fuse the real-time location data from multiple terminal devices of the same person to obtain the accurate real-time location of the person.
[0041] Preferably, in S4, the pre-configured strategy is:
[0042] Identify the update time of the last real-time location data of multiple terminal devices, and use the most recently updated real-time location data among multiple devices as the person's accurate real-time location.
[0043] The advantage of this strategy is that it is simple and fast to calculate, and it directly uses the real-time location of the last updated terminal device as the accurate real-time location of the person, which is easy to implement.
[0044] Preferably, in S4, the pre-configured strategy is:
[0045] Set different priorities for a person's multiple terminal devices. If a high-priority device has a track within 10 minutes, the person's real-time location is updated to the last location of the high-priority device. Otherwise, the person's real-time location is updated to the last location of the second-priority device within 10 minutes.
[0046] The advantage of this strategy is that the personnel position is stable, the last position of the same equipment can be guaranteed, and it is not easy to cause trajectory jumps and position errors.
[0047] In a second aspect, the present application proposes a computer system of an electronic device, comprising one or more components, which, when operating, implement the method described in the first aspect of the present application.
[0048] In a third aspect, the present application further proposes a computer-readable storage medium on which one or more computer programs are stored, characterized in that when the one or more computer programs are executed by a computer processor, the method described in the first aspect of the present application is implemented.
[0049] Fourthly, the present application also proposes a real-time location display system for personnel with multiple data sources, comprising:
[0050] Data collection module: used to collect multiple real-time location data from multiple terminal devices and add data source identification to each real-time location data; message queue module: transmits the collected real-time location data to the message queue, which is used to asynchronously process the real-time location data, control traffic peaks, match data collection modules and data processing modules of different speeds, and improve the response of the data collection module;
[0051] Data processing module: reads several real-time location data in the message queue, processes the data according to the data source identifier of each real-time location data, and outputs it in a unified data format;
[0052] Policy module: used to pre-configure policies for situations where the same person holds multiple terminal devices;
[0053] Data fusion module: This module fuses multiple real-time location data from various terminal devices held by a person and obtains the person's accurate real-time location according to pre-configured strategies;
[0054] Real-time location display module: stores the processed and integrated real-time location data into the database and displays it centrally in the same function.
[0055] The present application provides a method for displaying the real-time location of a person from multiple data sources, which collects multiple real-time location data from multiple terminal devices, writes the collected real-time location data into a message queue, reads the data in the message queue for data processing, and finally outputs it in a unified data format. At the same time, for the situation where a person holds multiple terminal devices, multiple real-time location data are fused according to a pre-configured strategy to obtain the person's accurate real-time location, and the processed and fused real-time location data is stored in a database, thereby realizing the simultaneous display of the real-time locations of people from multiple data sources and eliminating the redundancy of the real-time location of the same person, making it convenient for users to view. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and, together with the description, serve to explain the principles of the present invention. Other embodiments and many of the expected advantages of the embodiments will be readily apparent as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with respect to each other. Like reference numerals designate corresponding similar parts.
[0057] Figure 1 A flowchart of a method for displaying the real-time location of personnel from multiple data sources is shown in the present application;
[0058] Figure 2 A flowchart showing the fusion of multiple real-time location data of the same person in a method for displaying the real-time location of a person from multiple data sources of the present application is shown;
[0059] Figure 3a A schematic structural diagram of a computer system 600 of an electronic device according to an embodiment of the present invention is shown;
[0060] Figure 3b A schematic structural diagram of a system 700 for displaying real-time personnel locations from multiple data sources according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0061] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.
[0062] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0063] Figure 1 A flowchart of a method for displaying the real-time location of personnel from multiple data sources is shown in the present application. Figure 1 As shown, the following steps are included:
[0064] S1: Collect real-time location data corresponding to multiple terminal devices and add a data source identifier to each real-time location data;
[0065] S2: Write some real-time location data into the message queue;
[0066] S3: Reads several real-time location data in the message queue, processes the data according to the data source identifier of each real-time location data, and outputs the data in a unified format;
[0067] S4: Data fusion is performed on multiple real-time location data collected by multiple terminal devices held by the same person, and the accurate real-time location of the person is obtained according to the pre-configured strategy;
[0068] S5: The real-time location data after data processing and data fusion is stored in the database, and the real-time location of personnel from multiple data sources is displayed as needed.
[0069] The message queue is used to isolate data collection and data processing logic, decouple the system, asynchronously process data in the channel, control traffic peaks, match collection programs and data processing programs of different speeds, and improve the response of the collection program. Asynchronous processing avoids problems such as slow response speed and large number of failures caused by large data processing volume, improves the scalability of the system, and processes data to output multiple real-time location data in a unified data format. When a person holds multiple terminal devices, data redundancy is removed through data fusion, and finally the real-time location of people from multiple data sources is displayed simultaneously, which is convenient for users to view.
[0070] Preferably, in S1, a number of real-time location data are collected through a number of terminal devices, specifically including a data-driven method or a task-driven method, the data-driven method is a database binlog method or a database notify method or a socket method, and the task-driven method is an incremental SQL query method or an http current location query method.
[0071] The data-driven approach is based on a process of information entry, display, and query. There is no complex data business logic processing, so it is highly practical and fast to implement. The task-driven approach does not require modifying the source database and is more flexible to use.
[0072] Preferably, the database binlog mode is specifically as follows: opening the binlog function of the MySQL database, using canal to subscribe to the binlog of the MySQL database, simulating the master-slave mode of the database, and collecting real-time changes of the database.
[0073] First, enable the binlog function of the MySQL database. To do this, modify the my.cnf file on the database server and add log-bin = mysql-bin. Restart the database and enter the command to check that binlog is enabled. Second, create an account for data synchronization. This simulates Canal as a MySQL slave. Third, modify Canal's instance.properties file to configure the database and user to be collected. Modify Canal's canal.properties file to specify the outbound destination of the collected data as the Kafka message queue. Finally, enable Canal and use it to subscribe to the MySQL database's binlog to collect real-time changes to the database.
[0074] The database binlog method uses a mature data collection method and can achieve real-time collection of trajectory data without custom code.
[0075] Preferably, the database notification method is specifically:
[0076] S100: Write a function in the PostgreSQL database to convert a row of data in the data table into JSON and then send it to the database's notify message queue;
[0077] S101: Create a trigger on the trace table of the source database. When data is added or modified, a function is called to send a notify message.
[0078] S102: Write Java code to subscribe to the database's notify and then loop to listen for messages;
[0079] S103: Process the message and forward the message queue to realize real-time data collection.
[0080] The database notify method uses the database's built-in message mechanism to monitor data changes in real time. Only a small amount of customized code is required to achieve real-time data collection.
[0081] Preferably, the socket method includes:
[0082] Use the TCP or UDP port of the socket to listen, connect to the data system of other manufacturers, directly push or forward the location information to the collection program, parse the trajectory data according to the protocol, encapsulate it into JSON format, and then put the data into the message queue.
[0083] Socket is used for data collection. The data source does not have a database scenario, and private label data can be dynamically parsed.
[0084] Preferably, the incremental SQL query method is specifically as follows:
[0085] S110: Automatically specify an executor based on the database type, and query the database incremental data based on the incremental field and the last execution record by concatenating the query SQL;
[0086] S111: Record the last query location of the data for use in the next query of incremental data;
[0087] S112: Encapsulate the queried data into JSON format and then put the data into the message queue.
[0088] The incremental SQL query method is flexible in customization and supports multiple databases such as MySQL, Oracle, SQL Server, and Mongo. It only requires data query permissions and does not require modification of the source database.
[0089] Preferably, the http current location query method is specifically:
[0090] S120: Regularly query and capture the latest coordinate data or trajectory data of the most recent period;
[0091] S121: Remove useless configurations such as status codes from the queried data according to the configuration, extract only the data part, encapsulate it into JSON format and put it into the message queue.
[0092] The HTTP current location query method uses the splicing HTTP request query data interface method, supports post and get request methods, supports message header and parameter customization, does not require access to the database, and is faster.
[0093] Preferably, in S2, the message queue is a Kafka message queue.
[0094] Kafka is a high-throughput distributed publish-subscribe messaging system message queue that supports multiple producers and consumers. It has better performance, reliability, and scalability and can easily handle huge message streams.
[0095] Preferably, in S3, the specific manner of performing data processing according to the data source identifier of each real-time location data is:
[0096] By identifying the data source and matching it with pre-defined configuration files, the real-time location data fields are parsed and formatted into a unified output data format and field name. This data processing ensures that multiple real-time location data from different terminal devices are in a unified format and can be distinguished by different field names, allowing them to be displayed simultaneously on a single function.
[0097] Figure 2The flowchart of the method for displaying the real-time location of a person from multiple data sources of the present invention is shown as follows: Figure 2 As shown, in S4, multiple real-time location data collected by multiple terminal devices held by the same person are fused to obtain the accurate real-time location of the person according to the pre-configured strategy, specifically in the following manner:
[0098] S41: Create a personnel and terminal equipment association table;
[0099] S42: Update the latest real-time location data of the terminal device in the association table;
[0100] S43: Pre-configure the strategy. Based on the pre-configured strategy, fuse the real-time location data from multiple terminal devices of the same person to obtain the accurate real-time location of the person.
[0101] Preferably, in S4, the pre-configured strategy is:
[0102] Identify the update time of the last real-time location data of multiple terminal devices, and use the most recently updated real-time location data among multiple devices as the person's accurate real-time location.
[0103] The advantage of this strategy is that it is simple and fast to calculate, and it directly uses the real-time location of the last updated terminal device as the accurate real-time location of the person, which is easy to implement.
[0104] Preferably, in S4, the pre-configured strategy is:
[0105] Set different priorities for a person's multiple terminal devices. If a high-priority device has a track within 10 minutes, the person's real-time location is updated to the last location of the high-priority device. Otherwise, the person's real-time location is updated to the last location of the second-priority device within 10 minutes.
[0106] The advantage of this strategy is that the personnel position is stable, the last position of the same equipment can be guaranteed, and it is not easy to cause trajectory jumps and position errors.
[0107] Reference below Figure 3a , which shows a structural diagram of a computer system 600 suitable for implementing an electronic device of an embodiment of the present application. Figure 3a The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0108] like Figure 3aAs shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the system 600 are also stored in the RAM 603. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0109] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, and the like; an output section 606 including a liquid crystal display (LCD) and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card or a modem. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 610 as needed, so that a computer program read therefrom can be installed in the storage section 608 as needed.
[0110] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the computer-readable storage medium described in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0111] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0112] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0113] The modules involved in the embodiments described in this application may be implemented in software or hardware. The units described may also be provided in a processor, and the names of these units do not, in certain circumstances, constitute limitations on the units themselves.
[0114] Embodiments of the present invention also relate to a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer processor, implements the method described above. The computer program includes program code for executing the method shown in the flowchart. It should be noted that the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable medium, or any combination thereof.
[0115] Figure 3b FIG. 7 shows a schematic diagram of a real-time location display system 700 for personnel with multiple data sources according to an embodiment of the present application. Figure 3b As shown, it includes a data acquisition module 701, a message queue module 702, a data processing module 703, a strategy module 704, a data fusion module 705 and a real-time location display module 706, specifically:
[0116] Data collection module 701: used to collect a number of real-time location data from a number of terminal devices, and add a data source identifier to each real-time location data;
[0117] Message queue module 702: transmits the collected real-time location data to the message queue for asynchronous processing of the real-time location data, controls traffic peaks, matches data collection modules and data processing modules of different speeds, and improves the response to the data collection module;
[0118] Data processing module 703: reads a number of real-time location data in the message queue, processes the data according to the data source identifier of each real-time location data, and outputs the data in a unified data format;
[0119] Policy module 704: used to pre-configure policies for the case where the same person holds multiple terminal devices;
[0120] Data fusion module 705: performs data fusion on multiple real-time location data from multiple terminal devices held by a person, and obtains the person's accurate real-time location according to a pre-configured strategy;
[0121] Real-time location display module 706: stores the processed and fused real-time location data into the database and displays it in the same function.
[0122] The present application discloses a method for displaying the real-time location of a person from multiple data sources. The method collects multiple real-time location data through multiple terminal devices, adds data source identifiers, writes the real-time location data into a message queue, reads the real-time location data from the message queue for processing, matches a pre-defined configuration file through the data source identifier, parses the real-time location data field and formats it into a unified output data format and field name, fuses the real-time location data from multiple terminal devices of the same person, thereby obtaining the person's accurate real-time location, and finally stores the real-time location data in the same database. At the same time, the real-time location data from different terminal devices are simultaneously displayed, making the display of the real-time location more intuitive and convenient for users to view. The method for displaying the real-time location of a person from multiple data sources disclosed by the present invention solves the problem that different types of people hold different terminal devices and cannot be displayed simultaneously. At the same time, for the situation where the same person holds multiple real-time location data output by multiple terminal devices, the multiple real-time location data are fused to obtain the person's accurate real-time location.
[0123] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A method for displaying real-time location of personnel from multiple data sources, characterized in that: The following steps are involved: S1: Collect real-time location data corresponding to multiple terminal devices and add a data source identifier to each real-time location data; The data collection method for collecting multiple real-time location data through multiple terminal devices is a data-driven method or a task-driven method. The data-driven method is a database binlog method, a database notify method, or a socket method. The task-driven method is an incremental SQL query method or an HTTP current location query method. S2: Write some real-time location data into the message queue; S3: Reads several real-time location data in the message queue, processes the data according to the data source identifier of each real-time location data, and outputs the data in a unified format; S4: Data fusion is performed on multiple real-time location data collected by multiple terminal devices held by the same person, and the accurate real-time location of the person is obtained according to the pre-configured strategy; The specific method is: S41: Create a personnel and terminal equipment association table; S42: Update the latest real-time location data of the terminal device in the association table; S43: pre-configuring a strategy, based on which the real-time location data from multiple terminal devices of the same person are integrated to obtain the accurate real-time location of the person; The pre-configured policies are: Identify the update time of the last real-time location data of multiple terminal devices, and use the last updated real-time location data of the multiple terminal devices as the accurate real-time location of the person; and Set different priorities for multiple terminal devices of the same person. If a high-priority device has a track within 10 minutes, the person's real-time location is updated to the last location of the high-priority device. Otherwise, the person's real-time location is updated to the last location of the lower-priority device within 10 minutes. This ensures that the last location of the same device is used, which is less likely to cause track jumps and position errors. S5: The real-time location data after data processing and data fusion is stored in the database, and the real-time location of personnel from multiple data sources is displayed as needed.
2. The method for displaying the real-time location of personnel from multiple data sources according to claim 1, characterized in that: The database binlog method is specifically as follows: enabling the binlog function of the MySQL database, using canal to subscribe to the binlog of the MySQL database, simulating the master-slave mode of the database, and collecting real-time changes of the database.
3. The method for displaying real-time location of personnel from multiple data sources according to claim 1, characterized in that: The database notify method is specifically as follows: S100: Write a function in the PostgreSQL database to convert a row of data in the data table into JSON and then send it to the database's notify message queue; S101: Create a trigger on the trace table of the source database. When data is added or modified, a function is called to send a notify message. S102: Write Java code to subscribe to the database's notify and then loop to listen for messages; S103: Process the message and forward the message queue to realize real-time data collection.
4. The method for displaying real-time positions of personnel from multiple data sources according to claim 1, characterized in that: The socket mode includes: Use the TCP or UDP port of the socket to listen, connect to the data system of other manufacturers, directly push or forward the location information to the collection program, parse the trajectory data according to the protocol, encapsulate it into JSON format, and then put the data into the message queue.
5. The method for displaying real-time positions of personnel from multiple data sources according to claim 1, characterized in that: The specific incremental SQL query method is: S110: Automatically specify an executor based on the database type, and query the database incremental data based on the incremental field and the last execution record by concatenating the query SQL; S111: Record the last query location of the data for use in the next query of incremental data; S112: Encapsulate the queried data into JSON format and then put the data into the message queue.
6. The method for displaying real-time positions of personnel from multiple data sources according to claim 1, characterized in that: The specific method for querying the current location of HTTP is: S120: Regularly query and capture the latest coordinate data or trajectory data of the most recent period; S121: The status code of the queried data is removed according to the configuration, and only the data part is extracted, encapsulated into JSON format and put into the message queue.
7. The method for displaying real-time positions of personnel from multiple data sources according to claim 1, characterized in that: In S2, the message queue is a Kafka message queue.
8. The method for displaying real-time positions of personnel from multiple data sources according to claim 1, characterized in that: In S3, the specific method of performing data processing according to the data source identifier of each real-time location data is as follows: By identifying the data source and matching the pre-defined configuration file, the real-time location data fields are parsed and formatted into a unified output data format and field name.
9. A computer system for an electronic device, the electronic device comprising: a processor, and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the method for displaying real-time locations of personnel from multiple data sources as described in any one of claims 1-8.
10. A computer-readable storage medium having one or more computer programs stored thereon, characterized in that: When the one or more computer programs are executed by a computer processor, the method according to any one of claims 1 to 8 is implemented.
11. A real-time personnel location display system with multiple data sources, characterized in that: include: Data collection module: used to collect a number of real-time location data from a number of terminal devices, and add a data source identifier to each real-time location data; The data collection method for collecting multiple real-time location data through multiple terminal devices is a data-driven method or a task-driven method. The data-driven method is a database binlog method, a database notify method, or a socket method. The task-driven method is an incremental SQL query method or an HTTP current location query method. Message queue module: This module sends the collected real-time location data to the message queue for asynchronous processing of the real-time location data, controls traffic peaks, matches data collection modules and data processing modules at different speeds, and improves the response to the data collection module. Data processing module: reads several real-time location data in the message queue, processes the data according to the data source identifier of each real-time location data, and outputs it in a unified data format; Policy module: used to pre-configure policies for situations where the same person holds multiple terminal devices; Data fusion module: This module fuses multiple real-time location data collected by various terminal devices held by a person, and obtains the person's accurate real-time location according to pre-configured strategies; The specific method is: S41: Create a personnel and terminal equipment association table; S42: Update the latest real-time location data of the terminal device in the association table; S43: pre-configuring a strategy, based on which the real-time location data from multiple terminal devices of the same person are integrated to obtain the accurate real-time location of the person; The pre-configured policies are: Identify the update time of the last real-time location data of multiple terminal devices, and use the last updated real-time location data of the multiple terminal devices as the accurate real-time location of the person; and Set different priorities for multiple terminal devices of the same person. If a high-priority device has a track within 10 minutes, the person's real-time location is updated to the last location of the high-priority device. Otherwise, the person's real-time location is updated to the last location of the lower-priority device within 10 minutes. This ensures that the last location of the same device is used, which is less likely to cause track jumps and position errors. Real-time location display module: stores the processed and integrated real-time location data into the database and displays it centrally in the same function.
Citation Information
Patent Citations
Location processing method, repeated address processing method and device
CN101924746A