CN113204580A - Overwater target position information query method, system, device, equipment and medium - Google Patents

Overwater target position information query method, system, device, equipment and medium Download PDF

Info

Publication number
CN113204580A
CN113204580A CN202110516081.0A CN202110516081A CN113204580A CN 113204580 A CN113204580 A CN 113204580A CN 202110516081 A CN202110516081 A CN 202110516081A CN 113204580 A CN113204580 A CN 113204580A
Authority
CN
China
Prior art keywords
stored
target
parameter
target identification
timestamp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110516081.0A
Other languages
Chinese (zh)
Inventor
阮佳
郑宏辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GUANGDONG MARITIME SAFETY ADMI
Original Assignee
GUANGDONG MARITIME SAFETY ADMI
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GUANGDONG MARITIME SAFETY ADMI filed Critical GUANGDONG MARITIME SAFETY ADMI
Priority to CN202110516081.0A priority Critical patent/CN113204580A/en
Publication of CN113204580A publication Critical patent/CN113204580A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Abstract

The application relates to a method, a system, a device, computer equipment and a storage medium for querying position information of an overwater target. The method and the device can realize real-time and accurate updating of the position parameters of the aquatic target in the cache database, so that the position parameters of the aquatic target stored in the cache database always keep the latest state. The method comprises the following steps: acquiring observed position parameters to be stored of the aquatic target from a card message queue, wherein the position parameters to be stored comprise a target identification code and a time stamp to be stored; when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is later than the existing timestamp, replacing the position parameter of the stored target identification code with the position parameter to be stored, and taking the position parameter to be stored as the latest position parameter; and responding to the target position query instruction, and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.

Description

