CN104361128A - Data synchronization method of PC (Personnel Computer) end and mobile terminal based on hydraulic polling business - Google Patents

Data synchronization method of PC (Personnel Computer) end and mobile terminal based on hydraulic polling business Download PDF

Info

Publication number
CN104361128A
CN104361128A CN 201410737631 CN201410737631A CN104361128A CN 104361128 A CN104361128 A CN 104361128A CN 201410737631 CN201410737631 CN 201410737631 CN 201410737631 A CN201410737631 A CN 201410737631A CN 104361128 A CN104361128 A CN 104361128A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
data
polling
end
pc
mobile
Prior art date
Application number
CN 201410737631
Other languages
Chinese (zh)
Inventor
毛莺池
艾永平
易魁
许峰
肖海斌
周晓峰
王龙宝
邱小弟
卢吉
陈亚明
陈豪
张鹏
余记远
迟福东
周文欢
谭彬
吕兴
曹学兴
Original Assignee
河海大学
华能澜沧江水电有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30067File systems; File servers
    • G06F17/3007File system administration
    • G06F17/30073Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30067File systems; File servers
    • G06F17/3007File system administration
    • G06F17/30076Details of conversion of file system types or formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30067File systems; File servers
    • G06F17/30129Details of further file system functionalities
    • G06F17/30132Caching or prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30067File systems; File servers
    • G06F17/30129Details of further file system functionalities
    • G06F17/30174Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30067File systems; File servers
    • G06F17/30182File system types
    • G06F17/3023Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of, e.g. files

Abstract

The invention discloses a data synchronization method of a PC (Personnel Computer) end and a mobile terminal based on hydraulic polling business. The data synchronization method mainly comprises two parts of uploading polling data at the mobile terminal and downloading the polling data at the PC end, wherein uploading the polling data at the mobile terminal comprises the following steps of importing polling attribute basic information and multimedia data information in mobile equipment into the PC end, converting the basic data information into data objects through sorting operation of the polling data, storing the data objects in a database and storing multimedia data in a multimedia database to effectively manage the polling data; downloading the polling data at the PC end comprises the following steps of downloading newest hydraulic polling data to the mobile terminal from the PC end to facilitate obtaining result information of last polling when a user carries out polling at each time, and comparing with the current polling site condition to judge the hydraulic safety situation. According to the data synchronization method, the polling data can be automatically, timely and accurately put in storage conveniently, the processing time for the polling data is reduced, and the working efficiency and the accuracy for polling personnel can be improved.

Description

-种基于水工巡检业务的PC端与移动端数据同步方法 - one of the sync based on the PC side hydraulic inspection data service and the mobile terminal

技术领域 FIELD

[0001] 本发明涉及一种基于水工巡检业务的PC端与移动端数据同步方法,结合水工巡检业务的需求,用于解决水工巡检后移动端获取的数据与PC端同步的问题。 [0001] The present invention relates to a mobile terminal and the PC end data synchronization method based hydraulic service inspection, inspection of hydraulic binding demand service for the mobile terminal to solve the hydraulic acquired inspection data and PC sync The problem.

背景技术 Background technique

[0002] 巡检是水电站引水发电系统不可缺少的一个环节,能及时发现缺陷并解决缺陷, 因此巡检在水电站日常管理中有着极其重要的地位。 [0002] inspection conduits of hydropower stations is an indispensable link, and can find and resolve defects defects, so the inspection has an extremely important role in the daily management of hydropower stations. 目前,水工巡检方式主要是通过填写纸质报表实现,包括创建巡检任务,执行巡检任务,提交巡检记录,处理巡检问题和生成分析报告等流程。 Currently, the main way to achieve hydraulic inspection by filling out paper statements, including the creation of the inspection task, perform inspection tasks, submit inspection records, inspection deal with the problem and generate analysis reports and other processes. 现有水工巡检依靠巡检人员填写纸质报表的方式进行操作,面对繁多的巡检部位,每次的巡检过程均可以产生大量的巡检数据,纸质报表的数据需要巡检人员回办公地后手动录入数据库,耗时耗力,容易出错,且造成了巨大的资源浪费。 Patrol officers patrol rely on existing hydraulic fill out paper statements ways to operate in the face of many polling sites, each of the inspection process can be a large amount of inspection data, the paper reports required inspection after returning to the office staff manually entered into the database, time-consuming and labor-intensive, error-prone, and caused a huge waste of resources. 另一方面,巡检过程中产生的多媒体数据,比如大坝缺陷、险情等图片信息及视频信息,采用传统方式不易集中管理,且不易将缺陷、险情的图片视频与出险部位进行数据关联,增大了险情处理人员处理险情的难度。 On the other hand, generated during the inspection of multimedia data, such as dams defects, and other dangerous information and video image information, the traditional way is not easy to centrally manage and easy defect, video and image data of the dangerous condition of danger associated parts, by the difficulty of handling large staff to handle dangerous situations of danger. 为了提高水工巡检工作效率,更好地服务于水电站日常管理工作,开发电站水工巡检系统,将水工安全巡检过程中业务流程信息化,辅助巡检人员记录现场水工缺陷信息,实现巡检工作、消缺工作统一管理,提高工作人员的工作效率。 In order to improve the efficiency of hydraulic inspection, to better serve the daily management of hydropower stations, the development of hydraulic power station inspection system, the hydraulic safety inspection process, business process information technology, auxiliary hydraulic defect inspection personnel records site information achieve inspection work, the work of eliminating defects unified management, improve the efficiency of the staff.

[0003] 由于受到大坝内容无线通信条件的限制,现有的水工巡检系统无法完全实现终端数据的采集和监测智能化,也无法要求各个现场移动终端的数据与PC端实时保持同步,因此以PDA作为水工巡检系统终端数据采集和设置节点,构建基于移动终端的数据监测的水工巡检系统就孕育而生。 [0003] SUMMARY restricted due to dam the wireless communication condition, a conventional hydraulic system can not be fully realized collect inspection and monitoring intelligent terminal data, the data can not required each end of the PC field of the mobile terminal in real time synchronized, therefore PDA inspection system as hydraulic and setting terminal data acquisition node, building a data monitoring of the mobile terminal based on the hydraulic inspection system born out.

[0004] 个人数码助理PDA(PersonalDigitalAssistant),其优点是轻便、小巧、可移动性强,同时又不失功能的强大,PDA能够帮助终端用户完成数据采集、处理、显示、传输、管理等功能,应用范围非常广,特别适合于在移动性较强的水工巡检现场采集应用。 [0004] personal digital assistants PDA (PersonalDigitalAssistant), the advantage is lightweight, compact, mobile and strong, but yet powerful features, PDA can help end users to complete data acquisition, processing, display, transmission, management and other functions, very wide range of applications, particularly suitable for highly mobile hydraulic inspection site acquisition applications. 在每次水工巡检工作前,用户需要从PC端的数据库中下载最新的巡检数据至PDA中,用于用户本次巡检与上次巡检结果可以进行现场对比。 Before each hydraulic inspection work, users need to download from the PC side database in the latest polling data to the PDA for the user that the last inspection and inspection results on-site comparison. 另一方面,每次水工巡检完毕后,用户需要将此次巡检采集的数据上传至PC端的数据库中,用于对巡检信息进行管理、处理巡检问题跟踪、及水工安全分析报告等。 On the other hand, after each hydraulic inspection is completed, the user will need to collect inspection data uploaded to the PC side of the database, for inspection information management, processing inspection issue tracking, and hydraulic safety analysis reports.

[0005] 为了满足用户巡检前后中对巡检数据实现下载与上传需求,本发明需要解决PDA采集的水工巡检数据的本地存储,以及保持各个PDA采集的水工巡检数据与PC端存储的巡检数据的同步性,实现各个PDA移动终端与PC端实现水工巡检数据的同步与共享。 [0005] In order to meet the user before and after the inspection is implemented for inspection demand download and upload data, the present invention is to be solved locally stored PDA hydraulic acquired inspection data and inspection data of the respective holding hydraulic collected PDA and PC synchronization inspection data stored in the mobile terminal to implement various PDA and PC synchronization and sharing data hydraulic inspection.

发明内容 SUMMARY

[0006] 发明目的:针对水工巡检业务和PDA协助巡检业务的现状,本发明提供一种基于水工巡检业务的PC端与移动端数据同步方法,巡检过程采用移动终端录入方式后,解决PC 端与移动端数据同步的问题,方便巡检数据能够自动、及时、准确入库,节省巡检数据处理时间,提高巡检人员工作效率和准确性。 [0006] Object of the invention: for hydraulic assistance patrol inspection services and service status PDA, the present invention provides a PC-side hydraulic service inspection data synchronization method with a mobile terminal based on the mobile terminal inspection process using MDI after solve the problem of mobile and PC client-side data synchronization, easy inspection data automatically, timely, accurate warehousing, inspection data saving processing time and improve the efficiency and accuracy of inspection personnel.

