Data storage method and device
Technical Field
The embodiment of the invention relates to the technical field of traffic monitoring, in particular to a data storage method and device.
Background
The traffic monitoring platform includes: a computing center and a plurality of bayonet devices arranged on different road sections. The bayonet device is used for acquiring a vehicle passing picture of the vehicle and analyzing and obtaining initial vehicle passing data of the vehicle according to the vehicle passing picture. And then, the checkpoint equipment reports the initial vehicle passing data to a computing center for storage, wherein the computing center can be a large-scale server or a server cluster.
The initial vehicle passing data typically includes: information items such as a bayonet identification, a license plate number of a vehicle, a vehicle color, a lane where the vehicle is located and the like. In a computing center, the passing picture and the initial passing data are typically stored separately at different locations. For example, the passing picture is stored in a TFS (traffic file system) of the central node, and the initial passing data and the storage path of the passing picture are stored in a traffic database of the central node. Wherein, the storage path of the car-passing picture is the storage path of the car-passing picture in the TFS. Because different regions are provided with traffic monitoring platforms, the lower-level platform has the requirement of cascading and reporting the initial vehicle passing data in the traffic database of the lower-level platform to the upper-level platform. Alternatively, the lower platform is a traffic monitoring platform set at city and county level, and the upper platform is a traffic monitoring platform set at province level. At this time, the superior platform needs to add the initial vehicle passing data to the traffic database of the current platform for storage.
For example, the following lower-level platform reports the initial vehicle passing data to the upper-level platform in a cascade connection manner, because the bayonet identifiers of two bayonet devices belonging to different lower-level platforms may be the same, for example: the bayonet of the bayonet equipment in Hangzhou city is marked as '001', and the bayonet of the bayonet equipment in Wenzhou city is also marked as '001'. Therefore, when the upper platform receives initial vehicle passing data respectively collected by two gate devices with the same gate identification and reported by different lower platforms, a data collision problem occurs in the upper platform.
Disclosure of Invention
In order to solve the problem that when a higher-level platform stores initial vehicle passing data with the same bayonet identification, which are sent by different lower-level platforms, data collision occurs, the embodiment of the invention provides a data storage method and a data storage device. The technical scheme is as follows:
in a first aspect, a data storage method is provided, the method including:
receiving subordinate vehicle passing data sent by a subordinate platform, wherein the subordinate vehicle passing data comprises: n types of lower information items having different types and a mapping field for identifying a mapping relationship of a predetermined type of lower information items in an upper platform, the predetermined type being one of the n types, the n being a positive integer;
mapping the lower information items of the preset types according to the mapping fields to obtain mapped upper information items, wherein the upper information items are used for uniquely marking information sources or storage positions of the lower information items in the upper platform;
replacing the lower information items of the preset type by the mapped upper information items to obtain the replaced lower vehicle passing data;
and storing the replaced lower-level vehicle passing data into a traffic database of the upper-level platform.
In an alternative embodiment, the mapping field is a bayonet mapping field, and the predetermined type of lower information item is a lower bayonet identification;
the mapping the lower information items of the preset type according to the mapping fields to obtain mapped upper information items, including:
inquiring a lower platform identifier corresponding to the bayonet mapping field according to a pre-stored first mapping relation, wherein the first mapping relation at least comprises the mapping relation between the bayonet mapping field and the lower platform identifier, and the lower platform identifier is used for uniquely identifying the lower platform in the upper platform;
and determining the higher bayonet identification obtained by combining the lower platform identification and the lower bayonet identification as the mapped higher information item.
In an optional embodiment, the mapping field is a database mapping field, and the lower information item of the predetermined type is a lower picture database address of a lower car passing picture in the lower platform corresponding to the lower car passing data;
the mapping the lower information items of the preset type according to the mapping fields to obtain mapped upper information items, including:
inquiring a superior picture database address corresponding to the database mapping field according to a pre-stored second mapping relation, wherein the second mapping relation at least comprises the mapping relation between the database mapping field and the superior picture database address, the superior picture database address is a storage address of the inferior car passing picture in a superior picture database of a superior platform, and the superior picture database is a database obtained by copying or synchronizing the inferior picture database;
and determining the address of the superior picture database as the mapped superior information item.
In an alternative embodiment, the predetermined type of lower level information item further comprises: a lower picture database identifier where the lower car passing picture is located;
the mapping the lower information items of the preset type according to the mapping fields to obtain mapped upper information items, including:
inquiring a subordinate platform identification corresponding to the database mapping field according to the second mapping relation, wherein the second mapping relation further comprises the mapping relation between the database mapping field and the subordinate platform identification, and the subordinate platform identification is used for uniquely identifying the subordinate platform in the superior platform;
and determining a superior picture database identifier obtained by combining the subordinate platform identifier and the subordinate picture database identifier as the mapped superior information item.
In a second aspect, a data storage method is provided, the method comprising:
receiving initial vehicle passing data sent by a bayonet device, wherein the initial vehicle passing data comprises n types of subordinate information items, and n is a positive integer;
adding a mapping field corresponding to the lower information item of a predetermined type, wherein the mapping field is used for identifying the mapping relation of the lower information item of the predetermined type in an upper platform, and the predetermined type is one of the n types;
generating lower-level vehicle passing data according to the initial vehicle passing data and the mapping field;
and sending the lower-level vehicle passing data to the upper-level platform.
In an alternative embodiment, said predetermined type of lower level information item is a lower level bayonet identification of said bayonet device,
the adding of the mapping field corresponding to the lower level information item of the predetermined type includes:
acquiring a lower platform identification;
inquiring a bayonet mapping field corresponding to the lower platform identification according to a pre-stored first mapping relation, and determining that the bayonet mapping field is the mapping field corresponding to the lower bayonet identification, wherein the first mapping relation at least comprises the mapping relation between the lower platform identification and the bayonet mapping field.
In an optional embodiment, the predetermined type of lower information items are a lower picture database address and a lower picture database identifier of a lower car passing picture in a lower platform corresponding to the initial car passing data;
the adding of the mapping field corresponding to the lower level information item of the predetermined type includes:
acquiring a lower platform identification;
and inquiring the database mapping field corresponding to the subordinate platform identification according to a pre-stored second mapping relation, and determining that the database mapping field is the mapping field corresponding to the subordinate picture database address and the subordinate picture data identification, wherein the second mapping relation at least comprises the mapping relation between the subordinate platform identification and the database mapping field.
In an alternative embodiment, the n different types of lower level information items include lower level information items of which types are unique keys; the unique key is used for uniquely identifying each piece of initial vehicle passing data acquired by the bayonet device;
the method further comprises the following steps:
acquiring a lower platform identification;
combining the lower platform identification with a sequence number to obtain a traffic passing serial number with a first preset digit, wherein the sequence number is used for indicating the sequence of the lower platform receiving the initial traffic passing data;
and combining the traffic flow number and the receiving time of the initial traffic data to generate the unique key with a second preset digit.
In a third aspect, there is provided a data storage device comprising:
the receiving unit is used for receiving lower-level vehicle passing data sent by a lower-level platform, and the lower-level vehicle passing data comprises: n types of lower information items having different types and a mapping field for identifying a mapping relationship of a predetermined type of lower information items in an upper platform, the predetermined type being one of the n types, the n being a positive integer;
the mapping unit is used for mapping the lower information items of the preset types according to the mapping fields to obtain mapped upper information items, and the upper information items are used for uniquely marking information sources or storage positions of the lower information items in the upper platform;
a replacing unit, configured to replace the lower level information item of the predetermined type with the mapped upper level information item, so as to obtain the replaced lower level passing data;
and the storage unit is used for storing the replaced lower-level vehicle passing data into a traffic database of the upper-level platform.
In an alternative embodiment, the mapping field is a bayonet mapping field, and the predetermined type of lower information item is a lower bayonet identification;
the mapping unit is specifically configured to:
inquiring a lower platform identifier corresponding to the bayonet mapping field according to a pre-stored first mapping relation, wherein the first mapping relation at least comprises the mapping relation between the bayonet mapping field and the lower platform identifier, and the lower platform identifier is used for uniquely identifying the lower platform in the upper platform;
and determining the higher bayonet identification obtained by combining the lower platform identification and the lower bayonet identification as the mapped higher information item.
In an optional embodiment, the mapping field is a database mapping field, and the lower information item of the predetermined type is a lower picture database address of a lower car passing picture in the lower platform corresponding to the lower car passing data;
the mapping unit is specifically configured to:
inquiring a superior picture database address corresponding to the database mapping field according to a pre-stored second mapping relation, wherein the second mapping relation at least comprises the mapping relation between the database mapping field and the superior picture database address, the superior picture database address is a storage address of the inferior car passing picture in a superior picture database of a superior platform, and the superior picture database is a database obtained by copying or synchronizing the inferior picture database;
and determining the address of the superior picture database as the mapped superior information item.
In an alternative embodiment, the predetermined type of lower level information item further comprises: a lower picture database identifier where the lower car passing picture is located;
the mapping unit is further configured to:
inquiring a subordinate platform identification corresponding to the database mapping field according to the second mapping relation, wherein the second mapping relation further comprises the mapping relation between the database mapping field and the subordinate platform identification, and the subordinate platform identification is used for uniquely identifying the subordinate platform in the superior platform;
and determining a superior picture database identifier obtained by combining the subordinate platform identifier and the subordinate picture database identifier as the mapped superior information item.
In a fourth aspect, there is provided a data storage device, the device comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving initial vehicle passing data sent by a bayonet device, the initial vehicle passing data comprises n types of lower information items of different types, and n is a positive integer;
an adding unit, configured to add a mapping field corresponding to the lower level information item of a predetermined type, where the mapping field is used to identify a mapping relationship of the lower level information item of the predetermined type in an upper level platform, and the predetermined type is one of the n types;
the generating unit is used for generating lower-level vehicle passing data according to the initial vehicle passing data and the mapping field;
and the sending unit is used for sending the lower-level vehicle passing data to the upper-level platform.
In an alternative embodiment, said predetermined type of lower level information item is a lower level bayonet identification of said bayonet device,
the adding unit is specifically configured to:
acquiring a lower platform identification;
inquiring a bayonet mapping field corresponding to the lower platform identification according to a pre-stored first mapping relation, and determining that the bayonet mapping field is the mapping field corresponding to the lower bayonet identification, wherein the first mapping relation at least comprises the mapping relation between the lower platform identification and the bayonet mapping field.
In an optional embodiment, the predetermined type of lower information items are a lower picture database address and a lower picture database identifier of a lower car passing picture in a lower platform corresponding to the initial car passing data;
the adding unit is specifically configured to:
acquiring a lower platform identification;
and inquiring the database mapping field corresponding to the subordinate platform identification according to a pre-stored second mapping relation, and determining that the database mapping field is the mapping field corresponding to the subordinate picture database address and the subordinate picture data identification, wherein the second mapping relation at least comprises the mapping relation between the subordinate platform identification and the database mapping field.
In an alternative embodiment, the n different types of lower level information items include lower level information items of which types are unique keys; the unique key is used for uniquely identifying each piece of initial vehicle passing data acquired by the bayonet device;
the device further comprises:
an obtaining unit, configured to obtain a lower platform identifier;
the merging unit is used for merging the lower platform identification with the sequence number to obtain a traffic passing serial number with a first preset digit, wherein the sequence number is used for indicating the sequence of the initial traffic passing data received by the lower platform;
the merging unit is further configured to merge the passing serial number and the receiving time of the initial passing data to generate the unique key with a second preset digit.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
adding a mapping field for a lower information item of a preset type through a lower platform, and sending the lower information item and the mapping field to a higher platform together as lower vehicle passing data of the lower platform; the superior platform maps the subordinate information items of the preset type according to the mapping fields to obtain superior information items; and replacing the lower information item of the preset type by using the upper information item to obtain replaced lower-level vehicle passing data, and storing the replaced lower-level vehicle passing data in a traffic database of the upper platform. When the preset type of lower information item is a lower bayonet identification, the upper platform can obtain the upper bayonet identification corresponding to the lower bayonet identification according to mapping field mapping, and the upper bayonet identification can uniquely mark the information source of the lower passing data in the upper platform, so that when the upper platform receives the lower passing data which are sent by different lower platforms and have the same lower bayonet identification, the two pieces of lower passing data correspond to different upper platform identifications; the problem that in the prior art, when an upper platform receives two lower-level vehicle passing data with the same lower-level bayonet identification is solved; the problem that data corresponding to the identification of the lower bayonet is lost due to the fact that one identification of the lower bayonet is deleted due to the conflict of the identifications of the lower bayonets is solved; the problem of data conflict can not occur when the lower platform cascades the lower bayonet identification to the upper platform, and the integrity of the data corresponding to the lower bayonet identification is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data storage system according to an embodiment of the present invention.
Fig. 2A is a flowchart of a data storage method according to an embodiment of the present invention.
Fig. 2B is a flowchart of a data storage method according to another embodiment of the present invention.
Fig. 2C is a flowchart of a data storage method according to another embodiment of the present invention.
Fig. 2D is a flowchart of a data storage method according to another embodiment of the present invention.
Fig. 2E is a flowchart of a data storage method according to another embodiment of the present invention.
Fig. 3 is a block diagram of a data storage device according to an embodiment of the present invention.
Fig. 4 is a block diagram of a data storage device according to another embodiment of the present invention.
Fig. 5 is a schematic diagram illustrating a structure of a server according to an exemplary embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
In order that the invention may be more clearly understood, several terms to which the invention relates will first be explained.
A lower platform: the traffic monitoring platform is arranged at the level of villages, towns, counties and cities and is used for recording and monitoring traffic conditions.
A superior platform: is a traffic monitoring platform with higher management level relative to the lower platform, such as: a traffic monitoring platform at town, county, city, province or country level.
The lower bayonet identification is the identification of the bayonet device arranged in the lower platform, and the identification can be numbers such as 1, 2 and 3, or the identification can also be letters such as a, bc and deg, or the identification can also be symbols such as @ # ¥, or the identification can also be the combination of at least two of numbers, letters and symbols, the embodiment does not limit the specific form of the lower bayonet identification.
Lower picture database identification: the identifier of a lower picture database for storing the car passing picture in the lower platform is as follows: 20. 59, 31, etc., the present embodiment does not limit the specific form of the lower picture database identifier.
Lower picture database address: refers to the network address of the lower picture database in the lower platform. Alternatively, the address of the subordinate picture database generally includes an IP (Internet Protocol, Protocol for interconnection between networks) address and a port identification of the subordinate picture database, such as: 192.168.1.103: 8008, wherein 192.168.1.103 is an IP address; 8008 is a port identification.
It should be noted that the lower picture database identifier and the lower picture database address are only valid in the local area network where the lower platform is located, and after the lower picture database identifier and the lower picture database address are reported to the upper platform, the problem of data unavailability may occur in the upper platform due to different networking environments of the lower platform and the upper platform.
Lower-level vehicle passing data: refers to the initial pass data stored in the lower level platform. The lower level passing data includes a lower level information item of a predetermined type and at least one mapping field. Optionally, the lower-level passing data further includes a lower-level information item of which the type is a unique key, a secondary analysis field, and a secondary analysis information item obtained by secondary analysis.
Illustratively, one piece of lower-level passing data includes:
license plate: zhe AXXXX;
vehicle brand: the public;
vehicle model: meiteng 2015;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
lower picture database identification: 3;
lower picture database address: 10.22.221.2:8088.
Obviously, the lower level passing data includes 8 different types of lower level information items: license plate, vehicle brand, vehicle model, passing time, passing serial number, subordinate bayonet identification, subordinate picture database identification and subordinate picture database address. Wherein:
predetermined type of lower information item: the information item refers to an information item which can cause a data conflict problem, a data global uniqueness problem or a data unavailability problem after a lower platform reports to an upper platform. Optionally, the predetermined type of lower information item includes at least one of a lower mount identification, a lower picture database identification, and a lower picture database address.
Mapping field: a mapping relation for identifying a predetermined type of lower level information item in an upper level platform, the mapping field being a bridge for converting the predetermined type of lower level information item into an upper level information item in the upper level platform. The type of the mapping field is different for different predetermined types of lower level information items. When the lower information item of the preset type is a lower bayonet identification, the mapping field is a bayonet mapping field; the mapping field is a database mapping field when the predetermined type of the lower information item is a lower picture database identity and/or a lower picture database address.
Unique key: the unique key is used for identifying each piece of initial vehicle passing data in the lower platform in the database, and the unique key can be obtained by combining vehicle passing time and vehicle passing serial numbers after reverse order. The vehicle passing serial number refers to an identifier distributed for initial vehicle passing data when the bayonet device collects the initial vehicle passing data, the identifier is globally unique in a lower platform, and generally, the vehicle passing serial number is generated by the lower platform identifier and a vehicle passing sequence number, such as: 332600000000001. the number of the passing serial number is fixed to a first preset number, and the number of the unique key is fixed to a second preset number.
Secondary analysis field: the secondary analysis field is used for identifying whether secondary analysis needs to be carried out on the lower-level vehicle passing picture to obtain a secondary analysis information item of the vehicle. The values of the secondary analysis field include: the secondary analysis is not required, the secondary analysis is required, and any one of success and failure of the secondary analysis is required. It should be noted that, in this embodiment, the secondary analysis field includes the above four values only as an example for description. Optionally, the secondary analysis field may also adopt other value-taking modes, such as: the secondary analysis field includes: the second analysis, the second analysis and the second analysis are not required to be performed, and any one of three values is required, which is not limited in this embodiment. In practical implementation, the secondary analysis field may be a number, a letter, a symbol, etc., such as: 0 means no secondary analysis is required; 1 indicates that secondary analysis is required; 2 represents the success of the secondary analysis; the secondary analysis failure is denoted by 3, which is not limited in this embodiment.
Secondary analysis information item: the information items obtained after the secondary analysis of the lower-level car passing picture is successful are shown, for example: the information items of the vehicle brand, the sub-brand of the vehicle, the vehicle model, the vehicle year, whether to fasten a safety belt, whether to open a sun shield and the like.
Optionally, the lower-level vehicle passing data further includes information items such as a license plate number of the vehicle, a color of the vehicle, and a lane where the vehicle is located, which is not limited in this embodiment.
Referring to fig. 1, a schematic structural diagram of a data storage system according to an embodiment of the present invention is shown. The system comprises: at least one lower stage 110, an upper stage 120 and a bayonet device 10, 11 and 12 for each lower stage 110.
The bayonet devices 10, 11, and 12 are configured to collect a lower-level vehicle passing picture, perform preliminary identification on the lower-level vehicle passing picture to obtain initial vehicle passing data, and upload the lower-level vehicle passing picture and the initial vehicle passing data to the corresponding lower-level platform 110 in real time or at regular time. Illustratively, the bayonet devices 10, 11 and 12 corresponding to the lower platform 332600 transmit the lower passing picture and the initial passing data to the lower platform 332600; the bayonet devices 10, 11 and 12 corresponding to the lower platform 332611 transmit the lower passing picture and the initial passing data to the lower platform 332611.
The lower platform 110 may be a traffic monitoring platform installed in rural, town, county, or city level, and is configured to record and monitor the traffic condition of the current level and/or the next level, and send the recorded lower traffic data and the lower traffic picture to the upper platform 120 as required. The lower platform 110 may be implemented as a large server or a server cluster in practical implementation, which is not limited in this embodiment.
The lower platform 110 includes a lower picture database 111, and the lower picture database 111 is used for storing the lower passing pictures collected by the gate devices 10, 11 and 12, such as: vehicle pictures, license plate pictures, and the like. The lower picture database 111 may use TFS (traffic file system), but this embodiment is not limited thereto.
The lower platform 110 further includes a lower traffic database 112, and the lower traffic database 112 is used to store lower passing data. Optionally, the lower-level passing data includes: the initial vehicle passing data and the subordinate vehicle passing picture or the deep vehicle passing data and the subordinate vehicle passing picture after the secondary analysis is carried out on the initial vehicle passing data. The server corresponding to the lower traffic database 112 may belong to the same server or the same server cluster as the server corresponding to the lower picture database 111, or may belong to a different server or a different server cluster as the server corresponding to the lower picture database 111, which is not limited in this embodiment.
The upper platform 120 is a traffic monitoring platform with a higher management level relative to the lower platform 110, such as: when the lower-level platform 110 is a rural traffic monitoring platform, the upper-level platform 120 may be one or more of town, county, city, province, and country traffic monitoring platforms; when the lower platform 110 is a ballast-level traffic monitoring platform, the upper platform 120 may be one or more of county, city, province and country-level traffic monitoring platforms; and so on. The upper platform 120 is used for recording and monitoring the traffic conditions of the current level and/or the next level. The upper platform 120 may be implemented as a large server or a server cluster in practical implementation, which is not limited in this embodiment.
The upper platform 120 includes an upper picture database 121, and the upper picture database 121 is configured to store lower car passing pictures sent by the lower platform 110 and/or store upper car passing pictures sent by the current level of bayonet device. The upper picture database 120 may also adopt TFS, which is not limited in this embodiment.
Alternatively, the lower car passing pictures stored in the upper picture database 121 may be obtained by mirroring the lower picture database 111, in this case, the server corresponding to the lower picture database 111 is a main server, the server corresponding to the upper picture database 121 is a mirror server, and the mirror server reads the lower car passing pictures in the lower picture database 111 of the main server through a remote call function.
Alternatively, the lower passing picture stored in the upper picture database 121 may also be actively transmitted by the lower platform 120.
Alternatively, there are a plurality of upper picture databases 121, and each upper picture database 121 corresponds to a lower picture database in one lower platform 110. Illustratively, the first upper picture database 121 is obtained by copying, mirroring or real-time synchronizing the lower picture databases in the first lower platform 110, and the second upper picture database 121 is obtained by copying, mirroring or real-time synchronizing the lower picture databases in the second lower platform 110. Each upper level picture database 121 has a respective upper level picture database address in the upper level platform 120, such as: the first upper picture database 121 has addresses 192.168.1.102:8089, and the second upper picture database 121 has addresses 192.168.1.103: 8088.
The upper level platform 120 further includes an upper level traffic database 122, and the upper level traffic database 122 is used for storing lower level vehicle passing data and/or upper level initial vehicle passing data.
The lower passing data stored in the upper traffic database 122 is transmitted by the lower platform 110, and the upper passing data is transmitted by the gate device of the upper platform 120 and/or generated by the upper platform 120. The description of the upper-level initial passing data is the same as that of the lower-level passing data, and is not repeated herein. Optionally, the lower-level passing data stored in the upper-level traffic database 122 is sent by the lower-level platforms 110 one by one, or may be sent by the lower-level platforms 110 after being packaged, which is not limited in this embodiment.
The server corresponding to the upper traffic database 122 may belong to the same server or the same server cluster as the server corresponding to the upper picture database 121, or may belong to different servers or different server clusters as the server corresponding to the upper picture database 121, which is not limited in this embodiment.
Referring to fig. 2A, a flowchart of a data storage method according to an embodiment of the invention is shown. The present embodiment is exemplified by applying the data storage method to the data storage system shown in fig. 1, and the method includes the following steps.
Step 201, a lower platform receives initial vehicle passing data sent by a gate device.
The bayonet device corresponding to the lower platform collects the lower-level vehicle passing picture of the vehicle, preliminarily identifies the collected lower-level vehicle passing picture to obtain initial vehicle passing data, and sends the lower-level vehicle passing picture and the initial vehicle passing data to the lower platform in real time or at regular time. Accordingly, the lower platform receives the lower car passing picture and the initial car passing data. Wherein, the card port device and the lower platform have a subscription relationship, such as: the bayonet devices 10, 11 and 12 in figure 1 have a subscription relationship with the lower platform 332600.
Each piece of initial passing data includes a plurality of different types of subordinate information items such as: license plate, passing time, passing serial number, subordinate bayonet identification, identification of passing picture, vehicle body color, lane identification and the like.
Illustratively, an initial piece of passing data sent by the gate device is as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
identification of the lower-level car passing picture: p 332600000000001;
color of the car body: red;
lane marking: 101 national road.
Optionally, after receiving the lower-level car passing picture sent by the bayonet device, the lower-level platform stores the lower-level car passing picture in the lower-level picture database, and at this time, the lower-level platform adds the lower-level picture database identifier and/or the lower-level picture database address of the lower-level picture database stored in the lower-level car passing picture to the initial car passing data, so as to ensure that the lower-level platform can extract the corresponding lower-level car passing picture through the initial car passing data.
Illustratively, after the lower platform adds the lower picture database identifier and the lower picture database address to the initial vehicle passing data, the obtained initial vehicle passing data is as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
identification of the lower-level car passing picture: p 332600000000001;
color of the car body: red;
lane marking: 101, national road;
lower picture database identification: 3;
lower picture database address: 10.22.221.2:8088.
Optionally, since the lower platform may receive a plurality of pieces of initial vehicle passing data sent by a plurality of bayonet devices, in order to ensure that each piece of initial vehicle passing data is globally unique in the lower platform, the lower platform may further generate a unique key for each piece of initial vehicle passing data according to a vehicle passing serial number and a vehicle passing time in the initial vehicle passing data. Illustratively, the only key for the initial pass data is 16121000000000000006233.
Optionally, since the bayonet device can only perform preliminary identification on the lower-level car passing picture to obtain some basic lower-level information items, in order to obtain the lower-level information items of depth, the lower-level platform needs to perform secondary analysis on the lower-level car passing picture. At this time, the lower platform further adds a secondary analysis field in each piece of data, performs secondary analysis on a lower vehicle passing picture corresponding to the lower vehicle passing data according to the secondary analysis field, and adds a secondary analysis information item obtained by the secondary analysis to the initial vehicle passing data.
Illustratively, the initial passing data after adding the secondary analysis field and the secondary analysis information item is as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
identification of the lower-level car passing picture: p 332600000000001;
color of the car body: red;
lane marking: 101, national road;
lower picture database identification: 3;
lower picture database address: 10.22.221.2: 8088;
secondary analysis field: 2;
vehicle brand: audi;
the vehicle year money: 2016, money of 2016;
whether to fasten a safety belt: is that;
whether open the sunshading board: and no.
Optionally, the initial vehicle passing data may further include other information items, which is not limited in this embodiment.
Alternatively, the lower platform may store the obtained initial passing data in the traffic database.
In step 202, the lower platform adds a mapping field corresponding to a lower information item of a predetermined type.
When the lower platform needs to report the initial vehicle passing data to the upper platform in a cascading manner, the lower platform needs to add a mapping field in the initial vehicle passing data. The mapping field is a character string pre-configured in the lower platform, and the present embodiment does not limit the configuration manner of the mapping field.
Optionally, the lower platform may add a mapping field in the initial vehicle passing data when the initial vehicle passing data is received, and the timing of adding the mapping field by the lower platform is not limited in this embodiment.
In this embodiment, by adding the corresponding mapping field to the lower information item of the predetermined type, after the upper platform receives the lower vehicle passing data, the bayonet source of the lower vehicle passing data or the storage address of the lower vehicle passing picture can be determined through the mapping relationship indicated by the mapping field.
And step 203, the lower platform generates lower vehicle passing data according to the initial vehicle passing data and the mapping field.
And the lower platform combines the initial vehicle passing data and the mapping field to generate lower vehicle passing data. According to the above process, the lower-level passing data includes: n kinds of lower level information items and mapping fields having different types.
Illustratively, the lower pass data generated by the lower stage is as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
identification of the lower-level car passing picture: p 332600000000001;
lower picture database identification: 3;
lower picture database address: 10.22.221.2: 8088;
a bayonet mapping field: 0aece66afb4543ca9d631324809559c 5;
database mapping field: 0869f1ce46a8459285cef50c5d2be 147.
And step 204, the lower platform sends the lower vehicle passing data to the upper platform.
And when the lower platform needs to cascade the lower-level vehicle passing data of the lower platform to the upper platform, the lower-level vehicle passing data is sent to the upper platform. The lower platform sends lower-level vehicle passing data to the upper platform when receiving a manually triggered cascade request; or, the lower platform sends the lower vehicle passing data to the upper platform every preset time (for example, 1 day), and this embodiment does not limit the time when the lower platform sends the lower vehicle passing data.
And step 205, the upper platform receives the lower vehicle passing data sent by the lower platform.
Optionally, the upper platform may check the validity of the unique key in the lower vehicle passing data when receiving the lower vehicle passing data, such as: and checking whether the format of the unique key is in accordance with the preset format and/or checking whether the digit of the unique key is a second preset digit, wherein the mode of checking the unique key is not limited in the embodiment. When the upper platform detects the unique bonding method in the lower vehicle passing data, executing step 206; and when the superior platform detects that the unique key in the inferior vehicle passing data is illegal, discarding the inferior vehicle passing data, and ending the process.
And step 206, the superior platform maps the lower information items of the preset types according to the mapping fields to obtain the mapped superior information items.
When the lower information item of the predetermined type is a lower bayonet identification, the upper information item is an upper bayonet identification, and the upper information item is used for uniquely marking the information source of the lower passing data in the upper platform, or uniquely marking the lower bayonet in the upper platform. For example, the lower bayonet identification is 001, and the upper bayonet identification is 33260001.
When the predetermined type of the lower information item is the lower picture database identifier and/or the lower picture database address, the upper information item is the upper picture database identifier and/or the upper picture database address, and the upper information item is used for uniquely marking the storage position of the lower information item in the upper platform, optionally, the lower information item may also be the identifier of the lower passing picture. For example, the lower picture database flag and the lower picture database address are used to identify the storage location of the lower car passing picture "p 332600000000001" on the lower platform, and the upper picture database flag and the upper picture database address are used to identify the storage location of the lower car passing picture "p 332600000000001" on the upper platform.
And step 207, the upper platform replaces the lower information items of the preset types with the mapped upper information items to obtain replaced lower vehicle passing data.
When the lower information item of the preset type is a lower bayonet identification, replacing the lower bayonet identification with the mapped upper bayonet identification; when the lower information item of the preset type is a lower picture database identifier, replacing the lower picture database identifier with the mapped upper picture database identifier; and when the lower information item of the predetermined type is a lower picture database address, replacing the lower picture database address with the mapped upper picture database address.
Illustratively, the replaced lower-level passing data is as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
the upper bayonet identification: 33260010, respectively;
identification of the lower-level car passing picture: p 332600000000001;
identification of a superior picture database: 3326003, respectively;
upper picture database address: 192.168.1.102: 8089;
a bayonet mapping field: 0aece66afb4543ca9d631324809559c 5;
database mapping field: 0869f1ce46a8459285cef50c5d2be 147.
And 208, the upper platform stores the replaced lower-level vehicle passing data into a traffic database of the upper platform.
And the superior platform stores the replaced inferior vehicle passing data according to the data structure in the traffic database.
In summary, in the data storage method provided in this embodiment, the lower platform adds the corresponding bayonet mapping field to the lower bayonet identifier in the initial vehicle passing data to obtain the lower vehicle passing data, and sends the lower vehicle passing data to the upper platform; after receiving the lower-level vehicle passing data, the upper-level platform maps the lower-level bayonet identification into an upper-level bayonet identification according to the bayonet mapping field, and replaces the lower-level bayonet identification in the lower-level vehicle passing data by using the upper-level bayonet identification to obtain replaced lower-level bayonet data; the upper platform can uniquely identify the source of the lower passing data, so that when the upper platform receives the lower passing data which are sent by different lower platforms and have the same lower bayonet identification, the two lower passing data correspond to different upper platform identifications; the problem that when a superior platform receives two pieces of inferior passing data with the same inferior bayonet identification in the prior art, one of the inferior bayonet identifications can be deleted due to the conflict of the inferior bayonet identifications, so that the data corresponding to the inferior bayonet identification is possibly lost is solved; the problem of data conflict can not occur when the lower platform cascades the lower bayonet identification to the upper platform, and the integrity of the data corresponding to the lower bayonet identification is ensured.
In addition, adding a corresponding database mapping field for a lower picture database identifier in the initial vehicle passing data through a lower platform to obtain lower vehicle passing data; after receiving the lower-level car passing data, the upper-level platform maps the identifier of the lower-level picture database into the identifier of the upper-level picture database according to the mapping field of the database, and replaces the identifier of the lower-level picture database in the lower-level car passing data by using the identifier of the upper-level picture database to obtain replaced lower-level card port data; the upper-level picture database identification can uniquely identify the position of the lower-level car passing picture on the upper-level platform, so that when the upper-level platform receives the lower-level car passing pictures which are sent by different lower-level platforms and have the same lower-level picture database identification, the two lower-level car passing pictures are correspondingly provided with different upper-level picture database identifications; the problem that when an upper platform receives two lower-level car passing pictures with the same lower-level picture database identification in the prior art, one lower-level picture database identification is deleted due to data collision, and data corresponding to the lower-level picture database identification is possibly lost is solved; the problem of data conflict can not occur when the subordinate platform cascades the subordinate picture database identification to the superior platform, and the integrity of the data corresponding to the subordinate picture database identification is ensured.
In addition, adding a corresponding database mapping field for a lower picture database address in the initial vehicle passing data through a lower platform to obtain lower vehicle passing data; after the superior platform receives the inferior passing data, mapping the inferior picture database address into the superior picture database address according to the database mapping field, and replacing the inferior picture database address in the inferior passing data by using the superior picture database address to obtain the replaced inferior checkpoint data; because the upper platform can access the lower car passing picture through the upper picture database address, the problem that the upper platform cannot access the lower car passing picture through the lower picture database address in the lower car passing data when the local area networks used by the upper platform and the lower platform are different is solved; the function of displaying the lower-level car passing pictures in the lower-level platform on the upper-level platform is realized.
Optionally, the steps 201 and 204 may be implemented separately as a method embodiment on a lower platform side, and the steps 205 and 208 may be implemented separately as a method embodiment on an upper platform side, which is not limited in this embodiment.
Since the mapping fields added by the lower platforms are different for different lower information items of predetermined types, in order to more clearly understand the present invention, the following describes the manner in which the lower platforms add the mapping fields when the lower information items of predetermined types are the lower bayonet identifiers (embodiment shown in fig. 2B), and when the lower information items of predetermined types are the lower picture database identifiers and the lower picture database addresses (embodiment shown in fig. 2C).
Referring to fig. 2B, a flowchart of a data storage method according to another embodiment of the invention is shown. The present embodiment is exemplified by applying the data storage method to the data storage system shown in fig. 1, and the method includes the following steps.
In step 2011, the lower platform receives initial vehicle passing data sent by the gate device.
The description of this step is the same as step 201, and this embodiment is not described herein again. In this embodiment, the lower information item of the predetermined type is a lower bayonet identification.
The initial vehicle passing data obtained by the lower platform is assumed as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
lower picture database identification: 3;
lower picture database address: 10.22.221.2:8088.
Step 2012, the lower platform adds a bayonet mapping field corresponding to the lower bayonet identification.
The subordinate platform adds mapping fields corresponding to subordinate bayonet identification, and the mapping fields comprise: the lower platform acquires a lower platform identification; and inquiring a bayonet mapping field corresponding to the lower platform identification according to a pre-stored first mapping relation, and determining the bayonet mapping field as a mapping field corresponding to the lower bayonet identification.
The first mapping relationship at least comprises a mapping relationship between a lower platform identification and a bayonet mapping field.
Assuming that the correspondence between the lower platform id and the bayonet mapping field is as shown in the following table one, when the lower platform id of the lower platform is 332600, the bayonet mapping field is 0aece66afb4543ca9d631324809559c 5.
Table one:
| lower platform identification |
Bayonet mapping field |
| 332600 |
0aece66afb4543ca9d631324809559c5 |
| 325000 |
16d2714b437c4c388219f1f69a55ff6d |
| 314000 |
3198738d711a4fefa70f67f8e2fddebb |
Optionally, the lower platform may further pre-configure a mapping relationship between the lower platform identifier, the lower bayonet identifier, and the bayonet mapping field. Optionally, different lower level bayonet identifications of the same lower level platform correspond to different bayonet mapping fields.
Assuming that the mapping relationship among the lower platform id, the lower card socket id and the card socket mapping field is as shown in table two below, when the lower platform id of the lower platform is 332600 and the lower card socket id in the initial passing data is 001, the card socket mapping field is 0aece66afb4543ca9d631324809559c 5.
Table two:
and 2013, the lower platform generates lower vehicle passing data according to the initial vehicle passing data and the bayonet mapping fields.
The lower platform combines the initial vehicle passing data and the bayonet mapping fields to generate lower vehicle passing data, and the generated lower vehicle passing data comprises: n types of lower level information items and bayonet mapping fields having different types.
Assuming that the lower-level vehicle passing data generated by the lower-level platform according to the initial vehicle passing data and the bayonet mapping fields are as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
lower picture database identification: 3;
lower picture database address: 10.22.221.2: 8088;
a bayonet mapping field: 0aece66afb4543ca9d631324809559c 5.
And step 2014, the lower platform sends the lower vehicle passing data to the upper platform.
And when the lower platform needs to cascade the lower-level vehicle passing data of the lower platform to the upper platform, the lower-level vehicle passing data is sent to the upper platform.
In step 2015, the superior platform receives the inferior vehicle passing data sent by the inferior platform.
The related description of this step is the same as step 205, and this embodiment is not described herein again.
And 2016, mapping the lower bayonet identification by the upper platform according to the bayonet mapping field to obtain the upper bayonet identification.
The superior platform inquires the inferior platform identification corresponding to the bayonet mapping field according to a pre-stored first mapping relation; and combining the lower platform identification and the lower bayonet identification to obtain the upper bayonet identification. The lower bayonet identification is used for uniquely identifying bayonet equipment in the lower platform in the upper platform.
The upper-level platform combines the lower-level platform identification and the lower-level bayonet identification so as to add the lower-level platform identification to the front of the lower-level bayonet identification; alternatively, after the lower platform identifier is added to the lower bayonet identifier, the merging method is not limited in this embodiment.
Assuming that the first mapping relationship in the upper platform is as shown in the table i, when the upper platform receives the lower passing vehicle data exemplified in the step 2013, the table i is queried to obtain the lower platform identifier 332600 corresponding to the bayonet mapping field 0aece66afb4543ca9d631324809559c5 in the lower passing vehicle data, and 332600 is merged with the lower bayonet identifier 10 to obtain the upper bayonet identifier 33260010.
And 2017, replacing the lower bayonet identification by the upper platform through the mapped upper bayonet identification to obtain replaced lower vehicle passing data.
Assuming that the lower-level vehicle passing data received by the upper-level platform is as shown in step 2013, the replaced lower-level vehicle passing data obtained according to the replacement rule is:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
the upper bayonet identification: 33260010, respectively;
lower picture database identification: 3;
lower picture database address: 10.22.221.2: 8088;
a bayonet mapping field: 0aece66afb4543ca9d631324809559c 5.
And 2018, the superior platform stores the replaced lower-level vehicle passing data into a traffic database of the superior platform.
It is assumed that the traffic database in the upper platform is shown in table three before the upper platform receives the lower vehicle passing data, and the traffic database in the upper platform is shown in table four after the upper platform receives the lower vehicle passing data and stores the replaced lower vehicle passing data exemplified in step 2017 into the traffic data of the upper platform. Wherein, dit _ id represents an index position in the upper level traffic database; the dit _ type represents information item identification (100 represents that the type is a superior picture database identification and/or a superior picture database address; 101 represents that the type is a superior mount identification); the dit _ name is used for representing a lower bayonet identification; the fact _ value is used for indicating whether the bayonet device has a subscription relation with the corresponding platform or not (1 indicates that the subscription relation exists; 0 indicates that the subscription relation does not exist); the dit _ remap indicates a bayonet mapping field and/or a database mapping field. Of course, other data structures are also included in the traffic database of the upper level platform, such as: and storing data structures of license plate information, passing time, passing serial number and the like corresponding to the bayonet device 10.
Table three:
table four:
alternatively, step 2011-2014 may be implemented separately as a method embodiment on the lower platform side; the step 2015-2018 may be implemented as an embodiment of a method on the upper platform side, which is not limited in this embodiment.
Referring to fig. 2C, a flowchart of a data storage method according to another embodiment of the invention is shown. The present embodiment is exemplified by applying the data storage method to the data storage system shown in fig. 1, and the method includes the following steps.
Step 2021, the lower platform receives the initial vehicle passing data sent by the gate device.
The related description of this step is the same as step 201, and this embodiment is not described herein again. Wherein the predetermined type of subordinate information item is a subordinate picture database identifier and/or a subordinate picture database address.
The initial vehicle passing data obtained by the lower platform is assumed as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
lower picture database identification: 3;
lower picture database address: 10.22.221.2:8088.
Step 2022, the lower platform adds the identifier of the lower picture database and the database mapping field corresponding to the address of the lower picture database.
The subordinate platform adds a subordinate picture database identifier and a database mapping field corresponding to a subordinate picture database address, and comprises: the lower platform acquires a lower platform identification; and inquiring a database mapping field corresponding to the subordinate platform identification and the subordinate picture database address according to a pre-stored second mapping relation. The second mapping relationship comprises at least a mapping relationship between the lower platform identification and the database mapping field.
Assuming that the correspondence relationship between the lower platform id and the database mapping field is as shown in table five below, when the lower platform id of the lower platform is 332600, the database mapping field is 0869f1ce46a8459285cef50c5d2be 147.
Table five:
| lower platform identification |
Database mapping field |
| 332600 |
0869f1ce46a8459285cef50c5d2be147 |
| 325000 |
c7429863069000012b2547a01bc45700 |
| 314000 |
a7786163069abcd12b2547a01bc45700 |
Optionally, the lower platform may also pre-configure a mapping relationship among the lower platform identifier, the lower picture database identifier, and the database mapping field, so that different lower card picture database identifiers of the same lower platform correspond to different database mapping fields.
Assuming that the mapping relationship among the subordinate platform id, the subordinate picture database id, and the database mapping field is as shown in table six below, when the subordinate platform id of the subordinate platform is 332600 and the subordinate picture database id in the initial passing data is 001, the database mapping field is 0869f1ce46a8459285cef50c5d2be 147.
Table six:
| lower platform identification |
Subordinate picture database identification |
Database mapping field |
| 332600 |
3 |
0869f1ce46a8459285cef50c5d2be147 |
| 332600 |
002 |
0869f1ce46a8459285cef50c5d2be148 |
| 332600 |
003 |
0869f1ce46a8459285cef50c5d2be149 |
Of course, the lower platform may also pre-configure the mapping relationship among the lower platform identifier, the lower picture database address and the database mapping field, so that different lower card picture database addresses of the same lower platform correspond to different database mapping fields.
Step 2023, the lower platform generates lower vehicle passing data according to the initial vehicle passing data and the database mapping field.
The lower platform combines the initial vehicle passing data and the database mapping fields to generate lower vehicle passing data, and the lower vehicle passing data comprises: n, lower level information items of the type and database mapping fields.
Assuming that the lower-level vehicle passing data generated by the lower-level platform according to the initial vehicle passing data and the database mapping fields are as follows:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
lower picture database identification: 3;
lower picture database address: 10.22.221.2:8088.
Database mapping field: 0869f1ce46a8459285cef50c5d2be 147.
Step 2024, the lower platform sends the lower passing data to the upper platform.
And when the lower platform needs to cascade the lower-level vehicle passing data of the lower platform to the upper platform, the lower-level vehicle passing data is sent to the upper platform.
In step 2025, the upper platform receives the lower passing data sent by the lower platform.
The related description of this step is the same as step 205, and this embodiment is not described herein again.
2026, the superior platform maps the subordinate picture database identifier according to the database mapping field to obtain a superior picture database identifier; and mapping the address of the lower-level picture database according to the mapping field of the database to obtain the address of the upper-level picture database.
1. The superior platform maps the subordinate picture database identifier according to the database mapping field to obtain the superior picture database identifier, and the method comprises the following steps: the superior platform inquires the inferior platform identification corresponding to the mapping field of the database according to the second mapping relation; and combining the lower platform identification and the lower picture database identification to obtain the upper picture database identification.
The upper platform combines and merges the lower platform identification and the lower picture database identification to be before adding the lower platform identification to the lower picture database; alternatively, after the lower platform identifier is added to the lower picture database, the merging method is not limited in this embodiment.
Assuming that the second mapping relationship in the upper platform is as shown in table five above, when the upper platform receives the lower passing data exemplified in step 2023, the lower platform identifier corresponding to the database mapping field 0869f1ce46a8459285cef50c5d2be147 in the lower passing data is found by querying in table five as 332600, and 332600 is merged with the lower picture database identifier 3 to obtain the upper picture database identifier 3326003.
2. The superior platform maps the subordinate picture database address according to the database mapping field to obtain the superior picture database address, and the method comprises the following steps: and inquiring the upper-level picture database address corresponding to the database mapping field according to the second mapping relation.
The second mapping relationship includes a mapping relationship between the lower platform identifier and the database mapping field shown in table five, and also includes a mapping relationship between the database mapping field and the upper picture database address.
Assuming that the second mapping relationship is as shown in table seven below, when the upper platform receives the lower-level passing data exemplified in step 2023, the database mapping field 0869f1ce46a8459285cef50c5d2be147 in the lower-level passing data is queried in table seven to obtain the upper-level picture database address 192.168.1.102: 8089.
TABLE VII:
| lower platform identification |
Upper level picture database address |
Database mapping field |
| 332600 |
192.168.1.102:8089 |
0869f1ce46a8459285cef50c5d2be147 |
| 325000 |
192.168.1.102:8088 |
0869f1ce46a8459285cef50c5d2be148 |
| 314000 |
192.168.1.102:8087 |
0869f1ce46a8459285cef50c5d2be149 |
Optionally, the upper platform may also configure a mapping relationship between the lower picture database identifier and the upper picture database address, and determine an upper picture database address corresponding to the lower picture database identifier in the lower passing data according to the mapping relationship; or the upper platform can also configure a mapping relation between the address of the lower picture database and the address of the upper picture database, and determine the address of the upper picture database corresponding to the address of the lower picture database in the lower passing data according to the mapping relation; or, the upper platform may further configure a mapping relationship between the lower platform identifier and the upper image database address, and determine the upper image database address corresponding to the acquired lower platform identifier according to the mapping relationship, where the embodiment does not limit the manner of acquiring the upper image database address.
2027, the superior platform replaces the subordinate picture database mark with the superior picture database mark; and replacing the address of the lower-level picture database by using the address of the upper-level picture database to obtain replaced lower-level vehicle passing data.
Assuming that the lower passing data received by the upper platform is as shown in step 2023, the replaced lower passing data obtained according to the replacement rule is:
license plate: zhe AXXXX;
the passing time is as follows: 2016-10-1412: 30: 56;
the number of traffic passing flow is: 332600000000001, respectively;
a subordinate bayonet identification: 10;
identification of a superior picture database: 3326003, respectively;
upper picture database address: 192.168.1.102: 8089;
database mapping field: 0869f1ce46a8459285cef50c5d2be 147.
In step 2028, the upper platform stores the replaced lower-level passing data in the traffic database of the upper platform.
Assuming that the upper platform initially passes the vehicle data before receiving the lower pass vehicle data in the traffic database as shown in table three above, the upper platform receives the lower pass vehicle data and stores the replaced lower pass vehicle data as illustrated in step 2027 in the traffic data of the upper platform, and the traffic database is as shown in table eight below.
Table eight:
alternatively, the steps 2021 and 2024 can be implemented separately as a method embodiment on a lower platform side, and the steps 2025 and 2028 can be implemented separately as a method embodiment on an upper platform side, which is not limited in this embodiment.
In the prior art, a traffic flow number in each piece of initial traffic data sent by a lower platform by a bayonet device is generated according to a lower bayonet identifier and a collection sequence number, and the lower platform uses the traffic flow number as a unique key to uniquely identify each piece of initial traffic data. In this case, when different lower platforms send initial vehicle passing data collected by a gate device having the same lower gate identifier, since different initial vehicle passing data may have the same unique key, the upper platform may use the initial vehicle passing data received later to overwrite the initial vehicle passing data received earlier, thereby causing a problem of data loss. For example: when the upper-level platform stores the first initial vehicle passing data of the Hangzhou city, the first initial vehicle passing data of the Hangzhou city is used for covering the first initial vehicle passing data of the Hangzhou city after the first initial vehicle passing data of the Hangzhou city is received, so that the first initial vehicle passing data of the Hangzhou city is lost.
In order to identify each piece of initial vehicle passing data sent by the bayonet device in the lower platform, so that each piece of initial vehicle passing data is globally unique in the lower platform, and may also be globally unique in the upper platform after the initial vehicle passing data is cascaded to the upper platform, as described in step 201, in this embodiment, the bayonet device generates a vehicle passing serial number according to the identification of the lower platform and the acquisition sequence number, and generates a unique key according to the vehicle passing serial number. Because the traffic flow number comprises the lower platform identification, the source of each piece of initial traffic data can be identified according to the unique key generated by the traffic flow number, and even if the upper platform receives the initial traffic data with the same lower bayonet identification, the problem of data loss can not occur due to different corresponding unique keys.
The following describes a manner in which the lower platform generates a unique key according to the traffic flow number.
The manner in which the lower level platform generates a unique key for each piece of initial passing data includes, but is not limited to, the following.
In one approach, a lower level platform obtains a lower level platform identification; merging the lower platform identification with the sequence number to obtain a traffic-passing serial number of a first preset digit; and combining the passing serial number with the receiving time of the initial passing data to generate a unique key with a second preset digit.
The lower platform identifier is a character string of a fixed number of bits pre-stored in the lower platform, such as: a 6-bit string, the subordinate platform identification may be a region code of the subordinate platform; alternatively, the present embodiment is not limited to this, and may be a random character string or the like that does not overlap with other lower platforms. For example, a lower platform of xx is identified as 332600.
The sequence number is used for indicating the sequence of the initial vehicle passing data received by the lower platform, and the number of the sequence number is fixed, such as: the 12-bit sequence number 000000000001 represents the first piece of initial vehicle passing data received by the lower platform.
Because the lower platform identification and the sequence number are fixed in digits, the digits of the traffic serial number obtained after the lower platform identification and the sequence number are combined are fixed to be a first preset digit. The merging of the lower platform identification with the sequence number by the lower platform may be adding the lower platform identification before the sequence number; or the lower platform identification is added after the sequence number; the lower platform identifier may also be inserted into the sequence number string, and this embodiment does not limit the merging manner.
The number of bits of the receiving time of the initial vehicle passing data is fixed, and the receiving time includes at least one of year, month, day, hour, minute, second, and millisecond, which is not limited in this embodiment.
The number of the passing traffic serial number and the number of the receiving time are fixed, so that the number of the unique key obtained by combining the passing traffic serial number and the receiving time is fixed to be the second preset number. The lower platform merging the passing traffic serial number with the receiving time may be adding the passing traffic serial number before the receiving time; or adding the passing flow number to the receiving time; the merging mode may also be not limited in this embodiment, in which the passing serial number is first inverted, and then the receiving time is added before the inverted passing serial number.
Assume that the lower platform is identified as 6-bit region code 332600. For a first piece of initial vehicle passing data received by a lower platform; a 12-bit string with a sequence number of 000000000001, and a 4-bit string with a reception time of 1612 (where 16 represents year and 12 represents month, that is, 2016 year and 12 months). The lower platform combines the lower platform identification with the sequence number to obtain an 18-bit passing serial number 332600000000000001, reverses the 18-bit passing serial number to obtain a reversed passing serial number 1000000000000006233, and then adds the receiving time to the front of the reversed passing serial number to obtain a 22-bit unique key 16121000000000000006233. Because the receiving time is in the front of the unique key, the lower platform can retrieve the initial vehicle passing data according to the sequence of the receiving time when retrieving the initial vehicle passing data, and the retrieval efficiency of the initial vehicle passing data is improved.
In another mode, the lower platform acquires a lower platform identifier; and combining the lower platform identification with the sequence number to obtain a unique key with a first preset digit.
Assume that the lower platform is identified as 6-bit region code 332600. For a first piece of initial vehicle passing data received by a lower platform; a 12-bit string with a sequence number of 000000000001, and the lower platform combines the lower platform identification with the sequence number to obtain an 18-bit unique key 332600000000000001.
Of course, the lower platform may also generate the unique key in other manners, and the generation manner of the unique key is not limited in this embodiment.
Optionally, after the lower platform receives the initial vehicle passing data sent by the gate device, it may further determine a higher secondary analysis field corresponding to the gate device, and add the higher secondary analysis field to the initial vehicle passing data. And the upper secondary analysis field is used for indicating whether the upper platform carries out secondary analysis on the lower-level vehicle passing pictures collected by the bayonet device so as to obtain secondary analysis information items of the vehicle. The value of the upper secondary analysis field is the same as that of the lower secondary analysis field, such as: the upper secondary analysis field comprises any one of four values which are not needed to be subjected to secondary analysis, are required to be subjected to secondary analysis, and are successful in secondary analysis and failed in secondary analysis.
The lower platform determines an upper secondary analysis field, including:
adding a secondary analysis field of a lower level in the initial vehicle passing data sent by the gate equipment according to a third mapping relation between the identifier of the lower level gate of the gate equipment and the identifier of the key gate;
when the added value of the lower secondary analysis field is to perform secondary analysis, performing secondary analysis on the lower vehicle passing picture, and storing the obtained secondary analysis data into the lower vehicle passing data; updating the value of the secondary analysis field of the lower-level vehicle passing picture into the value of the secondary analysis success to obtain the upper-level secondary analysis field;
or,
when the added value of the secondary analysis field of the lower level is used for secondary analysis, performing secondary analysis on the picture of the lower level passing the vehicle, and updating the value of the secondary analysis field of the picture of the lower level passing the vehicle into secondary analysis failure to obtain a secondary analysis field of the upper level;
or,
and when the added lower secondary analysis field takes a value of not performing secondary analysis, determining the lower secondary analysis field as an upper secondary analysis field.
And the third mapping relation at least comprises the corresponding relation between the lower bayonet identification and the key bayonet identification. The key bayonet identification is used for indicating whether secondary analysis is needed to be carried out on the subordinate car passing pictures collected by the bayonet equipment. If the bayonet device is a key bayonet, the lower platform needs to perform secondary analysis on a lower-level vehicle passing picture collected by the bayonet device, and at the moment, the value of a lower-level secondary analysis field added by the lower platform for the initial vehicle passing data sent by the bayonet device is required to perform secondary analysis; if the bayonet device is not a key bayonet, the subordinate platform does not need to perform secondary analysis on the subordinate vehicle passing picture collected by the bayonet device, and at the moment, the value of a subordinate secondary analysis field added by the subordinate platform for the initial vehicle passing data sent by the bayonet device is that the secondary analysis is not needed.
Suppose a third mapping relationship is shown as nine below, where 0 represents not an emphasis bayonet; 1 is the key bayonet.
Watch nine
| Lower bayonet identification |
Key bayonet identification |
| 001 |
1 |
| 002 |
0 |
| 003 |
0 |
| 004 |
1 |
Wherein, the platform of subordinate carries out secondary analysis to the car picture of passing of subordinate, includes: copying the same lower-level car passing picture to obtain a first lower-level car passing picture and a second lower-level car passing picture; storing the first lower-level car passing picture in a lower-level picture database, and sending the second lower-level car passing picture to a secondary analysis platform for picture identification; and when the secondary analysis platform successfully identifies the picture, obtaining a secondary analysis information item.
Optionally, the lower-level vehicle passing picture collected by the bayonet device may include a plurality of vehicles, at this time, the secondary analysis platform in the lower-level platform may perform secondary analysis on the vehicles in the lower-level vehicle passing picture respectively to obtain secondary analysis information items corresponding to the plurality of vehicles, and adds a unique key to the secondary analysis information item corresponding to each vehicle and stores the secondary analysis information item in the traffic database of the lower-level platform.
Accordingly, when the lower platform adds the upper secondary analysis field to the initial vehicle passing data, the lower vehicle passing data sent by the lower platform to the upper platform also includes the upper secondary analysis field. After the superior platform stores the inferior vehicle passing data sent by the inferior platform in the traffic database, whether the inferior vehicle passing picture is subjected to secondary analysis is determined according to the superior secondary analysis field in the inferior vehicle passing data; when the value of the upper secondary analysis field is to perform secondary analysis, the upper platform acquires a lower vehicle passing picture corresponding to the lower vehicle passing data; carrying out secondary analysis on the lower-level car passing picture to obtain a secondary analysis information item; and adding the secondary analysis information item to the lower-level vehicle passing data in the traffic database of the upper-level platform according to the unique key of the lower-level vehicle passing data.
Referring to fig. 2D, based on the embodiment shown in fig. 2A to 2C, a specific example of a flow of sending lower-level passing data by the lower-level platform of the present invention is described below in conjunction with the above processes of generating a unique key and performing secondary analysis.
Step 2041, the lower platform receives the initial vehicle passing data sent by the gate device, and stores the initial vehicle passing data to the lower traffic database.
Step 2042, the lower platform generates a unique key for each piece of initial vehicle passing data.
And 2043, adding a secondary analysis field in each piece of initial vehicle passing data by the lower platform according to the third mapping relation.
When the gate device is a key gate, that is, when the lower platform needs to perform secondary analysis on the lower-level car passing picture collected by the gate device, adding a secondary analysis field 1 to the initial car passing data, and executing step 2044; when the gate device is not the key gate, that is, when the lower platform does not need to perform the secondary analysis on the lower-level car passing picture collected by the gate device, add the secondary analysis field 0 to the initial car passing data, and execute step 2048.
Step 2044, the lower platform performs secondary collection on the lower-level car passing picture to obtain a first lower-level car passing picture and a second lower-level car passing picture, and secondary analysis fields corresponding to the first lower-level car passing picture and the second lower-level car passing picture are both 1.
Step 2045, the subordinate platform stores the first subordinate passing picture in a subordinate picture database, stores the corresponding field 1 in a traffic database, and executes step 2048.
Step 2046, the subordinate platform updates the secondary analysis field of the second subordinate vehicle passing picture to 2, and calls a secondary analysis interface to send the second subordinate vehicle passing picture to the secondary analysis platform.
When the secondary analysis interface is successfully called, executing step 2047; and when the calling of the secondary analysis interface fails, re-executing the step of calling the secondary analysis interface in the step.
Step 2046 may be executed after step 2045, or before step 2045, or may be executed simultaneously with step 2045, which is not limited in this example.
And 2047, the subordinate platform identifies the second subordinate vehicle passing picture through the secondary analysis platform.
When the identification is successful, keeping the secondary analysis field 2 of the second lower-level vehicle passing picture unchanged, replacing the secondary analysis field 1 corresponding to the first lower-level vehicle passing picture in the lower-level traffic data by using the secondary analysis field 2, and executing step 2048; when the identification fails, the secondary analysis field 2 of the second lower-level vehicle passing picture is updated to 3, and the secondary analysis field 3 is used to replace the secondary analysis field 1 corresponding to the first lower-level vehicle passing picture in the lower-level traffic data, and step 2048 is executed.
2048, adding a bayonet mapping field corresponding to a lower bayonet identification in the initial vehicle passing data by the lower platform; adding a database mapping field corresponding to the lower picture database identifier to generate lower vehicle passing data; step 2049 is performed.
And 2049, the lower platform sends the lower vehicle passing data to the upper platform.
Referring to fig. 2E, it shows that after step 2049, the upper platform receives the lower passing data sent by the lower platform, and a specific example of the process of storing the lower passing data by the upper platform according to the present invention is described below based on the specific example shown in fig. 2E.
And step 2050, the upper platform detects whether the unique key in the lower-level vehicle passing data is legal.
When legal, go to step 2051; and when the lower-level vehicle passing data is illegal, discarding the lower-level vehicle passing data, and ending the process.
Step 2051, the superior platform maps the inferior bayonet identification in the inferior passing data into the superior bayonet identification according to the bayonet mapping field, and executes step 2052 when the mapping is successful; when the mapping fails, the flow ends.
Step 2052, the superior platform maps the inferior picture database identifier in the inferior passing data to the superior picture database identifier according to the database mapping field, maps the inferior picture database address of the inferior passing data china to the superior picture database address, and executes step 2053 when the mapping is successful; and when the mapping fails, discarding the lower-level vehicle passing data, and ending the process.
And step 2053, the superior platform stores the mapped inferior passing data into a traffic database.
Step 2054, the superior platform detects whether the gate device corresponding to the inferior gate identifier needs to perform secondary analysis according to the third mapping relation, and whether a secondary analysis field in the inferior passing data is not 1; if not, go to step 2055; if not, go to step 2056.
Step 2055, the upper platform detects whether the lower vehicle passing data indicate a main image in the lower vehicle passing picture, and if so, executes step 2056; if not, discarding the lower-level vehicle passing data, and ending the process.
And step 2056, the upper platform sets the secondary analysis field of the lower vehicle passing picture corresponding to the lower vehicle passing data to 1, and performs secondary analysis on the lower vehicle passing picture.
The description of this step is the same as that of steps 2045-2048, and is not repeated here.
Referring to fig. 3, a block diagram of a data storage device according to an embodiment of the invention is shown. The apparatus may be implemented as all or part of the management device in software, hardware or a combination of both. The apparatus may include: a receiving unit 310, a mapping unit 320, a replacing unit 330, and a storing unit 340.
A receiving unit 310, configured to implement the above steps 205, 2015, 2025 and the implicit functions related to reception in each step.
A mapping unit 320, configured to implement the above steps 206, 2016, and 2026 and the mapping related functions implied in each step.
A replacing unit 330, configured to implement the functions of the foregoing steps 207, 2017, 2027 and the related replacement implied in each step.
A storage unit 340, configured to implement the above steps 208, 2018, 2028 and the storage related functions implied in each step.
The relevant details may be combined with the method embodiment described with reference to fig. 2.
It should be noted that the mapping unit 320, the replacing unit 330 and the storage unit 340 can be implemented by a processor in a server; the receiving unit 310 may be implemented by a transceiver in a server.
Referring to fig. 4, a block diagram of a data storage device according to an embodiment of the invention is shown. The apparatus may be implemented as all or part of the management device in software, hardware or a combination of both. The apparatus may include: a receiving unit 410, an adding unit 420, a generating unit 430, a transmitting unit 440, an obtaining unit 450, and a combining unit 460.
A receiving unit 410, configured to implement the above steps 201, 2011, 2021 and the implicit function related to receiving in each step.
An adding unit 420, configured to implement the functions of the foregoing steps 202, 2012, and 2022 and the mapping implied in each step.
A generating unit 430, configured to implement the functions of the above steps 203, 2013, 2023 and the relevant replacements implied in each step.
A sending unit 440, configured to implement the above steps 204, 2014, 2024 and the implicit storage related functions in each step.
An obtaining unit 450, configured to implement the obtaining related function implicit in each step.
A merging unit 460, configured to implement the merging related function implied in each step.
The relevant details may be combined with the method embodiment described with reference to fig. 2.
It should be noted that the adding unit 420 and the generating unit 430 described above may be implemented by a processor in a server; the receiving unit 410 and the transmitting unit 440 may be implemented by a transceiver in a server.
Referring to fig. 5, a schematic structural diagram of a server according to an exemplary embodiment of the present invention is shown. The server may be a server in the lower platform shown in fig. 1, or may be a server of an upper platform, and the server includes: a processor 121, a transceiver 122 connected to the processor 121, and a memory 123.
Those skilled in the art will appreciate that the configuration of the server shown in FIG. 5 does not constitute a limitation of the server and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. Wherein:
the transceiver 122 may be comprised of one or more antennas that enable the server to send or receive electrical signals.
The transceiver 122 may be connected to the processor 121. The processor 121 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 121 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The memory 123 is connected to the processor 121 by a bus or other means, and the memory 123 may be a volatile memory (or a nonvolatile memory), a non-volatile memory (or a combination thereof). The volatile memory may be a random-access memory (RAM), such as a static random-access memory (SRAM) or a dynamic random-access memory (DRAM). The non-volatile memory may be a read-only memory (ROM), such as a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM). The non-volatile memory may also be a flash memory, a magnetic memory, such as a magnetic tape, a floppy disk, or a hard disk. The non-volatile memory may also be an optical disc.
Alternatively, the memory 123 may store lower-level passing data and mapping fields.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules may be merely a logical division, and in actual implementation, there may be another division, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.