Overwater target position information query method, system, device, equipment and medium
Technical Field
The application relates to the technical field of water target monitoring, in particular to a method, a system, a device, computer equipment and a storage medium for querying water target position information.
Background
With the development of marine industry and defense science and technology, marine target tracking and management becomes especially important. At present, the precise positioning of the aquatic moving target is realized, the real-time position of the aquatic target can be obtained through a positioning system, but the situation that a large number of targets emerge sometimes occurs due to the fact that the number of the aquatic targets is variable along with time, and the problem that the real-time performance is not high in the process of inquiring the positions of the targets by a data processing system at the moment still exists.
Disclosure of Invention
In view of the above, it is necessary to provide a method, a system, a device, a computer device and a storage medium for querying position information of an aquatic target in order to solve the above technical problems.
A method of querying location information of an aquatic target, the method comprising:
acquiring observed position parameters to be stored of the aquatic target from a card message queue; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is later than the existing timestamp, replacing the position parameter of the stored target identification code with the position parameter to be stored, and taking the position parameter to be stored as the latest position parameter;
when the timestamp corresponding to the target identification code is not stored in the cache database, storing the position parameter to be stored into the cache database, and taking the position parameter to be stored as the latest position parameter;
and responding to a target position query instruction, and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.
In one embodiment, after obtaining the observed position parameter to be stored of the marine target from the card message queue, the method further includes:
when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is earlier than the existing timestamp, the existing timestamp is not updated.
In one embodiment, the method further comprises:
polling is carried out from the cache database at preset time intervals through a preset program;
acquiring position parameters corresponding to all the target identification codes through polling;
storing the position parameters corresponding to all target identification codes acquired by each polling into a preset key value;
and responding to a full data query instruction, and calling a key value query function to acquire the position parameters corresponding to all the target identification codes as the real-time position parameters corresponding to all the target identification codes.
In one embodiment, after the responding to the full data query instruction and calling a key value query function to obtain the location parameters corresponding to all the target identification codes, as the real-time location parameters corresponding to all the target identification codes, the method further includes:
determining the circle center coordinate and the radius of the target circular water area in response to the first set query instruction;
calculating the distance between the real-time position parameter corresponding to each target identification code and the circle center coordinate;
storing the position parameters corresponding to the target identification codes with the distances smaller than or equal to the radius into a first set;
feeding back the first set.
In one embodiment, after the responding to the full data query instruction and calling a key value query function to obtain the location parameters corresponding to all the target identification codes, as the real-time location parameters corresponding to all the target identification codes, the method further includes:
responding to a second set query instruction, and determining a polygonal water area according to the polygonal vertex coordinates in the second set query instruction;
judging whether the real-time position parameters corresponding to the target identification codes are located in the polygonal water area or not;
if yes, storing the real-time position parameters corresponding to the target identification codes into a second set;
feeding back the second set.
A system for querying location information of an aquatic target, the system comprising: the system comprises terminal equipment, a cache database and a card information queue; wherein the content of the first and second substances,
the card information queue is used for acquiring the observed position parameters to be stored of the aquatic target; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
the cache database is used for replacing the stored position parameter of the target identification code with the position parameter of the to-be-stored position parameter if the to-be-stored timestamp is later than the existing timestamp when the existing timestamp corresponding to the target identification code is stored, and taking the to-be-stored position parameter as the latest position parameter;
the cache database is further used for storing the position parameter to be stored to the local when the timestamp corresponding to the target identification code is not stored, and taking the position parameter to be stored as the latest position parameter;
and the terminal equipment is used for responding to a target position query instruction and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.
In an embodiment of the system, the cache database is further configured to, when an existing timestamp corresponding to the target identification code is stored, not update the existing timestamp if the to-be-stored timestamp is earlier than the existing timestamp.
An apparatus for querying location information of an aquatic target, the apparatus comprising:
the parameter acquisition module is used for acquiring the observed position parameter to be stored of the aquatic target from the Kaffman message queue; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
the parameter storage module is used for replacing the stored position parameters of the target identification code with the position parameters to be stored and taking the position parameters to be stored as the latest position parameters if the timestamp to be stored is later than the existing timestamp when the existing timestamp corresponding to the target identification code is stored in the cache database;
the parameter storage module is further configured to store the location parameter to be stored in the cache database when the timestamp corresponding to the target identification code is not stored in the cache database, and use the location parameter to be stored as a latest location parameter;
and the parameter query module is used for responding to a target position query instruction and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.
A computer device comprising a memory storing a computer program and a processor implementing the steps in the above-mentioned embodiments of the method for querying information on position of an aquatic target when the processor executes the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps in the above-mentioned embodiments of the aquatic target location information query method.
According to the method, the system, the device, the computer equipment and the storage medium for inquiring the position information of the aquatic target, the position parameter to be stored of the observed aquatic target is obtained from the card message queue, and the position parameter to be stored comprises the target identification code and the time stamp to be stored; when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is later than the existing timestamp, replacing the position parameter of the stored target identification code with the position parameter to be stored, and taking the position parameter to be stored as the latest position parameter; when the timestamp corresponding to the target identification code is not stored in the cache database, storing the position parameter to be stored into the cache database, and taking the position parameter to be stored as the latest position parameter; and responding to a target position query instruction, and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database. The method can realize real-time and accurate updating of the position parameters of the aquatic target in the cache database, so that the position parameters of the aquatic target stored in the cache database always keep the latest state, and further, the user can acquire the real-time position parameters from the cache database at any time.
Drawings
FIG. 1 is an application environment diagram of a method for querying location information of an aquatic target according to an embodiment;
FIG. 2 is a schematic flow chart of a method for querying location information of an aquatic target according to an embodiment;
FIG. 3 is a block diagram of an apparatus for querying information on a position of an aquatic target according to an embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment;
fig. 5 is an internal structural view of a computer device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for inquiring the position information of the target on the water can be applied to the application environment shown in figure 1. Wherein the terminal 101 can read or write data from the cache database 102. The cache database 102 may also communicate with a card-card message queue server through a network to obtain data in a card-card message queue; the terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
In one embodiment, as shown in fig. 2, there is provided a method for querying position information of an aquatic target, which is described by taking the method as an example applied to the terminal 101 in fig. 1, and includes the following steps:
step S201, obtaining observed position parameters to be stored of the aquatic target from a Kaffman message queue; the position to be stored parameter comprises a target identification code and a time stamp to be stored;
among them, a card-briff (Kafka) message queue is constructed based on Kafka server, which is an open source stream processing platform developed by Apache software foundation and written by Scala and Java. Kafka is a high throughput distributed publish-subscribe messaging system, and is also a messaging system that provides real-time messaging through clustering. It can process all the action flow data of the consumer in the website. These data are typically addressed by handling logs and log aggregations due to throughput requirements. And the Kafka can realize the data backup function, if one partition is damaged, the other partition stores the copy of the partition data, and the data safety is guaranteed. The position parameters of the water target comprise a target identification code, longitude, latitude and time stamp, for example, the position information 1: (id:2, lon:111.2, lat:22.3, time:20210118091500), wherein id represents an object identification code that can uniquely identify a certain object; lon represents longitude, lat represents latitude, and time represents timestamp.
Specifically, the observed position parameters to be stored of the aquatic target are obtained through the card message queue, a data format of each position parameter to be stored includes a target identification code and a time stamp to be stored, for example, the position parameters to be stored of the aquatic target received from the card message queue are as follows:
position information 1: (id:2, lon:111.2, lat:22.3, time:20210118091500)
Position information 2: (id:3, lon:112.5, lat:22.2, time:20210118091500)
Position information 3: (id:2, lon:111.5, lat:22.2, time:20210118091502)
Position information 4: (id:4, lon:113.5, lat:2.2, time:20210118091503)
Position information 5: (id:2, lon:111.5, lat:22.2, time:20210118091504)
Position information 6: (id:1, lon:113.5, lat:22.2, time:20210118091508)
Step S202, when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is later than the existing timestamp, replacing the stored position parameter of the target identification code with the position parameter to be stored, and taking the position parameter to be stored as the latest position parameter;
the cache database is a Redis database, the Redis database is a NoSQL database, data of the Redis database is stored in a memory but not in a disk, the Redis can be synchronously provided to the disk by timing the memory of the Redis database, namely the data can be persisted, and more data structures are supported than memcached.
Specifically, generally, the timestamp of the marine target obtained from the card message queue is generally the latest timestamp, that is, the timestamp to be stored is the latest timestamp, and is later than the stored timestamp, and when a new piece of data is obtained, for example, the above location information 1: (id:2, lon:111.2, lat:22.3, time:20210118091500), the system will detect whether there is a location parameter corresponding to the target identification code in the cache database according to the target identification code id:2, if there is a location parameter corresponding to the target identification code in the cache database, and if there is a location parameter corresponding to the target identification code, and the existing timestamp is a timestamp older than the timestamp in the location parameters to be stored, the location parameter to be stored is replaced by the location parameter of the stored target identification code, and the location parameter to be stored is used as the latest location parameter. Specifically, a key value setting function setkey (key) may be invoked to store a corresponding location parameter, for example, setkey (id2, relevant location information value).
Step S203, when the timestamp corresponding to the target identification code is not stored in the cache database, storing the location parameter to be stored in the cache database, and using the location parameter to be stored as the latest location parameter.
Specifically, when the system does not detect the position parameter corresponding to the target identification code in the cache database according to the received target identification code, the position to be stored of the credit card payment target acquired from the card message queue is stored in the cache database.
Step S204, responding to the target position query instruction, and calling a target query function to obtain the latest position parameter of the target to be queried from the cache database.
Specifically, if the real-time position of a certain aquatic target needs to be acquired, the acquisition of the real-time position can be completed by calling a corresponding function, for example, the real-time position information of a single aquatic moving target needs to be queried, and then the acquisition of a cache database getkey (id) function is called, wherein id is a required target identification code.
In the embodiment, the observed position parameter to be stored of the aquatic target is obtained from the card information queue, wherein the position parameter to be stored comprises the target identification code and the timestamp to be stored; when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is later than the existing timestamp, replacing the position parameter of the stored target identification code with the position parameter to be stored, and taking the position parameter to be stored as the latest position parameter; when the timestamp corresponding to the target identification code is not stored in the cache database, storing the position parameter to be stored into the cache database, and taking the position parameter to be stored as the latest position parameter; and responding to a target position query instruction, and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database. The method can realize real-time and accurate updating of the position parameters of the aquatic target in the cache database, so that the position parameters of the aquatic target stored in the cache database always keep the latest state, and further, the user can acquire the real-time position parameters from the cache database at any time.
In an embodiment, after the step S201, the method further includes: when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is earlier than the existing timestamp, the existing timestamp is not updated.
Specifically, since the relevant information is read by kafka, there may be a case where information with an older time stamp comes later, such as location information:
position information 1: (id:2, lon:111.02, lat:22.03, time:20210118091501)
Position information 2: (id:2, lon:111.03, lat:22.02, time:20210118091500)
Position information 3: (id:2, lon:111.04, lat:22.02, time:20210118091502)
When the location information 1 is received, because the relevant information of the id2 does not exist in the cache database, the relevant information in the location information 1 is stored in the cache database. The function setkey (id2, location information 1) is called for storage.
When the position information 2 is received, the timestamp for reading the current id2 real-time position is 20210118091501, and the information of the cache database id2 is not updated because the time 20210118091500 is earlier than 20210118091501;
when the position information 3 is received, the timestamp for reading the current id2 real-time position is 20210118091501, since the time 20210118091502 is more updated than the 20210118091501 time, the real-time position information of the id2 is updated, and the setkey (id2, position information 3) is called.
According to the embodiment, the time relation of the timestamp corresponding to the target identification code is detected, the position parameter corresponding to the updated timestamp is reserved, the position parameter corresponding to the older timestamp is replaced, the real-time updating of the position information in the cache database is guaranteed, and exceptional situations are avoided.
In an embodiment, the method further includes:
polling is carried out from the buffer database at preset time intervals through a preset program; acquiring position parameters corresponding to all target identification codes through polling; storing the position parameters corresponding to all target identification codes acquired by each polling into a preset key value; and responding to a full data query instruction, and calling a key value query function to acquire the position parameters corresponding to all the target identification codes as the real-time position parameters corresponding to all the target identification codes.
Specifically, assume that the following data exists in the cache database:
position information 1: (id:2, lon:111.2, lat:22.3, time:20210118091500)
Position information 2: (id:3, lon:112.5, lat:22.2, time:20210118091500)
Position information 3: (id:2, lon:111.5, lat:22.2, time:20210118091502)
Position information 4: (id:4, lon:113.5, lat:22.2, time:20210118091503)
Position information 5: (id:2, lon:111.5, lat:22.2, time:20210118091504)
Position information 6: (id:1, lon:113.5, lat:22.2, time:20210118091508)
Continuously and circularly acquiring real-time position information of each overwater moving target from a buffer database by using a preset program, and recording the real-time position information into a set, wherein the set A is the acquired real-time position with id (2, 3, 4, 1), the latest real-time position parameter of the acquired id is recorded by using a table, and after polling all ids once, all position parameter information is set into a key value of the buffer database, such as the real-time position of all ids acquired by first polling)
And after the setting is finished, performing a second round of polling, and storing the real-time position information of all the ids obtained by the second round of polling into a key value of the cache database.
And (3) setkey (the real-time positions of all ids obtained by the second round of polling), wherein the new key value obtained by the second round of polling covers the original stored key value, and so on, because of the previous program polling, all real-time position information can be quickly obtained, and only a get function for calling the cache database to obtain the key value is needed: getkey (allopoint).
According to the embodiment, the preset program is used for polling the cache database regularly to obtain the latest position parameter, and the position parameter is stored in the preset key value, so that the real-time position parameter of the whole data can be obtained quickly in the follow-up process.
In an embodiment, after the invoking a key value query function to obtain the location parameters corresponding to all the target identification codes in response to the full data query instruction, and as the real-time location parameters corresponding to all the target identification codes, the method further includes:
determining the circle center coordinate and the radius of the target circular water area in response to the first set query instruction; calculating the distance between the real-time position parameter corresponding to each target identification code and the circle center coordinate; storing the position parameters corresponding to the target identification codes with the distances smaller than or equal to the radius into a first set; the first set is fed back.
The first set query instruction is a query instruction input by a user for querying parameters of the target position of the circular water area, wherein the query instruction comprises two parameters which are respectively a circle center coordinate and a radius.
Specifically, the terminal 101 acquires a first set query instruction input by a user, determines a circle center coordinate and a radius according to the instruction, and calls getkey (allow) to obtain real-time position information of all aquatic moving targets; calculating the distances between the real-time positions of all the ids and the coordinates of the circle center; judging whether the distance is smaller than the value of the radius preset by the parameter; if the distance between the id real-time position and the circle center is smaller than the radius value, recording a result set, namely a first set; the first set is returned to the display device of the terminal 101.
In the embodiment, the query instruction with specific parameters is set to quickly determine the circular water area, and the target set in the circular water area is determined according to the position relation between the circle center coordinate and the target and the radius, so that the target position in the circular water area can be quickly acquired.
In an embodiment, after the invoking a key value query function to obtain the location parameters corresponding to all the target identification codes in response to the full data query instruction, and as the real-time location parameters corresponding to all the target identification codes, the method further includes:
responding to the second set query instruction, and determining a polygonal water area according to the polygonal vertex coordinates in the second set query instruction; judging whether the real-time position parameters corresponding to the target identification codes are located in the polygonal water area or not; if yes, storing the real-time position parameters corresponding to the target identification codes into a second set; the second set is fed back.
The second set query instruction refers to a polygonal water area target query instruction input by a user, and the instruction comprises vertex coordinates used for determining a polygonal shape.
Specifically, the terminal 101 acquires a second set query instruction input by a user, determines a polygonal range according to the instruction, and calls getkey (allow) to obtain real-time position information of all aquatic moving targets; initializing a polygonal area according to input parameters; acquiring the real-time position of each overwater moving target id; judging whether the position is in the polygon; recording the result set, namely a second set, when the position is in the polygon; the second set is returned to the display device of the terminal 101.
In the embodiment, the inquiry instruction with specific parameters is set, the polygonal water area is determined quickly, the target set in the polygonal water area is determined according to the position relation between the polygon and the target, and the quick acquisition of the target position in the polygonal water area is facilitated.
In an embodiment, there is also provided a system for querying information about a position of an aquatic target, as shown in fig. 2, the system including: terminal equipment 101, a cache database 102 and a card message queue 103;
the system comprises a card information queue 103, a position acquisition module and a position acquisition module, wherein the card information queue 103 is used for acquiring observed position parameters to be stored of an aquatic target; the position to be stored parameter comprises a target identification code and a time stamp to be stored;
the cache database 102 is used for replacing the position parameter of the stored target identification code with the position parameter of the stored target identification code if the timestamp to be stored is later than the existing timestamp when the existing timestamp corresponding to the target identification code is stored, and taking the position parameter to be stored as the latest position parameter;
the cache database 102 is further configured to store the location parameter to be stored locally when the timestamp corresponding to the target identification code is not stored, and use the location parameter to be stored as the latest location parameter;
and the terminal device 101 is configured to respond to the target position query instruction, and call a target query function to obtain the latest position parameter of the target to be queried from the cache database.
In an embodiment, the cache database 102 is further configured to, when an existing timestamp corresponding to the target identification code is stored, if the to-be-stored timestamp is earlier than the existing timestamp, not update the existing timestamp.
In an embodiment, the terminal device 101 is further configured to: polling is carried out from the cache database at preset time intervals through a preset program; acquiring position parameters corresponding to all the target identification codes through polling; storing the position parameters corresponding to all target identification codes acquired by each polling into a preset key value; and responding to a full data query instruction, and calling a key value query function to acquire the position parameters corresponding to all the target identification codes as the real-time position parameters corresponding to all the target identification codes.
In an embodiment, the terminal device 101 is further configured to: determining the circle center coordinate and the radius of the target circular water area in response to the first set query instruction; calculating the distance between the real-time position parameter corresponding to each target identification code and the circle center coordinate; storing the position parameters corresponding to the target identification codes with the distances smaller than or equal to the radius into a first set; feeding back the first set.
In an embodiment, the terminal device 101 is further configured to: responding to a second set query instruction, and determining a polygonal water area according to the polygonal vertex coordinates in the second set query instruction; judging whether the real-time position parameters corresponding to the target identification codes are located in the polygonal water area or not; if yes, storing the real-time position parameters corresponding to the target identification codes into a second set; feeding back the second set.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in the figures may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 3, there is provided an apparatus 300 for querying position information of an aquatic target, comprising: a parameter obtaining module 301, a parameter storing module 302 and a parameter querying module 303, wherein:
a parameter obtaining module 301, configured to obtain a to-be-stored position parameter of an observed aquatic target from a kaffka message queue; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
a parameter storage module 302, configured to, when an existing timestamp corresponding to the target identifier is stored in the cache database, replace a stored location parameter of the target identifier with the location parameter to be stored if the to-be-stored timestamp is later than the existing timestamp, and use the location parameter to be stored as a latest location parameter;
the parameter storage module 302 is further configured to store the location parameter to be stored in the cache database when the timestamp corresponding to the target identification code is not stored in the cache database, and use the location parameter to be stored as a latest location parameter;
a parameter query module 303, configured to, in response to the target location query instruction, invoke a target query function to obtain the latest location parameter of the target to be queried from the cache database.
In an embodiment, the parameter storage module 302 is further configured to, when an existing timestamp corresponding to the target identifier is stored in the cache database, if the to-be-stored timestamp is earlier than the existing timestamp, not update the existing timestamp.
In an embodiment, the parameter query module 303 is further configured to: polling is carried out from the cache database at preset time intervals through a preset program; acquiring position parameters corresponding to all the target identification codes through polling; storing the position parameters corresponding to all target identification codes acquired by each polling into a preset key value; and responding to a full data query instruction, and calling a key value query function to acquire the position parameters corresponding to all the target identification codes as the real-time position parameters corresponding to all the target identification codes.
In an embodiment, the parameter query module 303 is further configured to: determining the circle center coordinate and the radius of the target circular water area in response to the first set query instruction; calculating the distance between the real-time position parameter corresponding to each target identification code and the circle center coordinate; storing the position parameters corresponding to the target identification codes with the distances smaller than or equal to the radius into a first set; feeding back the first set.
In an embodiment, the parameter query module 303 is further configured to: responding to a second set query instruction, and determining a polygonal water area according to the polygonal vertex coordinates in the second set query instruction; judging whether the real-time position parameters corresponding to the target identification codes are located in the polygonal water area or not; if yes, storing the real-time position parameters corresponding to the target identification codes into a second set; feeding back the second set.
The specific definition of the above-mentioned water target position information query device can be referred to the above definition of the water target position information query method, and is not described herein again. All or part of the modules in the above-mentioned above-water target position information inquiry device can be realized by software, hardware and their combination. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing position parameter data of the water target. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a method for inquiring the position information of the water target.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to realize a method for inquiring the position information of the water target. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 4-5 are only block diagrams of some of the configurations relevant to the present application, and do not constitute a limitation on the computing devices to which the present application may be applied, and that a particular computing device may include more or less components than shown, or combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps in the above-mentioned method for querying position information of a target on water when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps in the above-mentioned method for querying information on a position of a target on water. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for inquiring position information of an aquatic target is characterized by comprising the following steps:
acquiring observed position parameters to be stored of the aquatic target from a card message queue; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is later than the existing timestamp, replacing the position parameter of the stored target identification code with the position parameter to be stored, and taking the position parameter to be stored as the latest position parameter;
when the timestamp corresponding to the target identification code is not stored in the cache database, storing the position parameter to be stored into the cache database, and taking the position parameter to be stored as the latest position parameter;
and responding to a target position query instruction, and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.
2. The method of claim 1, wherein after obtaining the observed location parameter to be stored for the marine target from the kava message queue, further comprising:
when the existing timestamp corresponding to the target identification code is stored in the cache database, if the timestamp to be stored is earlier than the existing timestamp, the existing timestamp is not updated.
3. The method of claim 1, further comprising:
polling is carried out from the cache database at preset time intervals through a preset program;
acquiring position parameters corresponding to all the target identification codes through polling;
storing the position parameters corresponding to all target identification codes acquired by each polling into a preset key value;
and responding to a full data query instruction, and calling a key value query function to acquire the position parameters corresponding to all the target identification codes as the real-time position parameters corresponding to all the target identification codes.
4. The method of claim 3, wherein after the step of calling a key value query function to obtain the location parameters corresponding to all the target identifiers in response to the full data query instruction and using the location parameters as the real-time location parameters corresponding to all the target identifiers, the method further comprises:
determining the circle center coordinate and the radius of the target circular water area in response to the first set query instruction;
calculating the distance between the real-time position parameter corresponding to each target identification code and the circle center coordinate;
storing the position parameters corresponding to the target identification codes with the distances smaller than or equal to the radius into a first set;
feeding back the first set.
5. The method of claim 3, wherein after the step of calling a key value query function to obtain the location parameters corresponding to all the target identifiers in response to the full data query instruction and using the location parameters as the real-time location parameters corresponding to all the target identifiers, the method further comprises:
responding to a second set query instruction, and determining a polygonal water area according to the polygonal vertex coordinates in the second set query instruction;
judging whether the real-time position parameters corresponding to the target identification codes are located in the polygonal water area or not;
if yes, storing the real-time position parameters corresponding to the target identification codes into a second set;
feeding back the second set.
6. An on-water target location information query system, the system comprising: the system comprises terminal equipment, a cache database and a card information queue; wherein the content of the first and second substances,
the card information queue is used for acquiring the observed position parameters to be stored of the aquatic target; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
the cache database is used for replacing the stored position parameter of the target identification code with the position parameter of the to-be-stored position parameter if the to-be-stored timestamp is later than the existing timestamp when the existing timestamp corresponding to the target identification code is stored, and taking the to-be-stored position parameter as the latest position parameter;
the cache database is further used for storing the position parameter to be stored to the local when the timestamp corresponding to the target identification code is not stored, and taking the position parameter to be stored as the latest position parameter;
and the terminal equipment is used for responding to a target position query instruction and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.
7. The system according to claim 6, wherein the cache database is further configured to, when an existing timestamp corresponding to the target identification code is stored, not update the existing timestamp if the timestamp to be stored is earlier than the existing timestamp.
8. An apparatus for querying information on a position of an aquatic target, the apparatus comprising:
the parameter acquisition module is used for acquiring the observed position parameter to be stored of the aquatic target from the Kaffman message queue; the position parameter to be stored comprises a target identification code and a time stamp to be stored;
the parameter storage module is used for replacing the stored position parameters of the target identification code with the position parameters to be stored and taking the position parameters to be stored as the latest position parameters if the timestamp to be stored is later than the existing timestamp when the existing timestamp corresponding to the target identification code is stored in the cache database;
the parameter storage module is further configured to store the location parameter to be stored in the cache database when the timestamp corresponding to the target identification code is not stored in the cache database, and use the location parameter to be stored as a latest location parameter;
and the parameter query module is used for responding to a target position query instruction and calling a target query function to acquire the latest position parameter of the target to be queried from the cache database.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202110516081.0A 2021-05-12 2021-05-12 Overwater target position information query method, system, device, equipment and medium Pending CN113204580A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110516081.0A CN113204580A (en) 2021-05-12 2021-05-12 Overwater target position information query method, system, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110516081.0A CN113204580A (en) 2021-05-12 2021-05-12 Overwater target position information query method, system, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113204580A true CN113204580A (en) 2021-08-03