[0007] 技术方案:一种基于水工巡检业务的PC端与移动端数据同步方法,包括巡检数据上传方法和巡检数据下载方法。 [0007] The technical solution: A terminal PC and the mobile terminal based on the hydraulic data synchronization service inspection, including inspection method and inspection data upload data download method.

[0008] (1)移动终端巡检数据上传方法,其具体步骤如下: [0008] (1) the mobile terminal polling data upload method, the following steps:

[0009] 步骤1:测试移动设备是否与PC计算机正确连接,如果正确连接,则进入步骤2; 否则,进入步骤6 ; [0009] Step 1: Test mobile device is properly connected to a PC, if properly connected, the process proceeds to step 2; otherwise, proceeds to step 6;

[0010] 步骤2 :通过adb命令,将移动设备存储卡中指定目录下所有文件均拷贝到PC计算机的指定盘符(如D盘)下的RoutingTmp文件夹中,拷贝内容包括巡检属性数据文件及多媒体文件,拷贝操作成功则进入步骤3,否则,进入步骤6 ; [0010] Step 2: RoutingTmp adb command file by the given mobile device all the memory card directory files are copied to the PC to assign a drive letter (e.g., D drive) folder, copying of contents including attribute data file patrol and the multimedia file, the copy operation is successful then proceeds to step 3, otherwise, to step 6;

[0011] 步骤3 :开始解析巡检属性数据,先将指定盘符文件夹目录下(如D:/RoutingTmp/ RoutingResult)的所有文件内容进行循环遍历读取,这些文件中包含着巡检过程中产生的属性数据。 [0011] Step 3: patrol starts to parse the attribute data, the first letter specified folder Directory: All file contents (such as D / RoutingTmp / RoutingResult) cycle through the read, these files contain the inspection process attribute data generated. 然后,根据水工巡检数据的数据库存储要求,将读取到上述各文件中的内容转化为json数据,再解析这些json数据,并同时转化成标准的json数据,最终将属性数据解析入库,属性数据入库成功则进入步骤4,否则,进入步骤6 ; Then, according to the database storage requirements of hydraulic inspection data, the respective contents of the read file data is converted into json, json then parse the data, while the data is converted into a standard json final storage attribute data analyzer , attribute data storage successfully proceeds to step 4, otherwise, to step 6;

[0012] 步骤4 :开始解析多媒体数据,将指定盘符(如D) :/RoutingTmp/RoutingFiles文件夹目录下的所有文件进行循环遍历解析,并将每个解析后的文件与多媒体数据库中存在的文件进行对比校验,若多媒体数据库中不存在该文件,则文件上传入库,否则,跳过该文件继续操作,直至所有文件操作过为止,多媒体数据入库成功则进入步骤5,否则,进入步骤6 ; [0012] Step 4: begin parsing the multimedia data, assign a drive letter (e.g., D): / RoutingTmp / RoutingFiles folder all files in the directory cycle through parsing the file and parse each of the multimedia database exists comparing the checksum of the file, if the file does not exist in the multimedia database, the file upload storage, otherwise, skips the file operation continues until all files operated until the multimedia data storage successfully proceeds to step 5, otherwise, step 6;

[0013] 步骤5 :移动设备至PC端数据同步操作成功,向用户给出提示信息,流程结束; [0013] Step 5: the mobile device to the PC-side data synchronization operation is successful, prompt information to the user, the flow ends;

[0014] 步骤6 :记录错误日志并将出错提示信息发送给用户,结束流程。 [0014] Step 6: log errors and an error message sent to the user, the process ends.

[0015] 在步骤1中,采用功能测试的方法测试移动设备是否正确连接到PC机,具体方法如下: [0015] In Step 1, a test function testing method using the mobile device is properly connected to the PC, as follows:

[0016] ①使用adb命令执行拷贝命令,将移动设备中预先存在的测试文件拷贝到PC机中指定路径下; [0016] ① using the copy command adb command, copying the pre-existing mobile device to a PC test file at the path specified;

[0017] ②查询PC机指定路径下是否存在新拷贝的测试文件,若存在,则说明移动设备与PC机的连接正常,否则,存在连接问题; [0017] ② check whether there is a new copy of the test files in the specified path PC, if there is, then the connection is normal mobile device and PC, otherwise there is a connection problem;

[0018] ③上述操作结束后,删除PC机中指定目录下的测试文件,防止对后续验证操作产生影响。 After [0018] ③ above-described operation, the PC delete files in the directory specified test, prevent influence on the subsequent verification operation.

[0019] 在步骤2中,adb命令会将移动设备中指定目录下的所有文件进行拷贝。 [0019] In Step 2, adb command will specify all mobile devices in copying files in the directory. 其中属性文件保存在RoutingResult这个文件夹中,文件夹中不存在二级目录,所有文件以"数字.json"的格式命名,其中数字代表文件保存的巡检部位编号,每个json文件保存了某巡检部位的所有巡检属性数据信息;多媒体文件保存在RoutingFiles这个文件夹中,文件夹下一级目录以YYYY-MM-DD命名,代表多媒体文件产生的日期时间,每个日期文件夹下,包含两个一级目录,分别为image和video,其中image文件夹中保存该日期中产生的所有图片信息,video文件夹中保存该日期中产生的所有视频信息。 Where the property file is saved in RoutingResult this folder, the folder does not exist in secondary directory, all files named "Digital .json" format, in which the preservation of digital documents on behalf of the site inspection number, each json file saved a all patrol inspection site attribute data; RoutingFiles multimedia files stored in the folder, a folder directory YYYY-MM-DD name, date and time on behalf of multimedia files generated under each date folder, It contains two level directory, respectively, image and video, in which the image folder to save all the pictures of the date the information generated, video folder to save all the video information generated by that date.

[0020] 步骤3的解析属性数据入库方法具体为: [0020] Step 3 parsed attribute data storage method is specifically:

[0021] ①将指定盘符文件夹目录下(如D:/RoutingTmp/RoutingResult)的所有文件的文件路径循环获取,并存放在一个List中,并将这个List命名为List_fileName; [0021] ① letter specified folder directory: all files in the file path (such as D / RoutingTmp / RoutingResult) the acquisition cycle, and stored in a List, and the name of the List list_filename;

[0022] ②循环遍历List_fileName,先读取每个文件路径下的文件内容,再将文件内容转化为json格式。 [0022] ② loop through list_filename, to read the contents of each file in the file path, then the file content into json format. 根据巡检数据入库要求,构造数据模型,将每个文件的数据通过标准化的json格式转化到数据模型对象中,并保存成一个数据模型对象的List,命名为List_ dataModel; The inspection data storage requirements, the model data structure, each data file is converted into the data model object by json standardized format and save the data to a model object List, named List_ dataModel;

[0023] ③循环遍历List_dataM〇del,获取各个数据模型对象之后,将数据模型对象中的基础表数据进行解析,存入属性信息数据库。 After [0023] ③ loop through List_dataM〇del, each acquired data model objects, the base object data model table data is parsed attribute information database stored.

[0024] ④将数据模型对象中的结果表数据进行解析,存入属性信息数据库,其中所有结果表记录均关联上述存入的基础表记录。 [0024] ④ result table model object data is parsed attribute information database is stored, in which all the results of Table records are records related underlying table above deposit. 在存入过程中,生成一个Map,将其名称为Map_ result,其key为数据模型对象中结果对象的id编号,其value为对应结果对象在数据库中的id编号。 In the deposit process, the Map generating a, as its name Map_ result, which is the key number data model object id result objects, which value results corresponding object id number in the database.

[0025] ⑤将数据模型对象中的图片表数据进行解析,存入属性信息数据库。 [0025] ⑤ picture table data model objects parse the attribute information stored in the database. 在存入过程中,生成一个Map,将其名称为Map_image,其key为数据模型对象中图片对象的id编号,其value为对应图片对象在数据库中的id编号。 In the deposit process, generate a Map, its name is Map_image, which is key for the id number data model objects in the picture of the object, its value to the corresponding picture object id number in the database.

[0026] ⑥将数据模型对象中的视频表数据进行解析,存入属性信息数据库。 [0026] ⑥ video table data model object data is parsed attribute information database stored. 在存入过程中,生成一个Map,将其名称为Map_video,其key为数据模型对象中视频对象的id编号,其value为对应视频对象在数据库中的id编号。 In the deposit process, the Map generating a, as its name Map_video, which is a key object data model id number of video objects, which video object id value corresponding number in the database.

[0027] ⑦将数据模型对象中的巡检结果一图片对应表的数据进行解析,结合Map_reSult 及Map_image,将巡检结果一图片对应表中的数据转化为实际数据库表中的对应关系,最终存入属性信息数据库。 [0027] ⑦ the inspection result data in a data model object image correspondence table parsing, and binding Map_reSult Map_image, the image data corresponding to a result of inspection of the table is converted to the corresponding relationship of the actual database tables, the final deposit attribute information into the database.

