Disclosure of Invention
(one) solving the technical problems
Aiming at the defects of the prior art, the invention provides a vehicle entry and exit recording method working in a weak network environment, which solves the problem that the existing vehicle metal recording system cannot print notes normally under the conditions of weak network, no network, network blocking and the like, so that some scenes such as vehicle running water on a construction site cannot be recorded in a networking way.
(II) technical scheme
In order to achieve the above purpose, the invention is realized by the following technical scheme: a vehicle entry and exit recording method working in a weak network environment comprises the following steps,
(1) Acquiring basic data of an administrator, logging in a vehicle, acquiring the basic data of the administrator from the background according to an ID (identity) and a token number of the administrator, storing the basic data in a local mode in a file mode, setting the ID of the administrator as a folder name, and setting the name of the administrator as the file name of the administrator;
(2) Selecting a site interface, judging whether an administrator logs in, matching the administrator with an offline data Map in a memory after the administrator logs in, taking out the json format basic data of the administrator by using the ID of the administrator, acquiring the administrator information by analyzing json, listing all site information on the site interface to enable the administrator to select a corresponding site for operation, and then, logging the site ID and the administrator ID to an administrator operation interface;
(3) The method comprises the steps that an administrator operation interface searches out construction site information corresponding to a construction site according to a construction site ID, the construction site name is displayed, a printer is connected and detected, after entering the management interface, non-uploaded data in a local database vehicle flow meter is queried according to the administrator ID and 0 and displayed on the interface, the interface is provided with two uploaded and non-uploaded tag buttons, the vehicle flow meter of the local database is queried according to the state of the tag buttons and the construction site ID, uploaded and non-uploaded electronic data are listed and cached to the page to query non-uploaded server data by default, and the page is left for cache cleaning;
(4) Scanning license plates, clicking a button of the license plate to enter a license plate recognition interface at an operation interface of an administrator, continuously capturing license plate pictures through a mobile phone camera to analyze OCR pictures, returning a picture path and the license plate numbers successfully after analysis to enter a departure interface, and storing the original pictures and a cut picture centered on the license plate numbers after analysis;
(5) The vehicle release interface finds out the picture according to the transmitted two picture addresses, writes the picture into the memory through the file stream, renders the picture through the mobile phone, and displays the picture taking the license plate as the center for a user to compare whether the license plate is correct or not;
(6) Filling basic information, and taking out a soil type, a dregs field, a square quantity and a motorcade data type set from the basic data according to the ID of the construction site;
(7) Checking data, namely detecting whether all filled data types are reasonable when clicking a release button after generating a single number;
(8) Storing into a database, if no database is locally established, creating a vehicle flow meter, inserting a piece of data into the flow meter, if the database is locally established, directly inserting a piece of data into the flow meter, creating a flow table mapping object, assigning all checked values to the flow table object, converting the original image into Base64 data, and storing the Base64 data into the database;
(9) And (3) printing, namely calling a printing method after data storage to transmit the data object to a printer for printing through Bluetooth.
Preferably, when the folder is stored, whether the folder exists locally or not is judged according to the manager ID, if so, the folder is deleted, then a file is created according to the manager ID and the name, and the basic information is written into the file in a mode of writing the file stream.
Preferably, when the folder is stored, all the site manager data are read from the heavy file and stored in the memory in a map mode, the manager ID is a key, and the manager information is a value and is cached in the memory.
Preferably, the administrator basic information includes all site information under the administrator, and the site information includes site configuration, price configuration, soil type, fleet and muck site.
Preferably, before the printer is connected and printed, whether the Bluetooth object exists should be judged first, if the Bluetooth object exists, a command for inquiring paper is sent to the printer, and the return 101 is that the connection fails or the paper is absent, the interface shows that the printer is not connected, the connection is skipped to the Bluetooth interface if the interface is clicked, if the interface is not 101, the connection is displayed, if the object does not exist, an administrator is required to click the connection printer, the connection is skipped to the Bluetooth interface for connection, and the connection is returned after the connection is successful.
Preferably, 0 in the management interface represents unsynchronized vehicle running water data, and 1 represents synchronized data.
Preferably, the basic information comprises license plate number, construction site name, earthwork unit, player, hopper size, soil type, soil pouring mode, specified residue soil field, motorcade, electronic coupon, price, entering time and exiting time.
Preferably, the basic information is automatically filled in and comprises a license plate number, a site name, an earthwork unit, a player, an entering time and an exiting time, the basic information is pulled down to select filling and manually input contents comprising a car hopper size, a soil type, a specified muck field and a car team, and the corresponding data type set can be popped up when the corresponding input frame is clicked.
Preferably, the soil pouring mode is divided into a self-pouring mode and a designated residue soil field, wherein the designated residue soil field is defaulted.
Preferably, the printing program sends a piece of detection data to the printer before proceeding to judge whether the printer is normally connected with the printer.
(III) beneficial effects
The invention provides a vehicle entry and exit recording method working in a weak network environment. The beneficial effects are as follows:
the vehicle access recording system working in the weak network environment gets rid of dependence on the network environment through an offline caching technology, can normally record and print notes even under the condition of no network, and achieves a new breakthrough.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1-2, the present invention provides a technical solution: a vehicle entry and exit recording method working in a weak network environment comprises the following steps,
s10, acquiring basic data of an administrator
After downloading the easy-to-build app, acquiring basic information of an administrator from the background according to an administrator ID and a token number, storing the basic information in a local mode in a file mode, wherein the ID of the administrator is a folder name, the name of the administrator is a file name of the administrator, judging whether the folder exists locally according to the administrator ID during storage, deleting if the folder exists locally, creating a file according to the administrator ID and the name, and writing the basic information into the file through writing of a file stream. And reading all the site manager data from the heavy file, storing the site manager data in a memory in a map mode, wherein an manager ID is a key, and caching the administrator information in the memory as a value, wherein the basic administrator information comprises site information of all the site information under the manager, and the site information comprises site configuration information, price configuration information, soil type information, motorcade configuration information, residue soil field configuration information and the like.
( For example: after the Zhang Sani is a worksite manager and logs in the app, the Zhang Sani can look like a server to request basic information of Zhang Sani, such as a manager staff site A, a worksite B and a worksite C of 3 worksites, and the manager staff site A, the worksite B and the worksite C can obtain all the information of the three worksites and store the information to the local site in a file mode )
S20, selecting a worksite interface
Firstly judging whether an administrator logs in, if so, using an administrator ID to match with an offline data Map in a memory, if so, using the administrator ID to extract basic data in json format of the administrator, then obtaining the administrator information by analyzing json, and enabling the administrator to select a corresponding site to operate by listing all site information on a site interface. Then to the administrator interface and records the job site ID and administrator ID.
( For example: and A, B, C, the interface can outline A, B, C three sites, so that the work site needing to be shifted is selected according to actual conditions, the corresponding site is selected to enter the site information interface, and the site ID and the user ID are recorded. Entering a worksite information interface )
S30, manager operation interface (printer connection detection, license plate scanning, vehicle release and running water)
And searching out the construction site information corresponding to the construction site according to the construction site ID, displaying the construction site name, detecting the connection of the printer, judging whether a Bluetooth object exists or not, if the Bluetooth object exists, sending a command for inquiring paper to the printer, returning to 101 to connect failure or lack of paper, displaying that the printer is not connected on the interface, and jumping to connect the Bluetooth interface on the interface when the printer is not connected. If the connection is not 101, the connection is displayed, if the object does not exist, the administrator needs to click the connection printer, jump to the Bluetooth connection interface for connection, and return the connection successfully (Bluetooth printer connection flow S70). The access management interface queries the local database vehicle flow meter for non-uploaded data according to the administrator ID and 0 (0 represents non-synchronized vehicle flow data and 1 represents synchronized data) and displays the non-uploaded data on the interface, the interface has two uploaded and non-uploaded tag buttons, the vehicle flow meter of the local database is queried according to the state of the tag buttons and the site ID, the uploaded and non-uploaded electronic data are listed and cached to the page to query the non-uploaded server data by default, and the data can be seen (license plate number, departure time and hopper size) every day to leave the page to clear the cache.
(e.g., the sheetlet selection site A enters the site management page, queries the local database vehicle flow meter based on the sheetlet's site ID (e.g., the sheetlet is placed 10 times, 5 times of records are synchronized with the server, and 5 times of records are data that is not synchronized with the server are available to view the corresponding data based on the tag)
S40, scanning license plate
Clicking a license plate button to carry out a license plate recognition interface, continuously grabbing license plate pictures through a mobile phone camera to carry out OCR picture analysis, returning a picture path and license plate numbers after analysis to enter a departure interface, and keeping the pictures after analysis in a local file and transmitting the pictures to the departure interface. And storing the original picture and a cut picture centering on the license plate number.
( For example: the small license plate of the mud head vehicle which wants to pass is Yue Bu3918, a button for scanning the license plate is clicked to jump to a license plate recognition interface, ocr image analysis is carried out on a continuously captured image of a camera, the recognition page is successfully closed after analysis and enters the vehicle passing interface, an original picture is a collected picture address, and a new picture is generated by cutting out the license plate picture on the original picture )
S50 vehicle release interface
S100: license plate picture display
According to the transmitted two picture addresses, finding out a picture through the address, writing the picture into the file stream, rendering the picture through the mobile phone, and displaying the picture centered on the license plate to a user to compare whether the license plate is correct or not.
S200 filling in basic information
And taking out the soil type, the muck field, the square quantity and the motorcade data type set from the basic data according to the construction site ID.
The basic information includes: license plate number, construction site name, earthwork unit, releasing person, car hopper size, soil type, soil pouring mode, appointed dregs field, motorcade, electronic coupon, price, entrance time and exit time.
The automatic filling license plate number (transmitted by license plate identification), the site name, the earthwork unit, the safety person (the data of the site information cannot be changed), the entering time and the exiting time cannot be changed when the system time of entering the page is adopted. Drop down select fill and manual input: the corresponding data type set can be popped up by clicking the corresponding input box according to the size of the hopper, the soil type, the designated dregs field, the fleet and the designated dregs field.
( For example: the small-sized hopper is provided with 12 hoppers, 16 hoppers, 20 hoppers and 40 hoppers which are manually input, a list of 12,14,20,40 is displayed for an administrator to select when the input box is clicked, the corresponding hopper number is displayed and the price is calculated when the administrator selects the corresponding hopper number input box, if the small-sized hopper is manually input now, the administrator fills in the small-sized hopper, the soil type, the designated dregs field and the fleet are identical )
The soil pouring mode and the electronic bill are two choices.
The soil pouring mode is divided into a self-pouring mode and a specified residue soil field (the default is the specified residue soil field). When clicking self-dumping, the designated muck field input box is hidden, the state of the dumping mode is recorded, and the price is calculated. When the designated muck field is selected, the designated muck field input box displays the soil dumping mode status and calculates the price.
And (3) price calculation: and calculating the price according to the size of the hopper, the soil type, the soil pouring mode and the specified residue soil field. The price may be modified.
(for example, the price list of the small sheet has two price configurations, one is the square quantity of the car hopper 20m 3 The soil type is A-type soil, the price is 400 cars, and one is 20m of the square of the car hopper 3 The slag soil field is a B slag soil field, the price is 800 car, when the car is released, if the small piece of the selected soil pouring mode is the appointed slag soil field, the car hopper is 20 cubes, the soil type is A type soil, the slag soil field is B slag soil field, that price column is filled with 800 yuan of one car, if the small piece of the earth is selected to fall by itself, the price is 400 car, and the price can be changed because the price can be changed
S300: data validation
Generating a single number: the single number is generated locally by a system, a user cannot modify the single number, the single number is unique, the offline order number is a 23-bit character string, and the composition rule is LXD+4-bit site ID (less than 0) +4-bit site manager ID (less than 0) +year+month/day/minute/second.
( For example: work site with a work site ID of 11 of Zhang Zai, sheet ID 22 is released 22 minutes and 22 seconds at 11 months 11 in 2018, no. 22, which is LXD00110022181111222222 )
Clicking the release button detects whether all filled data types are reasonable, if not, the corresponding prompt is popped up, and the release button cannot release, which is to verify the validity and the integrity of the data.
(license plate, hopper size, soil type, judging soil pouring mode, if it is a specific residue soil field, judging that the input frames of the specific residue soil field and price cannot be empty, and the hopper size and price can only be input with numbers)
S400, storing in database
If no database exists locally, creating a database to create a vehicle flow water meter, inserting a piece of data into the flow water meter, and creating a piece of directly inserted data.
A pipeline map object is created, and all checked values are assigned to the pipeline map object. The original image is converted into Base64 data and is stored in a database, and the synchronization state is unsynchronized.
( For example: the small sheets pass through the data verification, the license plate analysis original image, the administrator ID, the size of the car hopper, the type of the dregs, the pouring mode, the dregs field, the departure time, the entering time, the site name, the site ID, the name of the person placing, the price and the order number are all inserted into the database )
S500, printing:
and after the data is put in storage, calling a printing method to transmit the data object to a printer for printing through Bluetooth.
And before printing the electronic data, sending a piece of detection data to the printer to judge whether the printer is normally connected with the printer, if the printer is not connected with the printer, jumping the printer connection interface, connecting and sending the electronic data to the printer to print immediately, and if the printer is connected with the printer, sending the electronic data to the printer immediately to print. The content of the two-dimension code is printed, an order number is added to the background service interface address, and the data can be scanned and seen only by uploading.
S60, uploading data
When the function of the system detection network is called and a network result is returned, when 4G and wifi exist, a prompt popup window exists, if the data is not uploaded, the user has the data which can be synchronized, clicks and confirms to enter a data synchronization interface, local database inquiry is carried out according to the ID of the manager to list all the data which is not uploaded by the manager, then the data is directly uploaded, the image data is firstly taken out for uploading in a queue to obtain the address stored by the server, the local data is modified, the image address is filled in, the streaming data is uploaded, the next image is successfully uploaded, the image and the data are successfully uploaded, if the image and the data are successfully uploaded, the image is successfully uploaded, if the image is not successfully uploaded, the next time the data is uploaded, whether the image address is empty is judged, if the image address is empty, the image data is directly uploaded, and if the image address is not empty, the image data is uploaded. Sometimes, failure may be caused by blocking or other reasons, and the upload button may be clicked to continue uploading, and both the picture and the data succeed in modifying the status of the synchronization success field of the local database. Ensuring that the next time the upload is not repeated.
( For example: the small sheet has 4 pieces of data which are not uploaded, 1 piece of data is successful when uploading, 2 pieces of picture is unsuccessful, data is successful, 4 pieces of data is successful, the picture is unsuccessful, 3 pieces of picture data are failed, when an uploading button is clicked, the first piece of data is not uploaded, the second piece of picture is uploaded, the 4 th piece of data is uploaded, and 3 pieces of data are uploaded )
S70, printer connection flow
And (3) entering a printer connection page, detecting whether Bluetooth is started or not by the page, popping up, starting up and popping up if Bluetooth is not started, listing all printers if the Bluetooth is started, clicking the corresponding printers for connection, and if the printers are paired, not needing to input a pairing code, and if the printers are not paired, pairing the printers, wherein the pairing code is generally 0000 or 1234.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation. The term "comprising" an element defined by the term "comprising" does not exclude the presence of other identical elements in a process, method, article or apparatus that comprises the element.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.