Family

ID=77031072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110516081.0A Pending CN113204580A (en) 2021-05-12 2021-05-12 Overwater target position information query method, system, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113204580A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168605A (en) * 2021-12-08 2022-03-11 镁佳(北京)科技有限公司 Data reporting method, device and equipment
CN114546270A (en) * 2022-02-15 2022-05-27 杭州隆埠科技有限公司 Data storage method and device and electronic equipment
CN115438095A (en) * 2022-08-31 2022-12-06 中华人民共和国广东海事局 Position information processing method, position information processing device, computer equipment and storage medium
CN116481560A (en) * 2023-06-21 2023-07-25 天津所托瑞安汽车科技有限公司 Vehicle driving mileage calculation method, device, terminal and storage medium
CN116661636A (en) * 2023-05-30 2023-08-29 北京和德宇航技术有限公司 Track display method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844546A (en) * 2016-12-30 2017-06-13 江苏号百信息服务有限公司 Multi-data source positional information fusion method and system based on Spark clusters
WO2017184616A1 (en) * 2016-04-19 2017-10-26 Skia, Inc. Location swapping between devices in physical proximity
CN112187889A (en) * 2020-09-15 2021-01-05 中信银行股份有限公司 Data synchronization method, device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017184616A1 (en) * 2016-04-19 2017-10-26 Skia, Inc. Location swapping between devices in physical proximity
CN106844546A (en) * 2016-12-30 2017-06-13 江苏号百信息服务有限公司 Multi-data source positional information fusion method and system based on Spark clusters
CN112187889A (en) * 2020-09-15 2021-01-05 中信银行股份有限公司 Data synchronization method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
安德鲁·凯莱赫等: "《机器学习实践:数据科学应用与工作流的开发及优化》", 30 April 2020, 机械工业出版社 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168605A (en) * 2021-12-08 2022-03-11 镁佳(北京)科技有限公司 Data reporting method, device and equipment
CN114546270A (en) * 2022-02-15 2022-05-27 杭州隆埠科技有限公司 Data storage method and device and electronic equipment
CN114546270B (en) * 2022-02-15 2024-02-09 杭州隆埠科技有限公司 Data storage method and device and electronic equipment
CN115438095A (en) * 2022-08-31 2022-12-06 中华人民共和国广东海事局 Position information processing method, position information processing device, computer equipment and storage medium
CN116661636A (en) * 2023-05-30 2023-08-29 北京和德宇航技术有限公司 Track display method, device, equipment and storage medium
CN116661636B (en) * 2023-05-30 2024-01-30 北京和德宇航技术有限公司 Track display method, device, equipment and storage medium
CN116481560A (en) * 2023-06-21 2023-07-25 天津所托瑞安汽车科技有限公司 Vehicle driving mileage calculation method, device, terminal and storage medium
CN116481560B (en) * 2023-06-21 2023-10-03 天津所托瑞安汽车科技有限公司 Vehicle driving mileage calculation method, device, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN113204580A (en) Overwater target position information query method, system, device, equipment and medium
CN108287708B (en) Data processing method and device, server and computer readable storage medium
CN110781214A (en) Database reading and writing method and device, computer equipment and storage medium
US20210042150A1 (en) Method-call-chain tracking method, electronic device, and computer readable storage medium
CN106484779B (en) File operation method and device
CN113064919B (en) Data processing method, data storage system, computer device and storage medium
CN110442636B (en) Data reading and writing method and device and data reading and writing equipment
CN108228611B (en) Document information copying method and device
CN112711051A (en) Flight control system positioning method, device, equipment and storage medium
CN108228842B (en) Docker mirror image library file storage method, terminal, device and storage medium
CN110019538B (en) Data table switching method and device
CN112905668B (en) Database derivative method, device and medium based on distributed data stream processing engine
CN110968333A (en) Configuration information replacement method and device, machine-readable storage medium and processor
CN115017436A (en) Data interaction method and device of application program, computer equipment and storage medium
CN114116676A (en) Data migration method and device, electronic equipment and computer readable storage medium
CN112231290A (en) Method, device and equipment for processing local log and storage medium
CN112306995A (en) Method and device for realizing database operation
CN112231377A (en) Data mapping method, system, device, server and storage medium
CN111914128A (en) Method and device for determining associated user, electronic equipment and readable storage medium
CN110750162A (en) Input method and equipment
KR20210016913A (en) Electronic device for prohibiting loss of data in database and method for the same
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller
CN116546103A (en) Processing method, device, equipment, storage medium and product of distributed service
CN112732568B (en) System log acquisition method and device, storage medium and terminal
CN116909684A (en) Deployment method and device of low-code application, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210803

RJ01 Rejection of invention patent application after publication