[0028] ⑧将数据模型对象中的巡检结果一视频对应表的数据进行解析,结合Map_result 及Map_vide〇,将巡检结果一视频对应表中的数据转化为实际数据库表中的对应关系,最终存入属性信息数据库。 [0028] ⑧ the inspection result data in a data model object table corresponding to the video parsing, and binding Map_result Map_vide〇, the video data corresponding to a result of inspection of the table is converted to the corresponding relationship of the actual database tables, the final attribute information stored in the database.

[0029] ⑨上述过程均结束后,一个部位的所有巡检信息完整入库,循环遍历所有数据模型对象,将所有部位的巡检信息入库后,巡检属性数据入库操作结束。 [0029] ⑨ After the above processes are completed, all parts of a complete inspection information storage loops through all of the data model object, after the inspection of all parts of information storage, the attribute data storage patrol operation ends.

[0030] 在步骤4中,解析多媒体数据入库方法具体为:解析多媒体数据,将指定盘符(如D) :/RoutingTmp/RoutingFiles文件夹目录下的所有文件进行循环遍历解析,并与多媒体数据库中存在的文件进行对比校验,若多媒体数据库中不存在该文件,则文件上传入库;否贝U,跳过该文件继续操作,直至所有文件操作过为止,其中,采用ftp文件上传的方式将多媒体文件上传至多媒体数据库。 [0030] In step 4, the multimedia data warehousing analytic method specifically comprises: parsing the multimedia data, assign a drive letter (e.g., D): / RoutingTmp / RoutingFiles folder all files in the directory cycle through parsing, and the multimedia database existing file by comparing the checksum, if the media file does not exist in the database, the file upload storage; no shell U, skips the file operation continues until all files up operated, wherein, by way of ftp file upload upload multimedia files to the multimedia database.

[0031] (2)PC端巡检数据下载方法,其具体步骤如下: [0031] (2) PC to download data terminal polling method, the following steps:

[0032] 步骤1 :测试移动设备是否与PC计算机正确连接,如果正确连接,则进入步骤2 ; 否则,进入步骤6 ; [0032] Step 1: Test mobile device is properly connected to a PC, if properly connected, the process proceeds to step 2; otherwise, proceeds to step 6;

[0033] 步骤2 :将巡检部位表、高程表、用户信息表、注意事项表的信息全部取出,放在一个json文件中,保存成文件到tempFile/data目录下,文件名称为def.json,操作成功则进入步骤3,否则,进入步骤6 ; [0033] Step 2: The inspection site table, the elevation table, the user information table, information table of all precautions taken, in a json file, to save the file to tempFile / data directory, the file name is def.json , the success of the operation goes to step 3, otherwise, proceed to step 6;

[0034] 步骤3:从巡检数据库中取出所有检查项目最近一次的记录,若巡检项目有8个, 则生成相应的8个巡检记录json文件,并保存到tempFile/data目录下,操作成功则进入步骤4,否则,进入步骤6; Once removed from the inspection database record of all recent inspection items, inspection item if there are eight, 8 is generated corresponding inspection records json file and saved to tempFile / data directory, the operation: [0034] Step 3 successful, proceed to step 4. otherwise, proceed to step 6;

[0035] 步骤4:解析出导出的所有巡检部位的巡检时间,将所有对应时间文件夹下的文件从ftp服务器中下载到tempFile/file目录下,操作成功则进入步骤5,否则,进入步骤6 ; [0035] Step 4: parsing time for all patrol inspection site derived document a corresponding time all the folder to be downloaded from the ftp server tempFile / file directory, successful operation proceeds to step 5, otherwise, step 6;

[0036] 步骤5 :将tempFile文件夹中的所有数据均拷贝到pad中的指定目录中,操作成功,流程结束,否则,进入步骤6 ; [0036] Step 5: all data tempFile folders are copied to the pad in a specified directory, the operation is successful, the procedure ends, otherwise, to step 6;

[0037] 步骤6 :记录错误日志并将出错提示信息发送给用户,结束流程。 [0037] Step 6: log errors and error message information to the user, the process ends.

[0038] 在步骤1中,采用功能测试的方法测试移动设备是否正确连接到PC计算机,具体方法如下: [0038] In Step 1, a test function testing method using the mobile device is properly connected to a PC, as follows:

[0039] ①使用adb命令执行拷贝命令,将移动设备中预先存在的测试文件拷贝到PC计算机中指定路径下; [0039] ① using the copy command adb command, copying the pre-existing mobile device to a PC test file at the path specified;

[0040] ②查询PC计算机指定路径下是否存在新拷贝的测试文件,若存在,则说明移动设备与PC机的连接正常,否则,存在连接问题; [0040] ② PC computer query to specify whether there is a new copy of the test file path, if there is, then the connection is normal mobile device and PC, otherwise there is a connection problem;

[0041] ③上述操作结束后,删除PC机中指定目录下的测试文件,防止对后续验证操作产生影响。 After [0041] ③ above-described operation, the PC delete files in the directory specified test, prevent influence on the subsequent verification operation.

[0042] 在步骤2中,将巡检部位表、高程表、用户信息表、注意事项表的属性信息封装成一个数据模型对象,分别从各表中取出对应数据后,置入数据模型对象中,待数据模型对象正确生成后,将数据模型对象转化为json格式,并保存为文件。 After [0042] In Step 2, the package inspection site attribute information table, the elevation table, the user information table, into a Notes table data model objects were removed from the respective corresponding data table, the data model objects into after the model object data to be properly generated, the data model object into json format and saved as a file.

[0043] 在步骤3中,从数据库中取出所有检查项目最近一次的记录,生成相应巡检部位数量的巡检记录json文件。 A recording [0043] removed from the database in step 3 for all test items Recently, the number of generated corresponding inspection site inspection records json file. 若存在8个巡检部位,则巡检项目有8个,生成相应的8个巡检记录json文件,其中每个巡检记录均包含基础表信息、结果表信息、图片表信息、视频表信息、结果与图片对应表信息及结果与视频对应表信息。 If there are 8 parts inspection, the inspection item has eight, to form the corresponding 8 json file inspection records, where each record contains the basis of inspection information table, a result table information, image table information, video information table results and pictures correspondence table information and results and video correspondence table information. 每个json文件生成过程中,先将每个巡检记录的属性信息封装成一个数据模型对象,分别从各表中取出对应数据后,置入数据模型对象中,待数据模型对象正确生成后,将数据模型对象转化为json格式,并保存为文件。 After each json file generation process, the first attribute information of each inspection records packaged as a model object data, the corresponding data are removed from the tables, placed in the data model object to be generated after the correct data model objects, the data model object into json format, and save it as a file.

[0044] 在步骤4中,循环获取导出的所有巡检部位的巡检时间,将其保存在一个HashSet 中,由于HashSet中的元素都是互斥的,故巡检时间不存在重复的情况。 [0044] In Step 4, get all the loop portions derived patrol inspection time, save it in a HashSet, since a HashSet elements are mutually exclusive, so that repeated inspection is the absence of time. 循环遍历上述HashSet,所有对应时间文件夹下的文件从ftp服务器中下载到tempFile/file目录下,下载的过程中每次下载的文件格式如下:文件夹以YYYY-MM-DD命名,代表多媒体文件产生的日期时间,每个日期文件夹下,包含两个一级目录,分别为image和video,其中image文件夹中保存该日期中产生的所有图片信息,video文件夹中保存该日期中产生的所有视频信息。 Loop through HashSet above, the time corresponding to all files under the folder to be downloaded from the ftp server tempFile / file directory, the download process to download each file format is as follows: in the folder named YYYY-MM-DD, representative of multimedia files date and time generated under each date folder contains two level directory, respectively, image and video, in which the image files are saved all the pictures of the date the information generated in the folder, video folder, save the date generated All video information.

[0045] 在步骤5中,采用adb命令执行文件的拷贝操作,具体拷贝文件为tempFile/data 目录下的所有文件及tempFile/file目录下的所有文件。 [0045] In step 5, using adb command file copy operation, particularly for the next copy all files and documents tempFile / file in the directory of all tempFile / data directory. 其中tempFile/data目录下存放定义表数据及相应巡检部位的最新一次巡检记录,tempFile/file目录下存放上述巡检记录对应的多媒体数据。 And wherein the respective data definition table storage site under inspection tempFile / data directory most recent inspection records, storing the multimedia data of the inspection record corresponding lower tempFile / file directory.

[0046] 有益效果:本发明提供的基于水工巡检业务的PC端与移动端数据同步方法,有效地解决了巡检过程采用移动终端录入的方式后,PC端与移动端数据同步的问题,方便巡检数据能够自动、及时、准确入库,节省巡检数据处理时间,提高巡检人员工作效率和准确性。 [0046] Advantageous Effects: The present invention provides a PC and the mobile terminal side data synchronization method based on hydraulic inspection operations, effective solution to the inspection process using the mobile terminal after the entry way, and the mobile terminal side issues PC data synchronization to facilitate the inspection data automatically, timely, accurate warehousing, inspection data saving processing time and improve the efficiency and accuracy of inspection personnel.

附图说明 BRIEF DESCRIPTION

[0047] 图1为基于水工巡检业务的PC端与移动端巡检属性信息数据库结构图; [0047] Figure 1 is based on the PC side and the hydraulic inspection service attribute information database inspection moving end configuration diagram;

[0048] 图2为基于水工巡检业务的移动终端巡检数据上传方法流程图; [0048] FIG. 2 is a mobile terminal based on hydraulic patrol inspection data upload traffic flow chart;

[0049] 图3为基于水工巡检业务的PC端巡检数据下载方法流程图; [0049] FIG. 3 is a side PC patrol inspection data download service based on hydraulic flowchart;

[0050] 图4为基于水工巡检业务的PC端巡检数据下载方法中巡检文件结构图。 [0050] FIG 4 is a configuration diagram of the PC file patrol inspection data download method based on the inspection of hydraulic service.

具体实施方式 detailed description

[0051] 下面结合具体实施例,进一步阐明本发明,应理解这些实施例仅用于说明本发明而不用于限制本发明的范围,在阅读了本发明之后,本领域技术人员对本发明的各种等价形式的修改均落于本申请所附权利要求所限定的范围。 [0051] The following embodiments with reference to specific embodiments, further illustrate the present invention, it should be understood that these embodiments are illustrative only and the present invention is not intended to limit the scope of the present invention, after reading this disclosure, those skilled in the art of the various invention the modifications are equivalents fall within the present application as defined by the appended claims scope.

[0052] 图1是本实施例的巡检属性信息数据库结构图。 [0052] FIG. 1 is a configuration diagram of the inspection attribute information database according to the present embodiment. 本实施例中提及的属性信息数据库包含巡检部位及高程、位置表,巡视结果表,巡检记录基表,结果-图片关联表,图片表, 结果-视频关联表、视频表和部位表。 Attribute information database mentioned embodiment of the present embodiment comprises inspection location and elevation, position table, inspection result table, the base table record inspection results - picture association table, the table image, the result - Video association table, the table and the video portion of the table . 巡检结果存放在巡视结果表中,可以看到,巡检结果分为巡检记录基表(即属性数据信息)和多媒体数据信息(图片表和视频表)。 Inspection result in the inspection result table, it can be seen patrol inspection result into the recording table group (i.e., data attribute information) of data and multimedia information (video image table and the table). 针对不同的巡检部位,建立了巡检部位及高程、位置表和部位表。 For different parts of the inspection, the establishment of a polling location and elevation, and location position table table. 针对属性信息中记录多媒体数据信息和巡检结果的对应关系,建立巡检结果-图片关联表和巡检结果_视频关联表。 Attribute information for multimedia data recorded in the corresponding relationship information and the results of the inspection, the establishment of inspection results - picture association table and inspection results _ video associated table.

[0053] 移动终端巡检数据上传可以完成将移动设备中的巡检属性基本信息和多媒体数据信息导入到PC端中,通过对巡检数据的分类处理,可以将基本数据信息转化为数据对象,存入数据库,将多媒体数据存入多媒体数据库,可以有效管理巡检数据;PC端巡检数据下载,可以从PC端下载最新的水工巡检数据至移动终端,方便用户在每次巡检时获得上次巡检的结果信息,并可以与当前巡检现场情况进行比较,评判水工安全情况。 [0053] The mobile terminal can complete data upload patrol inspection import mobile device attribute information and the basic information of the multimedia data to the PC side by the sorting process of inspection data, basic data can be converted to data objects, when the PC download inspection data, can be downloaded from the PC side hydraulic latest inspection data to the mobile terminal user at each inspection; stored in the database, the multimedia data stored in the multimedia database, inspection data efficiently manage last inspection results obtained information, and can be compared with the current situation on-site inspection, evaluation of hydraulic security situation.

[0054] 图2是基于水工巡检业务的移动终端巡检数据上传方法流程图。 [0054] FIG 2 is a flowchart of a hydraulic service patrol inspection data upload method of a mobile terminal. 下面结合图2对移动终端巡检数据上传方法进行详细说明。 Described in detail below in conjunction with two pairs of mobile terminals to inspect the data upload method of FIG.

[0055] (S201)执行adb拷贝命令,如adbpulldata/databases/test.dbc:/windows/ db,将移动终端中预先存储的测试文件tset.db拷贝到PC端中指定路径,如c:/windows/ db; [0055] (S201) performed adb copy command, as adbpulldata / databases / test.dbc: / windows / db, the mobile terminal previously stored test files copied to the PC tset.db specified path, such as c: / windows / db;

[0056] (S202)查询PC端c:/windows/db目录下是否存在测试文件tset.db,若存在,贝丨J 说明移动终端与PC端连接正常,转入(S203);否则,说明移动终端与PC端连接存在问题, 提示用户检查连接设备或数据连接线,转入(S217); [0056] (S202) the query PC side c: / tset.db the presence or absence of test files windows / db directory, if present, the mobile terminal described shellfish Shu J PC side is connected, transferred (S203); otherwise, a moving PC terminal connected to the terminal there is a problem, prompting the user to check the connection device or data cable into (S217);

[0057] (S203)删除PC端c:/windows/db目录下的tset.db文件,防止对后续验证操作产生影响。 [0057] (S203) to delete the PC-side c: / windows / tset.db file in db directory, prevent influence on the subsequent verification operation.

[0058] (S204)执行adb拷贝命令,如adbpulldata/databasesD:/RoutingTmp,将移动终端中指定目录data/databases/的所有文件拷贝到PC端指定D:/RoutingTmp目录下。 [0058] (S204) performed adb copy command, as adbpulldata / databasesD: / RoutingTmp, the mobile terminal will copy all files in the specified directory data / databases / PC to a designated end of the D: / RoutingTmp directory. 在data/databases目录中,所有巡检属性数据信息保存在D:/RoutingTmp/RoutingResult文件夹中,其中所有文件均以"数字.json"的格式命名,其中数字代表文件保存的巡检部位编号,每个json文件保存了某巡检部位的所有巡检属性数据信息。 In data / databases directory, all inspection data attribute information stored in the D: / RoutingTmp / RoutingResult folder, where all documents are "Digital .json" naming format in which to save the digital file on behalf of the site inspection number, each json file saved in a polling site inspection of all property data.

[0059] 以I.json为例说明,I.json文件内容如下。 [0059] to I.json an example, I.json document reads as follows.

[0060] {"baseTable": {"addition": "basergionld": 1,"condition":"无运行","do wnLevel":996. 12, 〃id〃:90, ''rainfalICondition〃:0, ''recorder〃:admin",''releaseCond ition〃:0, ''routingHead〃:〃admin",''routingStaff〃:〃admin",''routingTime〃:〃2014-07-1808:00:00","upLevel":1205. 63},"imageList":[{"id":62,"name":"20140718131438. jpg","path":"20140718/image/20140718131438.jpg", "size":null}],"imageResultMap List〃: [{〃id〃: 50, ''resultld〃: 842, ''routingPhotoesId〃: 62}],''resultList〃:[{''baseTa bleld〃: 90,''describe〃:〃 不会〃,〃id〃: 842,〃itemld〃: 1,''result〃: 11,''rgionld〃: 1} ],〃v ideoList〃: [],''videoResultMapList〃: []} [0060] { "baseTable": { "addition": "basergionld": 1, "condition": "no run", "do wnLevel":. 996 12, 〃id〃: 90, '' rainfalICondition〃: 0, '' recorder〃: admin ", '' releaseCond ition〃: 0, '' routingHead〃: 〃admin", '' routingStaff〃: 〃admin ", '' routingTime〃: 〃2014-07-1808: 00:00" , "upLevel":. 1205 63}, "imageList": [{ "id": 62, "name": ". 20140718131438 jpg", "path": "20140718 / image / 20140718131438.jpg", "size": null}], "imageResultMap List〃: [{〃id〃: 50, '' resultld〃: 842, '' routingPhotoesId〃: 62}], '' resultList〃: [{ '' baseTa bleld〃: 90, '' describe〃: not 〃 〃, 〃id〃: 842, 〃itemld〃: 1, '' result〃: 11, '' rgionld〃: 1}], 〃v ideoList〃: [], '' videoResultMapList〃: [ ]}

[0061] 可以看出json文件包含了基本数据信息表baseTable、文件数据信息中图片数据信息表imageTable、图片数据信息存储结果List表imageResultMapList、基本数据信息存储结果List表ResultList、视频数据信息表videoTable和视频数据信息存储结果List表videoResultMapList〇 [0061] As can be seen json file contains basic data information table baseTable, image data information file data information table imageTable, image data information storing results List table imageResultMapList, basic data information table storing results List ResultList, video and data information table videoTable List of video data storage results in table videoResultMapList〇

[0062] 多媒体信息包含照片和视频文件,按照生成日期进行分类存储,多媒体文件保存在D:/RoutingTmp/RoutingFiles文件夹中,文件夹下一级目录以日期命名,代表多媒体文件产生的日期时间,每个日期文件夹下,包含两个一级目录,分别为image和video,其中image文件夹中保存该日期中产生的所有图片信息,video文件夹中保存该日期中产生的所有视频信息。 [0062] Multimedia information includes photos and video files, are classified according to the stored creation date, a multimedia file saved in D: / RoutingTmp / RoutingFiles folder, a directory folder named by date, time multimedia file represents the date created, under each date folder contains two level directory, respectively, image and video, all the pictures stored in the date information generated in which the image folder, video folder to save all the video information generated by that date.

[0063] (S205)判断拷贝操作是否成功,成功则继续,转入(S206);否则,失败,转入(S217)并报错。 [0063] (S205) determines whether the copy operation is successful, success continues, transferred (S206); otherwise, the failure transferred (S217) and error.

[0064] (S206)解析巡检属性数据入库。 [0064] (S206) attribute data warehousing analytic inspection. 巡检属性数据是指巡检属性数据信息。 Patrol inspection data refers to the attribute information of the attribute data. 将文件夹目录下(如D:/RoutingTmp/RoutingResult)的所有文件的文件路径循环获取,并存放在一个List中,同时,将该List文件命名为List_fileName,其内容如下:D:/RoutingTmp/ RoutingResult/1.json,D:/RoutingTmp/RoutingResult/2.json,......,通过该List文件可以查询到所有属性数据信息文件的路径信息。 The folder directory (such as D: / RoutingTmp / RoutingResult) file path acquisition cycles for all files, and stored in a List, simultaneously, the file is named list_filename List, which reads as follows: D: / RoutingTmp / RoutingResult /1.json,D:/RoutingTmp/RoutingResult/2.json, ......, you can query the data path information all the attributes of a file by the List file.

[0065] (S207)循环遍历List_fileName文件,将D:/RoutingTmp/RoutingResult/l.json, D:/RoutingTmp/RoutingFiles/2.json,......等文件依次读取文件内容。 [0065] (S207) loop through List_fileName file, the D: /RoutingTmp/RoutingResult/l.json, D: /RoutingTmp/RoutingFiles/2.json, ...... and other documents sequentially read the contents of the file.

[0066] 以I.json为例说明巡检属性数据入库过程。 [0066] In an example I.json inspection attribute data storage process.

[0067] I.json中包含了巡检部位1中所有的属性信息,由于该json文件可能存在格式不规范、存储该文件的移动设备编码格式与PC端不一致等问题,需要进行该文件标准化校验操作,将I.json文件内容读出,存入完成标准化校验后的I.json文件中,可以完成文件标准化操作,处理后的1 •json如下。 [0067] I.json contains all the attribute information in an inspection site, since there may be the json file format is not standardized, the mobile storage device encoding format inconsistent with the PC issues the file, the file needs to be normalized correction test operation, the contents of the file I.json read out after the completion of the file stored I.json calibration standardization, the standard operating files can be done, after treatment 1 • json follows.

[0068] [0068]

Figure CN104361128AD00111

[0069] (S208)将数据转化到数据模型对象,并保存成一个数据模型对象的List。 [0069] (S208) the converted data to the data model object, and save it as a List object data model.

[0070] 以经过标准化操作后的I.json为例说明。 [0070] In the standardized operation I.json an example. I.json文件中存在存储属性信息的巡检记录基表、图片表、结果-图片关联表、结果表、视频表和结果-视频关联表6个对象,可以将这6个对象转化到数据模型对象中,并保存成一个数据模型对象的List,命名为List_ dataModel。 The attribute information storage file exists I.json inspection records the base table, the table image, the result - picture association table result table, tables, and video Results - Table 6 associated video objects, the object can be transformed into these six data model object, List and save it as a data model object, named list_ dataModel. 对于I.json文件,List_dataModel.list中存储的信息如下: For I.json file, the information stored in List_dataModel.list follows:

[0071] dataModel.baseTable.addition= 0 ; [0071] dataModel.baseTable.addition = 0;

[0072] dataModel.baseTable.basergionld= 1;(注释:此处可以看出,dataModel. baseTable.basergionld用来标志该数据模型对象所在的巡检部位。) [0072] dataModel.baseTable.basergionld = 1; (Note: It can be seen here, dataModel baseTable.basergionld inspection site to mark the data model object is located.)

[0073] ......(baseTable中其他属性格式如上,下面省略号含义同此处。) [0073] ...... (baseTable in formats other properties as described above, with the following meaning ellipses here.)

[0074] dataModel.imageList.contentOl=null; [0074] dataModel.imageList.contentOl = null;

[0075] ...... [0075] ......

[0076] dataModel.imageResultMapList.id= 50 ; [0076] dataModel.imageResultMapList.id = 50;

[0077] ...... [0077] ......

[0078] dataModel.resultList.baseTableld= 90 ; [0078] dataModel.resultList.baseTableld = 90;

[0079] ...... [0079] ......

[0080] dataModel.videoList= 0 ; [0080] dataModel.videoList = 0;

[0081] dataModel.videoResultMapList= 0 ; [0081] dataModel.videoResultMapList = 0;

[0082] (S209)循环遍历List_dataModel.list文件,将文件中的属性数据存入属性信息数据库中。 [0082] (S209) List_dataModel.list loop through the file, file attribute data in the attribute information stored in the database.

[0083] (S210)解析数据模型对象中的结果表ResultList数据,存入属性信息数据库。 ResultList result table data [0083] (S210) analysis data model object, the attribute information stored in the database.

[0084] (S211)结果表ResultList中的所有记录均关联上述存入的属性信息数据库记录。 [0084] (S211) The results of all records in the table are ResultList attribute information database record associated with the above-described deposited. 关联关系通过生成Map文件的方式建立。 Association established by way of generating Map file.

[0085] 存入过程中,生成一个Map文件,命名为Map_result,其key为数据模型对象中结果对象的id编号,其value为对应结果对象在数据库中的id编号。 [0085] stored in the process, generates a Map file named Map_result, which is the key number data model object id result objects, which value results corresponding object id number in the database.

[0086] 将数据模型对象中的结果与图片对应表的数据进行解析,结合Map_result及Map_image,将数据转化为实际数据库表中的对应关系,最终存入属性信息数据库。 [0086] The model object data result analyzing image correspondence table, and binding Map_result Map_image, the data is converted to the corresponding relationship between the actual database tables, stored in the attribute information database eventually.

[0087] 将数据模型对象中的结果与视频对应表的数据进行解析,结合Map_result及Map_vide〇,将数据转化为实际数据库表中的对应关系,最终存入属性信息数据库。 [0087] The resulting data model object for parsing the video data correspondence table, and binding Map_result Map_vide〇, the assignment of the actual data into the database tables, stored in the attribute information database eventually.

[0088] 上述过程均结束后,一个部位的所有巡检信息完整入库,循环遍历所有数据模型对象,将所有部位的巡检信息入库后,巡检属性数据入库操作结束。 After [0088] the above-described processes are completed, all the information is complete inspection of a storage site, loops through all the data model object, after the inspection of all parts of information storage, the attribute data storage patrol operation ends.

[0089] (S212)解析多媒体数据入库。 [0089] (S212) parsing multimedia data storage. 解析多媒体数据,将D:/RoutingTmp/RoutingFiles 文件夹目录下的所有文件进行循环遍历解析,D:/RoutingTmp/RoutingFiles文件夹目录下包含多个文件夹,以YYYY-MM-DD命名,代表多媒体文件产生的日期时间,每个日期文件夹下,包含两个目录,分别为image和video。 Parsing the multimedia data, the D: / RoutingTmp / RoutingFiles folder all files in the directory cycle through parsing, D: under / RoutingTmp / RoutingFiles folder directory includes a plurality of folders to YYYY-MM-DD named representative multimedia file date and time created, each date folder that contains two directories, respectively, image and video.

[0090] (S213)解析过程中,比较多媒体数据文件夹目录下的多媒体数据文件和多媒体数据库中的多媒体文件。 [0090] (S213) the resolution process, comparing the multimedia data and the multimedia data file folder multimedia database multimedia files in the directory.

[0091] (S214)判断多媒体数据库中是否存在该文件,若存在,则转入(S214),否则,转入(S215)。 [0091] (S214) determines whether the file exists in the multimedia database, if present, the process proceeds to (S214), otherwise, proceeds to (S215).

[0092] (S215)判断是否已经执行完所有文件,若已执行完所有文件,则此模块结束;否贝IJ,转入(S216)。 [0092] (S215) determines whether or not all files have been executed, performing all file Ruoyi finished, the module ends; No shell IJ, transferred (S216).

[0093] (S216)文件通过移动终端上传入库,采用ftp文件上传的方式将多媒体文件上传至多媒体数据库。 [0093] (S216) the mobile terminal storage file upload, by way of ftp file upload multimedia files will be uploaded to a multimedia database. 例如,D:/RoutingTmp/RoutingFiles/20140729/image文件夹中存在一张命名为20140729172301.jpg的图片,D:/RoutingTmp/RoutingFiles/20140729/ video文件夹中存在一段命名为20140729172301.avi的视频。 For example, D: there is a folder / RoutingTmp / RoutingFiles / 20140729 / image file a name 20140729172301.jpg picture, D: / RoutingTmp / RoutingFiles / 20140729 / video folder named 20140729172301.avi existed for some video. 多媒体数据库按照这个文件目录保存文件,比较文件是否已经存在的方法是比较文件路径,如/RoutingTmp/ RoutingFiles/20140729/image文件夹中是否存在一张命名为20140729172301.jpg的图片,若存在,说明多媒体数据库中存在该文件,不需上传,若不存在,采用ftp文件上传的方式将多媒体文件上传至多媒体数据库。 According to this multimedia database file directory to save the file, the file already exists compare whether the method is to compare the file path, if there is a picture such as name 20140729172301.jpg / RoutingTmp / RoutingFiles / 20140729 / image folder, if present, indicating Multimedia the file exists in the database, without uploading, if not, by way of ftp file upload to upload multimedia files to the multimedia database.

[0094] (S217)记录错误日志并将出错信息发送给用户。 [0094] (S217) log errors and error information to the user.

[0095] 图3是基于水工巡检业务的PC端巡检数据下载方法流程图。 [0095] FIG. 3 is a PC-side hydraulic service patrol inspection data download method based on the flow chart. 下面结合图3对PC端巡检数据下载模块进行详细说明。 FIG. 3 below inspection data terminal PC is described in detail in conjunction with the download module.

[0096] (S301)执行adb拷贝命令,如adbpulldata/databases/test.dbc:/windows/ db,将移动终端中预先存储的测试文件tset.db拷贝到PC端中指定路径,如c:/windows/ db; [0096] (S301) performed adb copy command, as adbpulldata / databases / test.dbc: / windows / db, the mobile terminal previously stored test files copied to the PC tset.db specified path, such as c: / windows / db;

[0097] (S302)查询PC端c:/windows/db目录下是否存在测试文件tset.db,若存在,贝丨J 说明移动终端与PC端连接正常,转入(S303);否则,说明移动终端与PC端连接存在问题, 提示用户检查连接设备或数据连接线,转入(S309); [0097] (S302) the query PC side c: / tset.db the presence or absence of test files windows / db directory, if present, the mobile terminal described shellfish Shu J PC side is connected, transferred (S303); otherwise, a moving PC terminal connected to the terminal there is a problem, prompting the user to check the connection device or data cable into (S309);

[0098] (S303)删除PC端c:/windows/db目录下的tset.db文件,防止对后续验证操作产生影响。 [0098] (S303) to delete the PC-side c: / windows / tset.db file in db directory, prevent influence on the subsequent verification operation.

[0099] (S304)将PC端数据库表(巡检部位表、高程表、用户表、注意事项表)中的信息全部取出,存储在一个命名为def.json的json文件中,并将此文件保存在tempFile/data目录下。 [0099] (S304) The information of the PC-side database table (table inspection site, the elevation table, a user table, note table) all removed, stored in a named def.json the json file and this file stored at tempFile / data directory.

[0100] 如用户表中admin的信息可以转化为: [0100] The user information table admin can be converted to:

[0101] [0101]

Figure CN104361128AD00131

[0102] (S305)从数据库中取出所有巡检项目最近一次的记录,每个巡检项目对应的巡检记录包含基础表信息baseTable、结果表信息resultList、图片表信息imageList、视频表信息videoList、结果与图片对应表信息imageResultMapList及结果与视频对应表信息videoResultMapList。 A recording [0102] (S305) removed from the database of all recent inspection items, each item corresponding to the inspection comprises inspection records information BaseTable base table, the results of Table resultList information, table information imageList image, video VideoList table information, results and pictures and video information and results imageResultMapList correspondence table information videoResultMapList correspondence table. 将属性信息封装成数据模型对象,再转化为json格式。 Attribute information into the data model object, and then converted to json format.

[0103] 如巡检记录基表baseTable中存在如下属性:注意事项addition、部位编码basergionld、建筑物运行情况condition、下游水位downLevel、巡检记录标识id、降雨情况rainfallCondition、记录人recorder、泄洪情况releaseCondition、巡检负责人routingHead、巡检人员routingStaff、巡检时间routingTime、上游水位upLevel, baseTable表中也有每个属性对应的value。 [0103] As there is a property inspection records in the base table baseTable: Note addition, parts of the coding basergionld, building operation condition, the downstream water level downLevel, inspection records identification id, rainfall rainfallCondition, who recorded recorder, where spillway releaseCondition , person in charge of inspection routingHead, inspection personnel routingStaff, inspection time routingTime, the upstream water level upLevel, baseTable also table corresponding to each attribute value.

[0104] 将baseTable表转化为数据对象,结果如下: [0104] The conversion table baseTable data object, the following results:

[0105] baseTable.addition= 0 ;//定义巡检记录基表对象中注意事项属性,值为0 [0105] baseTable.addition = 0; // define inspection records table object group attribute considerations, a value of 0

[0106] baseTable.basergionld= 1 ;//定义巡检记录基表对象中部位编码属性,值为1 [0106] baseTable.basergionld = 1; // define inspection records in the base table site encoding target attribute value is 1

[0107] ……(此处省略为baseTable表中其他属性的转化结果) [0107] ...... (omitted here for the results of the other properties baseTable conversion table)

[0108] 下面将基于baseTable表生成的数据对象转化为标准json语句,结果如下: [0108] Next, based on the conversion table generated by the data object baseTable json standard statement, as follows:

[0109] [0109]

Figure CN104361128AD00141

[0111] 同样的,可以将结果表信息resultList、图片表信息imageList、视频表信息videoList、结果与图片对应表信息imageResultMapList及结果与视频对应表信息VideoResultMapList转化为标准json语句,根据巡检部位的不同,依次可以存为命名为I.json>2.json......,json文件数量与巡检检查项目数量一致。 [0111] Similarly, the results may be resultList table information, table information imageList image, video VideoList table information, result information imageResultMapList image correspondence table and the table corresponding to the video information and the result into standard json VideoResultMapList statement, depending on site inspection in turn can be saved as named I.json> 2.json ......, json file number equal to the number of patrol inspection items.

[0112] (S306):循环获取导出的每个巡检部位的巡检时间,将其保存在一个HashSet中, 如巡检部位1 中baseTable中routingTime的value为2014-07-1808:00:00,由于多媒体数据库中的文件夹是以YYYY-MM-DD形式命名,取20140718为巡检部位1的最近一次的巡检时间,将这个时间保存在新建的HashSet中。 [0112] (S306): Get each loop portion derived patrol inspection time, save it in a HashSet, as in the inspection portion 1 baseTable routingTime the value is 2014-07-1808: 00: 00 Since multimedia database folder is YYYY-MM-DD form name, take 20,140,718 for the inspection of the site of the most recent inspection time 1, this time is stored in the newly created HashSet.

[0113] (S307)获取巡检时间结束后,循环遍历上述HashSet,将所有对应时间文件夹下的文件从ftp服务器中下载到tempFile/file目录下,每次下载的文件格式如下:文件夹以YYYY-MM-DD形式命名,代表多媒体文件产生的日期时间,每个日期文件夹下,包含两个一级目录,分别为image和video。 [0113] (S307) after time acquisition completion inspection, loop through HashSet above, the time corresponding to the file folder all downloaded from the ftp server to tempFile / file directory, each download file format is as follows: in a folder YYYY-MM-DD form name, date and time on behalf of multimedia files generated under each date folder contains two level directory, respectively, image and video. 其中image文件夹中保存该日期中产生的所有图片信息, video文件夹中保存该日期中产生的所有视频信息。 In which the image folder to save all the pictures of the date the information generated, video folder to save all the video information generated by that date.

[0114] 如下载的文件路径为D:/tempFile/file/20140718/image/20140718181801.jpg, 代表这个文件为2014年7月18日产生的命名为20140718181801.jpg的图片文件。 [0114] As the downloaded file path is D: /tempFile/file/20140718/image/20140718181801.jpg, on behalf of this file is named July 18, 2014 generated as 20140718181801.jpg picture files.

[0115] (S308)采用adb命令执行文件的拷贝操作,将tempFile/data目录下的所有文件(I.json、2.json......)及tempFile/file目录下的所有文件(多媒体文件)拷贝到移动设备中。 [0115] (S308) using the copy operation command adb files, all files under tempFile / data directory (I.json, 2.json ......) and all documents in the tempFile / file directory (Multimedia files) copied to the mobile device.

[0116] 指令如下:adbpullD:D:/tempFile/datadata/tempFile/data;可以查看移动设备中对应文件目录下拷贝完成的文件,并使用移动设备对其进行操作管理。 [0116] instructions are as follows: adbpullD: D: / tempFile / datadata / tempFile / data; can see the complete copy of the file directory corresponding to the mobile device in the file, and a mobile device using its management operations.

[0117] (S309)记录错误日志并将出错信息发送给用户。 [0117] (S309) log errors and error information to the user.

[0118] 如图4所示,PC端巡检数据下载方法中巡检文件结构图实例,包含巡检文件根目录401 (图中D:/RoutingTmp401),属性数据文件夹402 (图中RoutingResult402),属性数据json文件403(图中I.json、2.json......),多媒体数据文件夹404(图中RoutingFiles 404),日期子文件夹405 (图中起始日期,……,结束日期),图片子文件夹406 (图中Image406)和视频子文件夹407 (图中Video407)。 [0118] 4, PC download process ends patrol inspection data file structure of FIG example, the root directory contains files inspection 401 (FIG. D: / RoutingTmp401), attribute data folder 402 (FIG RoutingResult402) , json attribute data file 403 (FIG I.json, 2.json ......), the multimedia data folder 404 (FIG RoutingFiles 404), date of subfolders 405 (FIG start date, ...... , end date), images subfolder 406 (figure Image406) and video subfolders 407 (figure Video407).

[0119] 在S204中,已说明此处文件结构的内容。 [0119] In S204, the content here has been described file structure. 从移动终端中通过adb命令将巡检文件拷贝到PC端巡检文件根目录401中,其中属性数据存储在属性数据文件夹402中,再按照巡检部位存储在以巡检部位对应的数字命名的json文件中,如403属性数据文件I.json。 Adb by command from the mobile terminal to copy files to the PC patrol inspection document root end 401, wherein the attribute data stored in the attribute data file folder 402, a digital to rename patrol inspection portion according to the corresponding storage site the json file 403 as attribute data file I.json. 多媒体数据先存储在多媒体数据文件夹404中,再按照日期创建日期子文件夹405,最后根据类别将图片文件和视频文件分别存储在图片子文件夹406和视频子文件夹407中。 Multimedia data is first stored in the multimedia data folder 404, and then by date creation date subfolders 405, according to the last class picture and video files are stored 406 video and 407 subfolders in the picture subfolder.

Claims (9)

  1. 1. 一种基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,包括移动终端巡检数据上传方法和PC端巡检数据下载方法两个部分: (一) 移动终端巡检数据上传方法: (1) 测试移动终端是否与PC端正确连接; (2) 将移动终端中指定目录下文件拷贝到PC端指定文件夹中; (3) 解析巡检属性数据,将巡检属性数据转化为json数据,封装成符合要求的新json 数据,然后解析入库; (4) 解析巡检多媒体数据,通过与巡检多媒体数据库中存在的文件进行对比校验,将不存在的文件上传入库; (二) PC端巡检数据下载方法: (5) 测试移动终端与PC端是否正确连接; (6) 将需要导出的数据库表巡检信息放入json文件中; (7) 查找出数据库中最近一次巡检记录,生成巡检记录json文件; (8) 解析巡检时间,将对应时间文件夹下的文件下载到指定目录; (9) 通过adb命令将最 PC side and the mobile terminal 1. A method for synchronizing data based on inspection of hydraulic service, wherein the mobile terminal comprises inspection data uploading method and polling method for data downloading PC side two parts: (a) the mobile terminal patrol subject data upload method: (1) testing the mobile terminal is properly connected to the PC; (2) the mobile terminal to copy the file to the specified directory in the PC specified folder; (3) parse the attribute data inspection, the inspection json property data into the data, data is encapsulated into a new json meet the requirements, then parse storage; (4) parsing inspection multimedia data file by comparing the checksum present in the multimedia database inspection, the file does not exist Upload storage; (ii) downloading the PC end data inspection methods: (5) testing the mobile terminal is properly connected with the PC side; (6) the need to export the information into a database table inspection json file; (7) Find the database records the last inspection, inspection records generated file json; (8) analytical inspection time, the time corresponding to the folder in the downloaded file to the specified directory; (9) by the command most adb 一次巡检数据拷贝到移动终端中。 Inspection data copied to a mobile terminal.
  2. 2. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述测试移动终端是否与PC端正确连接的具体步骤为: (1. 1)使用adb命令执行拷贝命令,将移动终端中预先存储的测试文件拷贝到PC端指定路径下; (1. 2)查询PC端指定路径下是否存在新拷贝的测试文件,若存在,则说明移动终端与PC端连接正常,否则,说明存在连接问题; (1. 3)上述操作结束后,删除PC端中指定目录下的测试文件。 2. PC end data synchronization with a mobile terminal based on the hydraulic service inspection of claim 1, wherein said step of testing whether the particular mobile terminal and the PC is properly connected: (1.1) adb command using the copy command, the mobile terminal pre-stored copy of the test file to the PC at the specified path; if there is a new copy of the file specified in the test path (1.2) PC side query, if present, then the mobile terminal connected to the PC side of normal, otherwise, indicating there is a connection problem; (1.3) after the end of the operation, delete the test files in the PC end of the specified directory.
  3. 3. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(2)的具体步骤为: (2. 1)执行adb命令,将移动终端中指定目录下的所有文件进行拷贝到PC端; (2. 2)对于巡检属性文件,将其保存至RoutingResult文件夹中,所有文件以"数字.json"的格式命名,其中数字代表文件保存的巡检部位编号; (2. 3)对于巡检多媒体文件,将其保存至RoutingFiles这个文件夹中,文件夹下一级目录以YYYY-MM-DD形式命名,代表巡检多媒体文件产生的日期时间,每个时间文件夹下, 包含两个文件夹,分别为image和video,其中image文件夹中保存该时间产生的所有巡检图片信息,video文件夹中保存该时间中产生的所有巡检视频信息。 3. The hydraulic inspection service PC and the mobile terminal side data synchronization method based on claim 1 wherein said step (2) as claimed in claim specific steps: (2.1) performs adb command, All files under specified directory in a mobile terminal is copied to the PC; (2.2) for inspection property file, save to RoutingResult folder, all the files named ".json number" format, wherein the numbers represent inspection site saved file number; (2.3) for inspection multimedia files, save to RoutingFiles this folder, a directory folder named form YYYY-MM-DD, generating the multimedia file on behalf of inspection date and time, the next time each folder contains two folders, respectively, image and video, in which the image folder all the time to save inspection images generated information, save video files in the folder generated all the time inspection video information.
  4. 4. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(3)的具体步骤为: (3. 1)将指定文件夹目录下的所有文件的文件路径循环获取,并存放在List中,同时, 命名为List_fileName ; (3. 2)循环遍历List_fileName,对于每个文件路径下的文件先读取文件内容,再将文件内容转化为json格式;根据巡检数据入库要求,构造数据模型,将每个文件的数据通过标准化的json格式转化到数据模型对象中,并保存成一个数据模型对象的List中,同时,命名为List_dataModel ; (3. 3)循环遍历List_dataModel,获取各个数据模型对象之后,将数据模型对象中的基础表数据进行解析,存入属性信息数据库; (3. 4)将数据模型对象中的结果表数据进行解析,存入属性信息数据库,其中所有结果表记录均关联上述存入的基础表记录;在数据存入过程中,生成 (3.1) the specified folder directory: 4. The hydraulic inspection service PC and the mobile terminal side data synchronization method based on claim 1 wherein said step (3) as claimed in claim concrete steps All files in the file path acquisition cycles, and stored in the List, and named list_fileName; (3. 2) loop through list_filename, first read the contents of the file for each file in the file path, then the contents of the file conversion is json format; the inspection data storage requirements, the model data structure, each data file converted by the data format standardized json model object, and save it as a data model object List while named List_dataModel ; then (3.3) loop through List_dataModel, each acquired data model objects, the base object data model table data is parsed attribute information database stored; (3.4) the results in the table data is data model objects parsing the attribute information stored in the database, all of which are associated with the results table records into the recording of the base table; data is stored in the process of generating 个Map文件,将其命名为Map_result,其key为数据模型对象中结果对象的id编号,其value为对应结果对象在数据库中的id编号; (3. 5)将数据模型对象中的巡检图片表数据进行解析,存入属性信息数据库;在存入过程中,生成一个Map文件,将其命名为Map_image,其key为数据模型对象中图片对象的id 编号,其value为对应图片对象在数据库中的id编号; (3. 6)将数据模型对象中的巡检视频表数据进行解析,存入属性信息数据库; 在存入过程中,生成一个Map文件,将其命名为Map_video,其key为数据模型对象中视频对象的id编号,其value为对应视频对象在数据库中的id编号; (3. 7)将数据模型对象中的巡检结果一图片对应表的数据进行解析,结合Map_reSult 及Map_image,将数据转化为实际数据库表中的对应关系,最终存入属性信息数据库; (3. 8)将数据模型对象中的巡检结果一视频 A Map file, named Map_result, which is a key object data model result object id number, which corresponds to the result value of the object id number in a database; (3.5) the inspection object image data model analyzing the table data, stored in the attribute information database; stored in the process, generates a Map file names it Map_image, which is a key object data model picture object id number, which is a value corresponding to the image objects in the database the id number; (3.6) the data in table inspection video object data model by analyzing the attribute information stored in the database; stored in the process, generates a Map file, named Map_video, which key data model object id number of video objects, which video object id value corresponding number in the database; (3.7) the inspection result data in a data model object image correspondence table parsing, and binding Map_reSult Map_image, the assignment of the actual data into the database tables, attribute information database stored in the final; (3.8) the inspection result data model object of a video 应表的数据进行解析,结合Map_result 及Map_vide〇,将数据转化为实际数据库表中的对应关系,最终存入属性信息数据库。 Data table to be parsed, and binding Map_result Map_vide〇, the assignment of the actual data into the database tables, stored in the attribute information database eventually.
  5. 5. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(4)的具体步骤为: (4. 1)解析巡检多媒体数据,将指定目录下的所有文件进行循环遍历解析; (4. 2)与巡检多媒体数据库中存在的文件进行对比校验,若巡检多媒体数据库中不存在该文件,则采用ftp方式上传巡检多媒体文件至多媒体数据库,否则,跳过该文件继续操作。 (4.1) Analysis inspection multimedia data: 5. Hydraulic inspection service PC and the mobile terminal side data synchronization method based on claim 1 wherein said step (4) as claimed in claim concrete steps all of the files in the specified directory cycle through parsing; (4.2) compared with the check inspection multimedia files exist in the database, if the file does not exist in the multimedia database inspection, the inspection using ftp upload multimedia files to multimedia database, otherwise, skips the file to continue.
  6. 6. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(6)的具体步骤为: (6. 1)将巡检部位表、高程表、用户信息表、注意事项表的属性信息封装成一个数据模型对象; (6. 2)分别从各表中取出对应数据后,置入数据模型对象中,待数据模型对象正确生成后,将数据模型对象转化为json格式,并保存为文件。 (6.1) The inspection site Table: Hydraulic inspection service as claimed PC side and the mobile terminal based on the data synchronization method, of claim 1 wherein said step (6) of the specific steps required after (6.2) were taken from each corresponding data table, the data model into objects to be properly generated data model objects;, height attribute information table, the user information table, the table Note encapsulated into a data model object , the data model object into json format, and save it as a file.
  7. 7. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(7)的具体步骤为: (7. 1)从数据库中取出所有检查项目最近一次的记录,根据巡检项目的数量,生成相应的数量的巡检记录json文件; (7. 2)对于每个巡检记录对应的json文件,将每个巡检记录的属性信息封装成一个数据模型对象,分别从各表中取出对应数据后,置入数据模型对象中,待数据模型对象正确生成后,将数据模型对象转化为json格式,并保存为文件。 Remove all from the database (7.1): as claimed in claim hydraulic inspection service PC and the mobile terminal side data synchronization method based on claim 1 wherein said step (7) of the specific steps recording a latest inspection items, the number of inspection items, generate a corresponding number of document inspection records json; (7.2) for each inspection json file record corresponding to the attribute information of each inspection record after the package into a data model object, are removed from the respective corresponding data table, the data model into a subject, the correct model object data to be generated, the data model object into json format and saved as a file.
  8. 8. 如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(8)的具体步骤为: (8. 1)循环获取导出的所有巡检部位的巡检时间,将其保存在一个HashSet中; (8.2)循环遍历HashSet,所有对应时间文件夹下的文件从ftp服务器中下载到tempFile/file目录下;每次下载的文件格式如下:文件夹以YYYY-MM-DD命名,代表多媒体文件产生的日期时间,每个日期文件夹下,包含两个一级目录,分别为image和video,其中image文件夹中保存该日期中产生的所有图片信息,video文件夹中保存该日期中产生的所有视频信息。 All (8.1) acquires derived cycle: as claimed hydraulic inspection service PC and the mobile terminal side data synchronization method based on claim 1 wherein said step (8) of the specific steps required inspection site inspection time, which is stored in a the HashSet; (8.2) loop through HashSet, all the corresponding time file folder to be downloaded from the ftp server tempFile / file directory; each download file format : folder in YYYY-MM-DD name, date and time on behalf of multimedia files generated under each date folder, a directory comprising two, respectively, image, and video, where the image date stored in the folder generated All information pictures, video folder to save all the video information generated by that date.
  9. 9.如权利要求1所述的基于水工巡检业务的PC端与移动端数据同步方法,其特征在于,所述步骤(9)的具体步骤为: (9. 1)采用adb命令执行文件的拷贝操作,具体拷贝文件为tempFile/data目录下的所有文件及tempFile/file目录下的所有文件; (9. 2) tempFile/data目录下存放定义表数据及相应巡检部位的最新一次巡检记录, tempFile/file目录下存放上述巡检记录对应的多媒体数据。 9. The PC side and the mobile terminal based on a data synchronization method according to the hydraulic service inspection claimed in claim 1, wherein said step (9) is the specific steps: (9.1) The command file adb copy operation, particularly for all documents and copy files in the TEMPFILE tempFile / data directory all the files / file directory; (9.2) and the appropriate definition table data storing portion under inspection tempFile / data directory first inspection date recording, storing multimedia data corresponding to the above-described inspection records in tempFile / file directory.
CN 201410737631 2014-12-05 2014-12-05 Data synchronization method of PC (Personnel Computer) end and mobile terminal based on hydraulic polling business CN104361128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201410737631 CN104361128A (en) 2014-12-05 2014-12-05 Data synchronization method of PC (Personnel Computer) end and mobile terminal based on hydraulic polling business

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201410737631 CN104361128A (en) 2014-12-05 2014-12-05 Data synchronization method of PC (Personnel Computer) end and mobile terminal based on hydraulic polling business

Publications (1)

Publication Number Publication Date
CN104361128A true true CN104361128A (en) 2015-02-18

Family

ID=52528388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201410737631 CN104361128A (en) 2014-12-05 2014-12-05 Data synchronization method of PC (Personnel Computer) end and mobile terminal based on hydraulic polling business

Country Status (1)

Country Link
CN (1) CN104361128A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426515A (en) * 2015-12-01 2016-03-23 小米科技有限责任公司 Video classification method and apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050211777A1 (en) * 2003-07-29 2005-09-29 General Electric Company Method and apparatus for controlling site-specific operations
CN103578154A (en) * 2013-11-21 2014-02-12 国家电网公司 PDA-based realization method for intelligent patrol of electric equipment
CN103679349A (en) * 2013-11-28 2014-03-26 国家电网公司 Android based cellphone inspection terminal system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050211777A1 (en) * 2003-07-29 2005-09-29 General Electric Company Method and apparatus for controlling site-specific operations
CN103578154A (en) * 2013-11-21 2014-02-12 国家电网公司 PDA-based realization method for intelligent patrol of electric equipment
CN103679349A (en) * 2013-11-28 2014-03-26 国家电网公司 Android based cellphone inspection terminal system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105426515A (en) * 2015-12-01 2016-03-23 小米科技有限责任公司 Video classification method and apparatus

Similar Documents

Publication Publication Date Title
US20100257149A1 (en) Data synchronization and consistency across distributed repositories
CN102651748A (en) Photo sharing system on basis of geographic position
CN102063500A (en) Data migration method and device
CN102195802A (en) Terminal software transmission method, server and terminal
CN101699454A (en) Method for exchanging and merging electric network models between control center of electric power system and substation
CN101159755A (en) Mobile search system and mobile search method
CN102906751A (en) Method and device for data storage and data query
CN101806601A (en) Hand-hold meter reading terminal of meter and meter reading method based on image recognition technology
US8510270B2 (en) MYSQL database heterogeneous log based replication
CN102436624A (en) Method for processing flow and standard of power-marketing site services on basis of handheld terminal
CN101350834A (en) Information acquisition system capable of asynchronously implementing information acquisition and information transmission
US20030163802A1 (en) Method, apparatus, and program for constructing an execution environment, and computer readable medium recording program thereof
CN1687930A (en) Method of implementing IEC 61850 information indirect access real-time database
CN101409614A (en) Data synchronization method, system and equipment
CN103369003A (en) A method and a system for scanning redundancy files in a mobile device by using cloud computing
CN102637203A (en) Method for processing electric quantity data and monitoring master station for automatic electric energy metering systems
CN103678637A (en) Method and device for acquiring test question information
WO2006028383A1 (en) Place name picture annotation on camera phones
CN103645951A (en) Cross-platform mobile data management system and method
US20130198148A1 (en) Estimating data reduction in storage systems
CN103248641A (en) Network download method, device and system
CN1670726A (en) A method for inspecting garbage files in cluster file system
CN102355482A (en) Data transmission method and equipment thereof
CN102629247A (en) Method, device and system for data processing
CN103049271A (en) Method and device for automatically generating description document of API (application program interface)

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination