git před 2 roky
rodič
revize
c24c835e76

+ 7 - 0
.data/log/20221130/default_Log.log

@@ -0,0 +1,7 @@
+[2022-11-30 11:06:33]assssssssssss
+[2022-11-30 11:06:38]assssssssssss
+[2022-11-30 11:07:13]assssssssssss
+[2022-11-30 14:40:31]assssssssssss
+[2022-11-30 14:40:35]assssssssssss
+[2022-11-30 14:41:10]assssssssssss
+[2022-11-30 14:43:12]assssssssssss

+ 1 - 0
.data/log/20221130/insert_oracle_error.log

@@ -0,0 +1 @@
+[2022-11-30 14:56:43]{"id":"0308EC58","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"1669790470"}

+ 23 - 394
.data/log/workerman/APP_PREFIX.log

@@ -1,394 +1,23 @@
-2022-10-09 16:21:00 pid:32026 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:21:29 pid:32026 worker[none:32064] exit with status 65280
-2022-10-09 16:21:58 pid:32026 Workerman[index.php] Stopping ...
-2022-10-09 16:21:58 pid:32026 Workerman[index.php] has been stopped
-2022-10-09 16:27:29 pid:12881 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:27:32 pid:12881 worker[none:12884] exit with status 65280
-2022-10-09 16:27:52 pid:12881 Workerman[index.php] Stopping ...
-2022-10-09 16:27:52 pid:12881 Workerman[index.php] has been stopped
-2022-10-09 16:28:43 pid:14831 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:28:47 pid:14831 worker[none:14841] exit with status 65280
-2022-10-09 16:29:34 pid:14831 Workerman[index.php] Stopping ...
-2022-10-09 16:29:34 pid:14831 Workerman[index.php] has been stopped
-2022-10-09 16:36:03 pid:29810 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:36:07 pid:29810 worker[none:29814] exit with status 65280
-2022-10-09 16:37:06 pid:29810 Workerman[index.php] Stopping ...
-2022-10-09 16:37:06 pid:29810 Workerman[index.php] has been stopped
-2022-10-09 16:37:07 pid:32032 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:37:47 pid:32032 Workerman[index.php] Stopping ...
-2022-10-09 16:37:47 pid:32032 Workerman[index.php] has been stopped
-2022-10-09 16:37:49 pid:1147 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:38:20 pid:1147 Workerman[index.php] Stopping ...
-2022-10-09 16:38:20 pid:1147 Workerman[index.php] has been stopped
-2022-10-09 16:38:21 pid:2376 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:38:32 pid:2376 Workerman[index.php] Stopping ...
-2022-10-09 16:38:33 pid:2376 Workerman[index.php] has been stopped
-2022-10-09 16:38:48 pid:3339 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:40:51 pid:3339 Workerman[index.php] Stopping ...
-2022-10-09 16:40:51 pid:3339 Workerman[index.php] has been stopped
-2022-10-09 16:44:21 pid:16383 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:47:20 pid:16383 Workerman[index.php] Stopping ...
-2022-10-09 16:47:20 pid:16383 Workerman[index.php] has been stopped
-2022-10-09 16:47:21 pid:23010 Workerman[index.php] start in DEBUG mode
-2022-10-09 16:50:58 pid:23010 Workerman[index.php] Stopping ...
-2022-10-09 16:50:58 pid:23010 Workerman[index.php] has been stopped
-2022-10-09 18:02:51 pid:28996 Workerman[index.php] start in DEBUG mode
-2022-10-09 18:02:56 pid:29063 exception 'ThinkException' with message 'Action:fun您所请求的方法不存在!' in /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Common/functions.php:75
-Stack trace:
-#0 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/Action.class.php(268): throw_exception('Action:fun\xE6\x82\xA8\xE6\x89...')
-#1 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Action/NingboAction.class.php(38): Action->__call('fun', Array)
-#2 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Action/NingboAction.class.php(38): NingboAction->fun(Object(Workerman\Connection\TcpConnection), Array)
-#3 [internal function]: NingboAction->{closure}(Object(Workerman\Connection\TcpConnection), Array, '\xAA\xAA\xFF\x04\xB2\x8F\xFE\x83\x00\x00\xC9\x84')
-#4 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Connection/TcpConnection.php(632): call_user_func(Object(Closure), Object(Workerman\Connection\TcpConnection), Array, '\xAA\xAA\xFF\x04\xB2\x8F\xFE\x83\x00\x00\xC9\x84')
-#5 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #87, 2, NULL)
-#6 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Events/Libevent.php(202): event_base_loop(Resource id #80)
-#7 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(1763): Workerman\Events\Libevent->loop()
-#8 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(1051): Workerman\Worker->run()
-#9 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(1014): Workerman\Worker::forkOneWorker(Object(Workerman\Worker))
-#10 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(431): Workerman\Worker::forkWorkers()
-#11 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Action/NingboAction.class.php(45): Workerman\Worker::runAll()
-#12 [internal function]: NingboAction->dahua()
-#13 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/App.class.php(160): ReflectionMethod->invoke(Object(NingboAction))
-#14 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/App.class.php(198): App::exec()
-#15 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/Think.class.php(68): App::run()
-#16 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Common/runtime.php(245): Think::start()
-#17 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/ThinkPHP.php(151): require('/data/wwwroot/n...')
-#18 /data/wwwroot/nbfd.rltest.cn/index.php(27): require('/data/wwwroot/n...')
-#19 {main}
-2022-10-09 18:02:56 pid:29063 Worker[29063] process terminated
-2022-10-09 18:02:56 pid:28996 worker[none:29063] exit with status 64000
-2022-10-09 18:03:03 pid:28996 Workerman[index.php] Stopping ...
-2022-10-09 18:03:03 pid:28996 Workerman[index.php] has been stopped
-2022-10-09 18:06:38 pid:4795 Workerman[index.php] start in DEBUG mode
-2022-10-09 18:06:43 pid:4795 worker[none:4807] exit with status 65280
-2022-10-09 18:07:33 pid:4795 Workerman[index.php] Stopping ...
-2022-10-09 18:07:33 pid:4795 Workerman[index.php] has been stopped
-2022-10-09 18:07:34 pid:6779 Workerman[index.php] start in DEBUG mode
-2022-10-09 18:07:44 pid:6779 Workerman[index.php] Stopping ...
-2022-10-09 18:07:44 pid:6779 Workerman[index.php] has been stopped
-2022-10-11 14:25:11 pid:27111 Workerman[index.php] start in DEBUG mode
-2022-10-11 14:26:10 pid:27111 worker[none:27151] exit with status 65280
-2022-10-11 14:26:18 pid:27111 Workerman[index.php] Stopping ...
-2022-10-11 14:26:18 pid:27111 Workerman[index.php] has been stopped
-2022-10-11 14:28:55 pid:3415 Workerman[index.php] start in DEBUG mode
-2022-10-11 14:29:00 pid:3415 worker[none:3423] exit with status 65280
-2022-10-11 14:30:40 pid:3415 Workerman[index.php] Stopping ...
-2022-10-11 14:30:41 pid:3415 Workerman[index.php] has been stopped
-2022-10-11 14:31:28 pid:9435 Workerman[index.php] start in DEBUG mode
-2022-10-11 14:31:32 pid:9437 exception 'ThinkException' with message 'Action:getb您所请求的方法不存在!' in /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Common/functions.php:75
-Stack trace:
-#0 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/Action.class.php(268): throw_exception('Action:getb\xE6\x82\xA8\xE6...')
-#1 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Class/DahuaUtil.php(33): Action->__call('getb', Array)
-#2 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Class/DahuaUtil.php(33): NingboAction->getb(0, 7)
-#3 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Action/NingboAction.class.php(69): Jiaruan\DahuaUtil->getBit(0, Array)
-#4 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Action/NingboAction.class.php(35): NingboAction->fun80(Object(Workerman\Connection\TcpConnection), Array)
-#5 [internal function]: NingboAction->{closure}(Object(Workerman\Connection\TcpConnection), Array, '\xAA\xAA\xFF\x04\xB2\x8F\xFF\x80\x00\x01\x00w\xF5')
-#6 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Connection/TcpConnection.php(632): call_user_func(Object(Closure), Object(Workerman\Connection\TcpConnection), Array, '\xAA\xAA\xFF\x04\xB2\x8F\xFF\x80\x00\x01\x00w\xF5')
-#7 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #87, 2, NULL)
-#8 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Events/Libevent.php(202): event_base_loop(Resource id #80)
-#9 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(1763): Workerman\Events\Libevent->loop()
-#10 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(1051): Workerman\Worker->run()
-#11 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(1014): Workerman\Worker::forkOneWorker(Object(Workerman\Worker))
-#12 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-workerman352/Worker.php(431): Workerman\Worker::forkWorkers()
-#13 /data/wwwroot/nbfd.rltest.cn/Home/Lib/Action/NingboAction.class.php(45): Workerman\Worker::runAll()
-#14 [internal function]: NingboAction->dahua()
-#15 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/App.class.php(160): ReflectionMethod->invoke(Object(NingboAction))
-#16 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/App.class.php(198): App::exec()
-#17 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Lib/Core/Think.class.php(68): App::run()
-#18 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/Common/runtime.php(245): Think::start()
-#19 /data/wwwroot/nbfd.rltest.cn/vendor/zmcoding/php-tp313/ThinkPHP.php(151): require('/data/wwwroot/n...')
-#20 /data/wwwroot/nbfd.rltest.cn/index.php(27): require('/data/wwwroot/n...')
-#21 {main}
-2022-10-11 14:31:32 pid:9437 Worker[9437] process terminated
-2022-10-11 14:31:32 pid:9435 worker[none:9437] exit with status 64000
-2022-10-11 14:31:44 pid:9435 Workerman[index.php] Stopping ...
-2022-10-11 14:31:44 pid:9435 Workerman[index.php] has been stopped
-2022-10-11 14:32:32 pid:11939 Workerman[index.php] start in DEBUG mode
-2022-10-11 14:32:37 pid:11939 worker[none:11941] exit with status 65280
-2022-10-11 14:34:11 pid:11939 Workerman[index.php] Stopping ...
-2022-10-11 14:34:11 pid:11939 Workerman[index.php] has been stopped
-2022-10-11 14:34:12 pid:16944 Workerman[index.php] start in DEBUG mode
-2022-10-11 14:34:42 pid:16944 Workerman[index.php] Stopping ...
-2022-10-11 14:34:42 pid:16944 Workerman[index.php] has been stopped
-2022-10-11 14:34:55 pid:18744 Workerman[index.php] start in DEBUG mode
-2022-10-11 14:53:06 pid:30608 Workerman[index.php] status 
-2022-10-11 16:01:41 pid:18744 Workerman[index.php] Stopping ...
-2022-10-11 16:01:41 pid:18744 Workerman[index.php] has been stopped
-2022-10-11 16:01:43 pid:11531 Workerman[index.php] start in DEBUG mode
-2022-10-11 16:02:05 pid:11531 Workerman[index.php] Stopping ...
-2022-10-11 16:02:07 pid:11531 worker[none:11542] exit with status 9
-2022-10-11 16:02:07 pid:11531 Workerman[index.php] has been stopped
-2022-10-11 16:04:56 pid:18596 Workerman[index.php] start in DEBUG mode
-2022-10-11 16:05:00 pid:18596 Workerman[index.php] Stopping ...
-2022-10-11 16:05:00 pid:18596 Workerman[index.php] has been stopped
-2022-10-11 16:05:10 pid:19191 Workerman[index.php] start in DEBUG mode
-2022-10-12 09:12:48 pid:19191 worker[none:19204] exit with status 5247
-2022-10-12 09:12:55 pid:19191 Workerman[index.php] Stopping ...
-2022-10-12 09:12:55 pid:19191 Workerman[index.php] has been stopped
-2022-10-12 13:32:42 pid:21847 Workerman[index.php] start in DEBUG mode
-2022-10-12 13:32:45 pid:21847 Workerman[index.php] Stopping ...
-2022-10-12 13:32:45 pid:21847 Workerman[index.php] has been stopped
-2022-10-12 13:32:57 pid:22154 Workerman[index.php] start in DEBUG mode
-2022-10-12 15:19:21 pid:22154 Workerman[index.php] Stopping ...
-2022-10-12 15:19:21 pid:22154 Workerman[index.php] has been stopped
-2022-10-12 15:20:56 pid:25367 Workerman[index.php] start in DEBUG mode
-2022-10-12 15:21:03 pid:25367 Workerman[index.php] Stopping ...
-2022-10-12 15:21:03 pid:25367 Workerman[index.php] has been stopped
-2022-10-12 15:21:11 pid:26123 Workerman[index.php] start in DEBUG mode
-2022-10-12 15:21:15 pid:26123 Workerman[index.php] Stopping ...
-2022-10-12 15:21:15 pid:26123 Workerman[index.php] has been stopped
-2022-10-12 15:21:25 pid:26764 Workerman[index.php] start in DEBUG mode
-2022-10-12 17:08:52 pid:26270 Workerman[index.php] status 
-2022-10-12 17:31:39 pid:17423 Workerman[index.php] status 
-2022-10-12 17:37:27 pid:26764 Workerman[index.php] Stopping ...
-2022-10-12 17:37:28 pid:26764 Workerman[index.php] has been stopped
-2022-10-12 17:37:31 pid:23668 Workerman[index.php] start in DEBUG mode
-2022-10-12 17:48:24 pid:2050 Workerman[index.php] status 
-2022-10-12 17:52:10 pid:5794 Workerman[index.php] status 
-2022-10-12 17:54:29 pid:7991 Workerman[index.php] status 
-2022-10-12 18:20:16 pid:2541 Workerman[index.php] status 
-2022-10-12 18:26:06 pid:23668 Workerman[index.php] Stopping ...
-2022-10-12 18:26:06 pid:23668 Workerman[index.php] has been stopped
-2022-10-12 18:49:06 pid:32296 Workerman[index.php] start in DEBUG mode
-2022-10-12 18:57:51 pid:8431 Workerman[index.php] status 
-2022-10-13 10:49:57 pid:7278 Workerman[index.php] status 
-2022-10-13 10:53:10 pid:13368 Workerman[index.php] status 
-2022-10-13 11:12:03 pid:32296 Workerman[index.php] Stopping ...
-2022-10-13 11:12:03 pid:32296 Workerman[index.php] has been stopped
-2022-10-13 11:12:15 pid:21420 Workerman[index.php] start in DAEMON mode
-2022-10-13 11:12:44 pid:21422 worker[none:21426] exit with status 65280
-2022-10-13 11:13:10 pid:23430 Workerman[index.php] stop 
-2022-10-13 11:13:10 pid:23430 Workerman[index.php] is stoping ...
-2022-10-13 11:13:10 pid:21422 Workerman[index.php] Stopping ...
-2022-10-13 11:13:10 pid:21422 Workerman[index.php] has been stopped
-2022-10-13 11:13:10 pid:23430 Workerman[index.php] stop success
-2022-10-13 11:13:16 pid:23635 Workerman[index.php] start in DEBUG mode
-2022-10-13 11:13:23 pid:23635 worker[none:23639] exit with status 65280
-2022-10-13 11:13:31 pid:23635 Workerman[index.php] Stopping ...
-2022-10-13 11:13:31 pid:23635 Workerman[index.php] has been stopped
-2022-10-13 11:14:15 pid:25639 Workerman[index.php] start in DEBUG mode
-2022-10-13 11:14:33 pid:25639 Workerman[index.php] Stopping ...
-2022-10-13 11:14:33 pid:25639 Workerman[index.php] has been stopped
-2022-10-13 11:21:12 pid:7283 Workerman[index.php] stop 
-2022-10-13 11:21:12 pid:7283 Workerman[index.php] not run
-2022-10-13 11:21:17 pid:7401 Workerman[index.php] start in DEBUG mode
-2022-10-13 11:21:21 pid:7401 Workerman[index.php] Stopping ...
-2022-10-13 11:21:21 pid:7401 Workerman[index.php] has been stopped
-2022-10-13 11:21:30 pid:7823 Workerman[index.php] start in DEBUG mode
-2022-10-13 11:34:18 pid:2513 Workerman[index.php] status 
-2022-10-13 12:13:12 pid:19439 Workerman[index.php] status 
-2022-10-13 12:16:33 pid:26339 Workerman[index.php] status 
-2022-10-13 14:06:51 pid:29952 Workerman[index.php] status 
-2022-10-13 14:13:48 pid:11588 Workerman[index.php] status 
-2022-10-13 14:21:01 pid:20157 Workerman[index.php] status 
-2022-10-13 14:22:41 pid:21285 Workerman[index.php] status 
-2022-10-13 14:24:34 pid:22500 Workerman[index.php] status 
-2022-10-13 14:30:50 pid:26722 Workerman[index.php] status 
-2022-10-13 14:32:22 pid:27695 Workerman[index.php] status 
-2022-10-13 14:35:24 pid:29889 Workerman[index.php] status 
-2022-10-13 14:40:08 pid:587 Workerman[index.php] status 
-2022-10-13 14:42:06 pid:1988 Workerman[index.php] status 
-2022-10-13 14:44:11 pid:3394 Workerman[index.php] status 
-2022-10-13 14:44:32 pid:3584 Workerman[index.php] status 
-2022-10-13 14:47:52 pid:5858 Workerman[index.php] status 
-2022-10-13 14:50:08 pid:7376 Workerman[index.php] status 
-2022-10-13 14:53:02 pid:9322 Workerman[index.php] status 
-2022-10-13 14:56:20 pid:7823 Workerman[index.php] Stopping ...
-2022-10-13 14:56:20 pid:7823 Workerman[index.php] has been stopped
-2022-10-13 14:56:37 pid:11718 Workerman[index.php] start in DEBUG mode
-2022-10-13 14:56:51 pid:11933 Workerman[index.php] status 
-2022-10-13 14:56:56 pid:11999 Workerman[index.php] status 
-2022-10-13 14:57:16 pid:12391 Workerman[index.php] status 
-2022-10-13 15:04:51 pid:18299 Workerman[index.php] status 
-2022-10-13 15:08:54 pid:20972 Workerman[index.php] status 
-2022-10-13 15:09:18 pid:21313 Workerman[index.php] status 
-2022-10-13 15:13:14 pid:11718 Workerman[index.php] Stopping ...
-2022-10-13 15:13:14 pid:11718 Workerman[index.php] has been stopped
-2022-10-13 15:13:22 pid:24121 Workerman[index.php] start in DEBUG mode
-2022-10-13 15:13:25 pid:24121 Workerman[index.php] Stopping ...
-2022-10-13 15:13:25 pid:24121 Workerman[index.php] has been stopped
-2022-10-13 15:13:26 pid:24143 Workerman[index.php] start in DEBUG mode
-2022-10-13 15:13:32 pid:24226 Workerman[index.php] status 
-2022-10-13 15:17:20 pid:26667 Workerman[index.php] status 
-2022-10-13 15:21:26 pid:29426 Workerman[index.php] status 
-2022-10-13 15:27:09 pid:687 Workerman[index.php] start in DEBUG mode
-2022-10-13 15:30:43 pid:3177 Workerman[index.php] status 
-2022-10-13 15:37:00 pid:7020 Workerman[index.php] status 
-2022-10-13 15:37:26 pid:7360 Workerman[index.php] status 
-2022-10-13 15:38:40 pid:8142 Workerman[index.php] status 
-2022-10-13 15:39:01 pid:8430 Workerman[index.php] status 
-2022-10-13 15:39:06 pid:8540 Workerman[index.php] status 
-2022-10-13 15:41:13 pid:10032 Workerman[index.php] status 
-2022-10-13 15:43:12 pid:11277 Workerman[index.php] status 
-2022-10-13 15:44:00 pid:11709 Workerman[index.php] status 
-2022-10-13 15:44:07 pid:11885 Workerman[index.php] status 
-2022-10-13 15:44:25 pid:12078 Workerman[index.php] status 
-2022-10-13 15:44:34 pid:687 Workerman[index.php] Stopping ...
-2022-10-13 15:44:34 pid:687 Workerman[index.php] has been stopped
-2022-10-13 15:44:40 pid:12273 Workerman[index.php] start in DEBUG mode
-2022-10-13 15:44:45 pid:12323 Workerman[index.php] status 
-2022-10-13 15:45:01 pid:12510 Workerman[index.php] status 
-2022-10-13 15:48:33 pid:15800 Workerman[index.php] status 
-2022-10-13 15:49:24 pid:16356 Workerman[index.php] status 
-2022-10-13 15:49:29 pid:16451 Workerman[index.php] status 
-2022-10-13 15:49:44 pid:16590 Workerman[index.php] status 
-2022-10-13 15:50:16 pid:17118 Workerman[index.php] status 
-2022-10-13 15:53:59 pid:19414 Workerman[index.php] status 
-2022-10-13 15:54:09 pid:19572 Workerman[index.php] status 
-2022-10-13 15:57:27 pid:21745 Workerman[index.php] status 
-2022-10-13 15:58:43 pid:22651 Workerman[index.php] status 
-2022-10-13 15:58:47 pid:22713 Workerman[index.php] status 
-2022-10-13 15:59:09 pid:23016 Workerman[index.php] status 
-2022-10-13 16:05:04 pid:27012 Workerman[index.php] status 
-2022-10-13 16:05:52 pid:27605 Workerman[index.php] status 
-2022-10-13 16:12:41 pid:31733 Workerman[index.php] status 
-2022-10-13 16:12:49 pid:31846 Workerman[index.php] status 
-2022-10-13 16:13:00 pid:32005 Workerman[index.php] status 
-2022-10-13 16:13:10 pid:32159 Workerman[index.php] status 
-2022-10-13 16:13:31 pid:32365 Workerman[index.php] status 
-2022-10-13 16:13:47 pid:32587 Workerman[index.php] status 
-2022-10-13 16:14:02 pid:32757 Workerman[index.php] stop 
-2022-10-13 16:14:02 pid:32757 Workerman[index.php] is stoping ...
-2022-10-13 16:14:02 pid:12273 Workerman[index.php] Stopping ...
-2022-10-13 16:14:02 pid:12273 Workerman[index.php] has been stopped
-2022-10-13 16:14:02 pid:32757 Workerman[index.php] stop success
-2022-10-13 16:14:25 pid:623 Workerman[index.php] start in DEBUG mode
-2022-10-13 16:19:51 pid:623 Workerman[index.php] Stopping ...
-2022-10-13 16:19:51 pid:623 Workerman[index.php] has been stopped
-2022-10-13 16:19:55 pid:4130 Workerman[index.php] start in DEBUG mode
-2022-10-13 16:25:32 pid:4130 Workerman[index.php] Stopping ...
-2022-10-13 16:25:32 pid:4130 Workerman[index.php] has been stopped
-2022-10-13 16:25:33 pid:7770 Workerman[index.php] start in DEBUG mode
-2022-10-13 16:26:14 pid:8212 Workerman[index.php] status 
-2022-10-13 16:33:27 pid:7770 Workerman[index.php] Stopping ...
-2022-10-13 16:33:27 pid:7770 Workerman[index.php] has been stopped
-2022-10-13 16:33:35 pid:12659 Workerman[index.php] start in DEBUG mode
-2022-10-13 16:34:19 pid:13137 Workerman[index.php] status 
-2022-10-13 16:34:44 pid:13499 Workerman[index.php] status 
-2022-10-13 16:35:06 pid:13925 Workerman[index.php] status 
-2022-10-13 16:50:12 pid:12659 Workerman[index.php] Stopping ...
-2022-10-13 16:50:13 pid:12659 Workerman[index.php] has been stopped
-2022-10-13 16:50:14 pid:24458 Workerman[index.php] start in DEBUG mode
-2022-10-13 16:54:51 pid:24458 Workerman[index.php] Stopping ...
-2022-10-13 16:54:51 pid:24458 Workerman[index.php] has been stopped
-2022-10-13 16:54:53 pid:27150 Workerman[index.php] start in DEBUG mode
-2022-10-13 17:00:46 pid:27150 Workerman[index.php] Stopping ...
-2022-10-13 17:00:46 pid:27150 Workerman[index.php] has been stopped
-2022-10-13 17:00:47 pid:30674 Workerman[index.php] start in DEBUG mode
-2022-10-13 17:01:27 pid:31195 Workerman[index.php] status 
-2022-10-13 17:08:45 pid:3259 Workerman[index.php] status 
-2022-10-13 17:08:57 pid:3365 Workerman[index.php] status 
-2022-10-13 17:09:09 pid:3581 Workerman[index.php] status 
-2022-10-13 17:09:26 pid:3797 Workerman[index.php] status 
-2022-10-13 17:10:06 pid:4249 Workerman[index.php] status 
-2022-10-13 17:11:26 pid:5027 Workerman[index.php] status 
-2022-10-13 17:16:47 pid:8292 Workerman[index.php] status 
-2022-10-13 17:16:56 pid:8371 Workerman[index.php] status 
-2022-10-13 19:10:05 pid:30674 Workerman[index.php] Stopping ...
-2022-10-13 19:10:05 pid:30674 Workerman[index.php] has been stopped
-2022-10-13 19:11:12 pid:12132 Workerman[index.php] start in DEBUG mode
-2022-10-13 19:11:47 pid:13337 Workerman[index.php] status 
-2022-10-13 19:11:56 pid:13850 Workerman[index.php] status 
-2022-10-13 19:12:06 pid:14528 Workerman[index.php] status 
-2022-10-13 19:12:56 pid:16785 Workerman[index.php] status 
-2022-10-13 19:13:48 pid:18525 Workerman[index.php] status 
-2022-10-13 19:15:24 pid:21836 Workerman[index.php] status 
-2022-10-13 19:15:38 pid:22401 Workerman[index.php] status 
-2022-10-13 19:15:50 pid:22807 Workerman[index.php] status 
-2022-10-13 19:16:58 pid:25074 Workerman[index.php] status 
-2022-10-13 19:18:34 pid:27916 Workerman[index.php] status 
-2022-10-13 19:20:18 pid:31008 Workerman[index.php] status 
-2022-10-13 19:20:30 pid:12132 Workerman[index.php] Stopping ...
-2022-10-13 19:20:30 pid:12132 Workerman[index.php] has been stopped
-2022-10-13 19:28:59 pid:17089 Workerman[index.php] status 
-2022-10-13 19:28:59 pid:17089 Workerman[index.php] not run
-2022-10-13 19:47:34 pid:23420 Workerman[index.php] start in DEBUG mode
-2022-10-13 19:47:37 pid:23499 Workerman[index.php] status 
-2022-10-13 19:48:06 pid:24492 Workerman[index.php] status 
-2022-10-13 19:48:30 pid:25280 Workerman[index.php] status 
-2022-10-13 19:49:27 pid:26955 Workerman[index.php] status 
-2022-10-13 19:50:19 pid:23420 Workerman[index.php] Stopping ...
-2022-10-13 19:50:21 pid:23420 worker[none:23425] exit with status 9
-2022-10-13 19:50:21 pid:23420 worker[none:23424] exit with status 9
-2022-10-13 19:50:21 pid:23420 worker[none:23422] exit with status 9
-2022-10-13 19:50:21 pid:23420 worker[none:23423] exit with status 9
-2022-10-13 19:50:21 pid:23420 Workerman[index.php] has been stopped
-2022-10-13 19:57:11 pid:9704 Workerman[index.php] start in DEBUG mode
-2022-10-13 19:57:48 pid:11011 Workerman[index.php] status 
-2022-10-13 19:58:02 pid:11532 Workerman[index.php] status 
-2022-10-13 20:08:51 pid:1222 Workerman[index.php] status 
-2022-10-13 20:09:07 pid:1895 Workerman[index.php] status 
-2022-10-13 20:10:50 pid:9704 Workerman[index.php] Stopping ...
-2022-10-13 20:10:50 pid:9704 Workerman[index.php] has been stopped
-2022-10-13 20:10:51 pid:5354 Workerman[index.php] start in DEBUG mode
-2022-10-13 20:11:11 pid:6051 Workerman[index.php] status 
-2022-10-13 20:12:36 pid:8526 Workerman[index.php] status 
-2022-10-13 20:12:58 pid:9125 Workerman[index.php] status 
-2022-10-13 20:27:43 pid:7296 Workerman[index.php] status 
-2022-10-13 20:31:53 pid:16697 Workerman[index.php] status 
-2022-10-13 20:34:29 pid:21507 Workerman[index.php] status 
-2022-10-14 17:59:44 pid:13453 Workerman[index.php] status 
-2022-10-14 18:00:59 pid:16934 Workerman[index.php] status 
-2022-10-15 09:56:36 pid:27843 Workerman[index.php] status 
-2022-10-15 10:21:15 pid:14031 Workerman[index.php] status 
-2022-10-15 10:21:21 pid:5354 Workerman[index.php] Stopping ...
-2022-10-15 10:21:21 pid:5354 Workerman[index.php] has been stopped
-2022-10-15 11:11:23 pid:22737 Workerman[index.php] start in DEBUG mode
-2022-10-15 11:12:42 pid:22737 Workerman[index.php] Stopping ...
-2022-10-15 11:12:42 pid:22737 Workerman[index.php] has been stopped
-2022-10-15 11:12:43 pid:25257 Workerman[index.php] start in DEBUG mode
-2022-10-15 11:16:45 pid:25257 Workerman[index.php] Stopping ...
-2022-10-15 11:16:47 pid:25257 worker[none:25261] exit with status 9
-2022-10-15 11:16:47 pid:25257 worker[none:25258] exit with status 9
-2022-10-15 11:16:47 pid:25257 worker[none:25259] exit with status 9
-2022-10-15 11:16:47 pid:25257 Workerman[index.php] has been stopped
-2022-10-15 11:22:07 pid:5774 Workerman[index.php] start in DEBUG mode
-2022-10-15 11:24:23 pid:5774 Workerman[index.php] Stopping ...
-2022-10-15 11:24:23 pid:5774 Workerman[index.php] has been stopped
-2022-10-15 11:34:36 pid:31813 Workerman[index.php] start in DEBUG mode
-2022-10-15 11:36:20 pid:31813 Workerman[index.php] Stopping ...
-2022-10-15 11:36:22 pid:31813 worker[none:31839] exit with status 9
-2022-10-15 11:36:22 pid:31813 worker[none:31840] exit with status 9
-2022-10-15 11:36:22 pid:31813 worker[none:31842] exit with status 9
-2022-10-15 11:36:22 pid:31813 worker[none:31841] exit with status 9
-2022-10-15 11:36:22 pid:31813 Workerman[index.php] has been stopped
-2022-10-15 11:44:29 pid:6476 Workerman[index.php] start in DEBUG mode
-2022-10-15 11:45:22 pid:6476 Workerman[index.php] Stopping ...
-2022-10-15 11:45:23 pid:6476 Workerman[index.php] has been stopped
-2022-10-15 11:48:48 pid:9120 Workerman[index.php] start in DEBUG mode
-2022-10-15 11:50:26 pid:9120 Workerman[index.php] Stopping ...
-2022-10-15 11:50:26 pid:9120 Workerman[index.php] has been stopped
-2022-10-15 11:52:01 pid:11239 Workerman[index.php] start in DEBUG mode
-2022-10-15 12:15:27 pid:11239 Workerman[index.php] Stopping ...
-2022-10-15 12:15:27 pid:11239 Workerman[index.php] has been stopped
-2022-10-15 12:17:20 pid:28379 Workerman[index.php] start in DEBUG mode
-2022-10-15 12:21:43 pid:28379 Workerman[index.php] Stopping ...
-2022-10-15 12:21:43 pid:28379 Workerman[index.php] has been stopped
-2022-10-15 12:21:44 pid:31213 Workerman[index.php] start in DEBUG mode
-2022-10-15 13:36:46 pid:31213 Workerman[index.php] Stopping ...
-2022-10-15 13:36:46 pid:31213 Workerman[index.php] has been stopped
-2022-10-15 13:46:00 pid:22005 Workerman[index.php] start in DEBUG mode
-2022-10-15 13:46:07 pid:22005 Workerman[index.php] Stopping ...
-2022-10-15 13:46:07 pid:22005 Workerman[index.php] has been stopped
-2022-10-15 13:46:12 pid:22245 Workerman[index.php] start in DEBUG mode
-2022-10-15 13:47:32 pid:22245 Workerman[index.php] Stopping ...
-2022-10-15 13:47:32 pid:22245 Workerman[index.php] has been stopped
-2022-10-18 17:42:30 pid:15788 Workerman[index.php] start in DEBUG mode
-2022-10-18 17:46:39 pid:15788 Workerman[index.php] Stopping ...
-2022-10-18 17:46:39 pid:15788 Workerman[index.php] has been stopped
-2022-10-18 17:46:42 pid:19022 Workerman[index.php] start in DEBUG mode
-2022-10-18 20:28:59 pid:19022 Workerman[index.php] Stopping ...
-2022-10-18 20:28:59 pid:19022 Workerman[index.php] has been stopped
-2022-10-18 20:31:02 pid:31494 Workerman[index.php] start in DEBUG mode
-2022-10-18 20:33:53 pid:31494 Workerman[index.php] Stopping ...
-2022-10-18 20:33:53 pid:31494 Workerman[index.php] has been stopped
-2022-10-19 10:39:35 pid:31308 Workerman[index.php] start in DEBUG mode
-2022-10-19 10:39:40 pid:31308 Workerman[index.php] Stopping ...
-2022-10-19 10:39:40 pid:31308 Workerman[index.php] has been stopped
-2022-10-19 10:39:44 pid:31637 Workerman[index.php] start in DEBUG mode
-2022-10-19 14:48:09 pid:7229 Workerman[index.php] status 
-2022-10-19 15:17:36 pid:31637 Workerman[index.php] Stopping ...
-2022-10-19 15:17:36 pid:31637 Workerman[index.php] has been stopped
-2022-10-19 16:03:32 pid:29513 Workerman[index.php] start in DEBUG mode
-2022-10-19 16:08:20 pid:29513 Workerman[index.php] Stopping ...
-2022-10-19 16:08:21 pid:29513 Workerman[index.php] has been stopped
+2022-11-26 10:10:50 pid:7488 Workerman[index.php] start in DEBUG mode
+2022-11-26 10:14:51 pid:7488 Workerman[index.php] Stopping ...
+2022-11-26 10:14:51 pid:7488 Workerman[index.php] has been stopped
+2022-11-26 10:14:59 pid:10211 Workerman[index.php] start in DEBUG mode
+2022-11-26 10:15:01 pid:10211 Workerman[index.php] Stopping ...
+2022-11-26 10:15:01 pid:10211 Workerman[index.php] has been stopped
+2022-11-26 10:15:22 pid:10531 Workerman[index.php] start in DEBUG mode
+2022-11-26 10:19:44 pid:10531 Workerman[index.php] Stopping ...
+2022-11-26 10:19:44 pid:10531 worker[none:10547] exit with status 32512
+2022-11-26 10:19:44 pid:10531 worker[none:10543] exit with status 32512
+2022-11-26 10:19:44 pid:10531 worker[none:10544] exit with status 32512
+2022-11-26 10:19:44 pid:10531 worker[none:10548] exit with status 32512
+2022-11-26 10:19:44 pid:10531 worker[none:10549] exit with status 32512
+2022-11-26 10:19:44 pid:10531 worker[none:10546] exit with status 32512
+2022-11-26 10:19:44 pid:10531 worker[none:10545] exit with status 32512
+2022-11-26 10:19:45 pid:10531 worker[none:10550] exit with status 32512
+2022-11-26 10:19:45 pid:10531 Workerman[index.php] has been stopped
+2022-11-26 10:20:09 pid:14245 Workerman[index.php] start in DEBUG mode
+2022-11-26 10:20:11 pid:14245 Workerman[index.php] Stopping ...
+2022-11-26 10:20:11 pid:14245 Workerman[index.php] has been stopped
+2022-11-26 10:20:16 pid:14373 Workerman[index.php] start in DEBUG mode
+2022-11-26 10:23:25 pid:14373 Workerman[index.php] Stopping ...
+2022-11-26 10:23:25 pid:14373 Workerman[index.php] has been stopped

+ 252 - 0
Home/Lib/Action/ListeningFileCreateAction.class.php

@@ -0,0 +1,252 @@
+<?php
+
+
+
+class ListeningFileCreateAction extends Action {
+			
+
+
+ 
+	private  function InotifyMonitor( $path ){
+		return new class([$path]){
+			  const MONITOR_EVENT  = IN_CLOSE_WRITE;
+		             const EVENT_MASK  = [
+		                 IN_ACCESS => 'File was accessed (read)',
+		                 IN_MODIFY => 'File was modified',
+		                 IN_ATTRIB => 'Metadata changed',
+		                 IN_CLOSE_WRITE => 'File opened for writing was closed',
+		                 IN_CLOSE_NOWRITE => 'File not opened for writing was closed',
+		                 IN_OPEN => 'File was opened',
+		                 IN_MOVED_TO => 'File moved into watched directory',
+		                 IN_MOVED_FROM => 'File moved out of watched directory',
+		                 IN_CREATE => 'File or directory created in watched directory',
+		                 IN_DELETE => 'File or directory deleted in watched directory',
+		                 IN_DELETE_SELF => 'Watched file or directory was deleted',
+		                 IN_MOVE_SELF => 'Watch file or directory was moved',
+		                 IN_CLOSE => 'Equals to IN_CLOSE_WRITE | IN_CLOSE_NOWRITE',
+		                 IN_MOVE => 'Equals to IN_MOVED_FROM | IN_MOVED_TO',
+		                 IN_ALL_EVENTS => 'Bitmask of all the above constants',
+		                 IN_UNMOUNT => 'File system containing watched object was unmounted',
+		                 IN_Q_OVERFLOW => 'Event queue overflowed (wd is -1 for this event)',
+		                 IN_IGNORED => 'Watch was removed (explicitly by inotify_rm_watch() or because file was removed or filesystem unmounted',
+		                 IN_ISDIR => 'Subject of this event is a directory',
+		                 IN_ONLYDIR => 'Only watch pathname if it is a directory',
+		                 IN_DONT_FOLLOW => 'Do not dereference pathname if it is a symlink',
+		                 IN_MASK_ADD => 'Add events to watch mask for this pathname if it already exists',
+		                 IN_ONESHOT => 'Monitor pathname for one event, then remove from watch list.',
+		                 1073741840 => 'High-bit: File not opened for writing was closed',
+		                 1073741856 => 'High-bit: File was opened',
+		                 1073742080 => 'High-bit: File or directory created in watched directory',
+		                 1073742336 => 'High-bit: File or directory deleted in watched directory',
+		             ];
+		          
+		             public $fds  = [];
+		              
+		             public $paths  = [];
+		              
+		             public $wds = [];
+		              
+		             public $timeout  = 3;
+		             
+		             public $redis=null;
+		          
+		           
+		             public  function __construct( $paths ){
+		                 if (!empty($paths)) {
+		                     foreach ($paths as $path) {
+		                         if (file_exists($path)) {
+		                             if (is_dir($path)) {
+		                                 $this->addDir($path);
+		                             } else {
+		                                 $this->addFile($path);
+		                             }
+		                         }
+		                     }
+		                 }
+		                //  if (!empty($post_url)) {
+		                //      $this->url = $post_url;
+		                //  }
+		                $this->redis = new Redis();
+		                $this->redis->pconnect('127.0.0.1', 6379,2.5);
+		                $this->redis->select(1);
+		                $result = $this->redis->ping();
+		                echo "redis连接结果=>".$result.PHP_EOL;
+		             }
+		             public  function __destruct(  ){
+		                 if (!empty($this->fds)) {
+		                     foreach ($this->fds as $fd) {
+		                         fclose($fd);
+		                     }
+		                 }
+		             }
+		              
+		           
+		             public  function addFile( $file ){
+		                 $file = realpath($file);
+		                 $fd = inotify_init();
+		                 $fid = (int)$fd;
+		                 //保存inotify资源
+		                 $this->fds[$fid] = $fd;
+		                 //设置为非阻塞模式
+		                 stream_set_blocking($this->fds[$fid], 0);
+		                 //保存文件路径
+		                 $this->paths[$fid] = $file;
+		                 //保存监控描述�?
+		                 $this->wds[$fid] =inotify_add_watch($this->fds[$fid], $file, self::MONITOR_EVENT);
+		             }
+		              
+		           
+		             public  function addDir( $dir ){
+		                 $dir = realpath($dir);
+		                 if ($dh = opendir($dir)) {
+		                     //将目录加入监控中
+		                     $fd = inotify_init();
+		                     //一般文件的资源描述符是一个整形,可以用来当索�?
+		                     $fid = (int)$fd;
+		                     $this->fds[$fid] = $fd;
+		                     stream_set_blocking($this->fds[$fid], 0);
+		                     $this->paths[$fid] = $dir;
+		                     $this->wds[$fid] = inotify_add_watch($this->fds[$fid], $dir, self::MONITOR_EVENT);
+		                     //遍历目录下文�?
+		                     while (($file = readdir($dh)) !== false) {
+		                         if ($file == '.' || $file == '..') {
+		                             continue;
+		                         }
+		                         $file = $dir . DIRECTORY_SEPARATOR . $file;
+		                         if (is_dir($file)) {
+		                             $this->addDir($file);
+		                         }
+		                     }
+		                     closedir($dh);
+		                 }
+		             }
+		              
+		           
+		             public  function remove( $fid ){
+		                 unset($this->paths[$fid]);
+		                 fclose($this->fds[$fid]);
+		                 unset($this->fds[$fid]);
+		             }
+		              
+		           
+		             public  function run(  ){
+		       
+		                 while (true) {
+		                     $reads = $this->fds;
+		                     $write = [];
+		                     $except = [];//异常事件
+		                     if (stream_select($reads, $write, $except, $this->timeout) > 0) {
+		                         if (!empty($reads)) {
+		                           
+		                             foreach ($reads as $read) {
+		                                 //从可读流中读取数�?
+		                                 $events = inotify_read($read);
+		                                 //资源描述符,整形
+		                                 $fid = (int)$read;
+		                                 //获取inotify实例的路�?
+		                                 $path = $this->paths[$fid];
+		                                 foreach ($events as $event) {
+		                                    echo '监听读取'.PHP_EOL;
+		                                   
+		                                     $file = $path .'/'. $event['name'];
+		                                     
+		                                     if ($event['mask']==IN_CLOSE_WRITE) {
+		                                        echo '记录一个文件';
+		                                        //  $file = iconv('gb2312', 'UTF-8', $file);
+		                                         echo 'create file->'.$file.PHP_EOL;
+		                                
+		                                         //写入kafka
+		                                         $this->set_redis($file);
+		                                         //$this->postData($data);
+		                                     }
+		                                      
+		                                     //echo $event['name'], ' --- ', self::EVENT_MASK[$event['mask']], PHP_EOL;
+		                                 }
+		                             }
+		                         }
+		                         if (!empty($except)) {
+		                             //debug_log('push_vidieo_images_log',json_encode($except));//记录下异常事�?
+		                         }
+		                     } else {
+		                         //echo '------------------', PHP_EOL;
+		                         //echo '当前监控的路径列�?, PHP_EOL;
+		                         //print_r($this->paths);
+		                         //echo '------------------', PHP_EOL;
+		                     }
+		                 }
+		             }
+		              
+		             /**
+		              * function
+		              * 文件目录
+		              * @param [type] $data
+		              * @return void
+		              */
+		             public function set_redis($data)
+		             {
+		                $this->redis->lpush('redis_to_kafka',$data);
+		
+		             }
+		              
+			
+			
+			
+			
+			
+		}
+	}
+	
+ 
+	public  function start_listening(  ){
+		$this->InotifyMonitor('/test')->run();
+	}
+	
+ 
+	public  function redis_to_kafka(  ){
+		$redis = new redis();
+		$redis->connect('127.0.0.1',6379);
+		$redis->select(1);
+		$result = $redis->ping();
+		echo "redis连接结果=>".$result.PHP_EOL;
+		// $conf = new RdKafka\Conf();
+		// $conf->set('metadata.broker.list', 'localhost:9092');
+		// $conf->setDrMsgCb(function ($kafka, $message) {
+		//     file_put_contents("./dr_cb.log", var_export($message, true).PHP_EOL, FILE_APPEND);
+		// });
+		// $conf->setErrorCb(function ($kafka, $err, $reason) {
+		//     file_put_contents("./err_cb.log", sprintf("Kafka error: %s (reason: %s)",rd_kafka_err2str($err), $reason).PHP_EOL, FILE_APPEND);
+		// });
+		// $producer = new RdKafka\Producer($conf);
+		// $producer->setLogLevel(LOG_DEBUG);
+		// $producer->addBrokers("127.0.0.1");
+		
+		while(true)
+		{
+		    $res =  $redis->rPop('redis_to_kafka');
+		    if(!$res)
+		    {
+		        sleep(1);
+		        continue;
+		    }
+		    if(!file_exists($res))
+		    {
+		        continue;
+		    }
+		    $data =  file_get_contents($res);
+		    if(empty($data))
+		    {
+		        continue;
+		    }
+		    $data = explode(',',$data);
+		    foreach($data as $item)
+		    {
+		        echo $item;
+		    }
+		    unlink($res);
+		
+		}
+		
+	}
+	
+
+}

+ 23 - 11
Home/Lib/Action/NingboAction.class.php

@@ -10,11 +10,12 @@ class NingboAction extends Action {
 	public  function dahua(  ){
 		Vendor('Workerman352.Autoloader');
 		$worker = new \Workerman\Worker("Dahua://0.0.0.0:1234");
-		$worker->count = 4;
+		$worker->count = 8;
 		$worker->onWorkerStart  = function($worker){
 			 $timeInterval = 60 * 5;//秒
 		    \Workerman\Lib\Timer::add($timeInterval, function()
 		    {
+				  \Jiaruan\DahuaUtil::rlog("timer exec");
 		        foreach(\Workerman\Connection\TcpConnection::$connections as $connection) {
 		            if (time() - $connection->recvTime > 10 * 60) {
 		                \Jiaruan\DahuaUtil::rlog("close idle", $connection->getRemoteIp() . ':' . $connection->getRemotePort());
@@ -56,7 +57,7 @@ class NingboAction extends Action {
 		{
 		    \Jiaruan\DahuaUtil::rlog("[ONDRAIN]", $connection->getRemoteIp() . ':' . $connection->getRemotePort());
 		};
-		
+		$worker->reusePort = true;
 		\Workerman\Worker::runAll();
 	}
 	
@@ -72,10 +73,15 @@ class NingboAction extends Action {
 	private  function pushQueue( $data ){
 		$data = json_encode($data);
 		$startTime = microtime(true);
-		\Jiaruan\DahuaUtil::rlog(microtime(true) . '[pushQueue]', $data);
+		\Jiaruan\DahuaUtil::rlog('[pushQueue]', $data);
 		//return;
 		
-		$topic = 'ningbo_dahua';
+		$brokerlist = C('KAFKA_BROKER_LIST');
+		if (empty($brokerlist)) {
+			\Jiaruan\DahuaUtil::rlog("KAFKA_BROKER_LIST must be config!");
+		}
+		
+		$topic = C('ROUTE_INDEX_KAFKA_TOPIC');
 		
 		        if (empty($topic)) {
 		            \Jiaruan\DahuaUtil::rlog("error TRAVEL_ROUTE_INDEX_KAFKA_TOPIC empty");
@@ -88,6 +94,8 @@ class NingboAction extends Action {
 		        }
 		        if(!$rk){
 		            $conf = new Rdkafka\Conf();
+						 $conf->set('metadata.broker.list', $brokerlist);
+						 //$conf->set('group.id', $group); 这个参数是消费者的
 		           //$conf->set('batch.num.messages', 2);
 		            //$conf->set('linger.ms', 10);
 		            //$conf->set('log_level', (string) LOG_DEBUG);
@@ -106,7 +114,7 @@ class NingboAction extends Action {
 		        }
 		         
 		        //$rk->setLogLevel(LOG_DEBUG);
-		        //$rk->addBrokers(C('KAFKA_BROKER_LIST'));
+		        //$rk->addBrokers($brokerlist);
 					
 		        $topic = $rk->newTopic($topic);
 		 
@@ -114,14 +122,13 @@ class NingboAction extends Action {
 		         
 		         
 		        //$rk->poll(20000);
-		        \Jiaruan\DahuaUtil::rlog(microtime(true) . 'info', "kafka start poll");
-		
+		        \Jiaruan\DahuaUtil::rlog('info', "kafka start poll");
 		
+				$MAX_K = 2;
 				  $rec = 0;
 		        while ($rk->getOutQLen() > 0) {//让回调成功或失败生效
 						$rec++;
-					   if ($rec > 3) {
-						   \Jiaruan\DahuaUtil::rlog('WARN', "getOutQLen");
+					   if ($rec > $MAX_K) {
 							break;
 						}
 						$rk->poll(10);
@@ -134,7 +141,12 @@ class NingboAction extends Action {
 		        }
 		        */
 		$runTime = (microtime(true) - $startTime) * 1000; 
-		\Jiaruan\DahuaUtil::rlog(microtime(true) . 'info', 'push OK runTime:' . intval($runTime) . 'ms');
+		 if ($rec > $MAX_K) {
+			\Jiaruan\DahuaUtil::rlog('WARN', 'push perhaps failure runTime:' . intval($runTime) . 'ms');	  
+		 } else {
+			\Jiaruan\DahuaUtil::rlog('info', 'push OK runTime:' . intval($runTime) . 'ms');	 
+		 }
+		
 		
 		
 		        //sleep(2);
@@ -172,7 +184,7 @@ class NingboAction extends Action {
 		    $bit0_5 = date('ymdHis', time()); //220928140554
 		
 		    $bit6 = 0;
-		    $headBeat = 0;// 0 -> (0+1)*30=30秒  2 -> (2+1)*30=90秒
+		    $headBeat = 2;// 0 -> (0+1)*30=30秒  2 -> (2+1)*30=90秒
 		    $stationType = 0;
 		    \Jiaruan\DahuaUtil::setBit($bit6, ['0-6'], $headBeat);
 		    \Jiaruan\DahuaUtil::setBit($bit6, [7], $stationType);

+ 88 - 39
Home/Lib/Action/RouteRfidKafkaAction.class.php

@@ -7,7 +7,7 @@ class RouteRfidKafkaAction extends Action {
 
 
  
-	private  function addRfidDataToNingbo( $data ){
+	private  function addRfidDataToNingbo( $data, $conn ){
 		//{"methond":"track","mac":"ffc10063","gps":{"locationState":"A","lat":0,"latType":"N","lng":0,"lngType":"E"},"labels":[{"id":"01000423","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"160621112931"},{"id":"01000424","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"160621113202"},{"id":"01000422","event":{"dec":20,"lowBattery":0,"entry":1,"leave":0,"in":1},"time":"160621113303"}]}
 		//var_dump($data);
 		if($data['methond']=='login'){
@@ -15,11 +15,19 @@ class RouteRfidKafkaAction extends Action {
 		}
 		
 		$RF_ID=strtoupper($data['mac']);
-		//$station_sql='SELECT DEVICE_NAME FROM DSSC2.ADM_DEV WHERE LOGIN_NAME=\''.$RF_ID.'\'';
+		
 		$station_cond=array('mac'=>$RF_ID);
-		$device_name=M('station')->where($station_cond)->getField('name');
+		$device_name=M('stations')->where($station_cond)->getField('name');
+		if(!$device_name){
+			return array('success'=>false,'message'=>'addRfidDataToNingbo failed,station not existed!');
+		}
+		if($data['time']<(time()-180)){
+			$onlinetime=time();
+		}else{
+			$onlinetime=$data['time'];
+		}
 		$save_data=array(
-				'online_time'=>date('Y-m-d H:i:s',$data['time'])
+				'online_time'=>date('Y-m-d H:i:s',$onlinetime)
 		);
 		M('stations')->createSave($station_cond,$save_data);
 		if($data['methond']!='track'){
@@ -30,28 +38,13 @@ class RouteRfidKafkaAction extends Action {
 		}
 		
 		
-		
-		
-		
-		$host= '61.175.203.188';
-		$port=   '6521';
-		$instance_name= 'DSSC';
-		$username=  'dssc3';
-		$password=  'dssc3';
-		$conn = oci_connect($username, $password, $host.':'.$port.'/'. $instance_name,'AL32UTF8');
-		if (!$conn) {
-		   $e = oci_error();
-		   trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
-		}
-		
-		//stid = oci_parse($conn, $station_sql);
+		//$station_sql='SELECT DEVICE_NAME FROM DSSC2.ADM_DEV WHERE LOGIN_NAME=\''.$RF_ID.'\'';
+		//$stid = oci_parse($conn, $station_sql);
 		//oci_define_by_name($stid, 'DEVICE_NAME', $device_name);
 		//oci_execute($stid);
 		//oci_fetch($stid);
 		
-		if(!$device_name){
-			return array('success'=>false,'message'=>'addRfidDataToNingbo failed,station not existed!');
-		}
+		
 		
 		foreach($data['labels'] as $val){
 			$RF_STAT=0;
@@ -62,16 +55,29 @@ class RouteRfidKafkaAction extends Action {
 				$RF_STAT=2;
 			}
 			$RF_FLAGID=strtoupper($val['id']);
-			$vehicle_sql='SELECT o.PLATE_NO FROM DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s WHERE s.RFID_SN =\''.$RF_FLAGID.'\'  AND o.rfid_id = s.id  ';
+			if($RF_FLAGID=='00000000'){
+				continue;
+			}
+			$RF_DATE=date('Y-m-d H:i:s',$val['time']);
+			$sql = 'INSERT INTO "DSSC2"."W_DW_RF_RECORD"("ID", "RF_ID", "RF_FLAGID", "RF_DATE", "RF_STAT") VALUES (DSSC2.SEQ_W_DW_RF_RECORD.nextval, \''.$RF_ID.'\', \''.$RF_FLAGID.'\', TO_DATE(\''.$RF_DATE.'\', \'SYYYY-MM-DD HH24:MI:SS\'), \''.$RF_STAT.'\')';
+		 	//var_dump($sql); 
+			//插入数据到oracle轨迹表
+			$stid = oci_parse($conn, $sql);
+			
+		   $r = oci_execute($stid);
+			if(!$r){
+				$this->debug_log( 'insert_oracle_error', $val );
+				throw new \Exception('insert data to oracle false');
+			}
+			
 		
+			$vehicle_sql='SELECT o.PLATE_NO FROM DSSC3.W_DW_NON_MOTOR o,DSSC3.W_DW_RFID_TAGS s WHERE s.RFID_SN =\''.$RF_FLAGID.'\'  AND o.rfid_id = s.id  ';
 			$stid = oci_parse($conn, $vehicle_sql);
 			oci_define_by_name($stid, 'PLATE_NO', $plate_no);
 			oci_execute($stid);
 			oci_fetch($stid);
-			if(!$plate_no){
-				continue;
-			}
-			$RF_DATE=date('Y-m-d H:i:s',$val['time']);
+			var_dump($plate_no);
+			
 			$handle_data=array(
 				'RF_STAT'=>$RF_STAT,
 				'RF_FLAGID'=>$RF_FLAGID,
@@ -83,22 +89,21 @@ class RouteRfidKafkaAction extends Action {
 			
 			
 			$this->handleTotalData($handle_data);
+			if(!$plate_no){
+				continue;
+			}
 			//检测布控
-			$this->checkControlAlarm($handle_data,$conn);
+			$this->checkControlAlarm($handle_data);
 			//违规行驶检测  超速逆行检测
-			$this->checkIllegalDriving($handle_data,$conn);
-			$sql = 'INSERT INTO "DSSC2"."W_DW_RF_RECORD"("ID", "RF_ID", "RF_FLAGID", "RF_DATE", "RF_STAT") VALUES (DSSC2.SEQ_W_DW_RF_RECORD.nextval, \''.$RF_ID.'\', \''.$RF_FLAGID.'\', TO_DATE(\''.$RF_DATE.'\', \'SYYYY-MM-DD HH24:MI:SS\'), \''.$RF_STAT.'\')';
+			$this->checkIllegalDriving($handle_data);
+		
 			
-		 	//var_dump($sql); 
-			//插入数据到oracle轨迹表
-		 	//$res = $conn -> query($sql);
-			//保存基站信息
 		
 		
 		}
 		
 		oci_free_statement($stid);
-		oci_close($conn);
+		//oci_close($conn);
 		
 		 return array('success'=>true,'message'=>'add success');
 	}
@@ -152,7 +157,7 @@ class RouteRfidKafkaAction extends Action {
 		// Set where to start consuming messages when there is no initial offset in
 		// offset store or the desired offset is out of range.
 		// 'smallest': start from the beginning
-		$topicConf->set('auto.offset.reset', 'smallest');
+		$topicConf->set('auto.offset.reset', 'latest');
 		// Set the configuration to use for subscribed/assigned topics
 		$conf->setDefaultTopicConf($topicConf);
 		$consumer = new RdKafka\KafkaConsumer($conf);
@@ -161,13 +166,39 @@ class RouteRfidKafkaAction extends Action {
 		
 		// 订阅轨迹数据topic
 		$consumer->subscribe($topics);
+		
+		
+		
+		//任联
+		$host= '183.157.84.213';
+		$port=   '1521';
+		$instance_name= 'helowin';
+		$username=  'DSSC3';
+		$password=  'Rliandssc3';
+		
+		/*
+		$host= '192.168.100.23';
+		$port=   '1521';
+		$instance_name= 'helowin';
+		$username=  'DSSC3';
+		$password=  'Rliandssc3';
+		*/
+		$conn = oci_connect($username, $password, $host.':'.$port.'/'. $instance_name,'AL32UTF8');
+		if (!$conn) {
+		   $e = oci_error();
+		   trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
+		}
 		while (true) {
+			//var_dump($conn);
 		    $message = $consumer->consume(120*1000);
 		    switch ($message->err) {
 		        case RD_KAFKA_RESP_ERR_NO_ERROR:
 						 $data = json_decode($message->payload,true);
 						 if( $data ){
-							 $this->addRfidDataToNingbo($data);
+							
+							$this->addRfidDataToNingbo($data,$conn);
+							
+		
 							 //$this->addRfidDataToRenlian($data);
 						 }
 		            break;
@@ -178,6 +209,9 @@ class RouteRfidKafkaAction extends Action {
 		            echo "Timed out\n";
 		            break;
 		        default:
+					    echo "default break";
+						$this->debug_log( 'default_Log', $message->errstr() );
+						$this->debug_log( 'default_Log', $message->err );
 		            throw new \Exception($message->errstr(), $message->err);
 		            break;
 		    }
@@ -238,7 +272,6 @@ class RouteRfidKafkaAction extends Action {
 	
  
 	private  function addControlAlarm( $data ){
-		
 		$save_data=array(
 						'plate_no'=>$data['plate_no'],
 						'rfid_sn'=>$data['RF_FLAGID'],
@@ -450,7 +483,7 @@ class RouteRfidKafkaAction extends Action {
 				//$rk->setLogLevel(LOG_DEBUG);
 				$rk->addBrokers(C('KAFKA_BROKER_LIST'));
 				$topic = $rk->newTopic($topic);
-				$res='{"methond":"track","mac":"FF04B5C4","gps":{"locationState":"A","lat":0,"latType":"N","lng":0,"lngType":"E"},"labels":[{"id":"0308EC58","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"'.time().'"},{"id":"01000424","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"1667529922"},{"id":"01000422","event":{"dec":20,"lowBattery":0,"entry":1,"leave":0,"in":1},"time":"1667529922"}]}';
+				$res='{"methond":"track","mac":"FF0435EE","gps":{"locationState":"A","lat":0,"latType":"N","lng":0,"lngType":"E"},"labels":[{"id":"0308EC58","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"'.time().'"},{"id":"01000424","event":{"dec":8,"lowBattery":0,"entry":0,"leave":1,"in":0},"time":"1667529922"},{"id":"01000422","event":{"dec":20,"lowBattery":0,"entry":1,"leave":0,"in":1},"time":"1667529922"}]}';
 							
 		
 				$topic->produce(RD_KAFKA_PARTITION_UA, 0,$res);	
@@ -521,5 +554,21 @@ class RouteRfidKafkaAction extends Action {
 			
 	}
 	
+ 
+	public  function debug_log( $filename, $data ){
+		
+			$file = SOLUTION_LOG_PATH  .'/'.date("Ymd", time()) ."/".$filename.".log";
+		
+			$folder=dirname($file);
+			if (!is_dir($folder)){
+				mkdir($folder,0777,true);
+			}
+			if(is_array($data)){
+				$data = json_encode($data);
+			}
+			file_put_contents($file, '[' . date('Y-m-d H:i:s') . ']' . $data . PHP_EOL,FILE_APPEND);
+		
+	}
+	
 
 }

+ 238 - 0
Home/Lib/Action/V1Action.class.php

@@ -0,0 +1,238 @@
+<?php
+
+
+
+class V1Action extends Action {
+			
+
+
+ 
+	public  function kafka2createFile(  ){
+		
+		$broker_list = C('KAFKA_BROKER_LIST');
+		
+		if (empty($broker_list)) {
+			exit("KAFKA_BROKER_LIST must be config!".PHP_EOL);
+		}
+		$group = C('ROUTE_INDEX_KAFKA_GROUP_FTP');
+		if (empty($group)) {
+			exit("ROUTE_INDEX_KAFKA_GROUP_FTP must be config!".PHP_EOL);
+		}
+		$topics = C('ROUTE_INDEX_KAFKA_TOPIC');
+		if (empty($topics)) {
+			exit("ROUTE_INDEX_KAFKA_TOPIC must be config!".PHP_EOL);
+		}
+		$topics = explode(',',$topics);
+		
+		$conf = new RdKafka\Conf();
+		// Set a rebalance callback to log partition assignments (optional)
+		$conf->setRebalanceCb(function (RdKafka\KafkaConsumer $kafka, $err, array $partitions = null) {
+			switch ($err) {
+				case RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS:
+				echo "Assign: ";
+				var_dump($partitions);
+				$kafka->assign($partitions);
+				break;
+		
+				case RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS:
+				echo "Revoke: ";
+				var_dump($partitions);
+				$kafka->assign(NULL);
+				break;
+		
+				default:
+				throw new \Exception($err);
+			}
+		});
+		
+		// Configure the group.id. All consumer with the same group.id will consume
+		// different partitions.
+		$conf->set('group.id', $group);
+		
+		$conf->set('metadata.broker.list', $broker_list);
+		
+		$topicConf = new RdKafka\TopicConf();
+		
+		// Set where to start consuming messages when there is no initial offset in
+		// offset store or the desired offset is out of range.
+		// 'smallest': start from the beginning
+		$topicConf->set('auto.offset.reset', 'smallest');
+		
+		// Set the configuration to use for subscribed/assigned topics
+		$conf->setDefaultTopicConf($topicConf);
+		
+		$consumer = new RdKafka\KafkaConsumer($conf);
+		
+		// Subscribe to topic 'test'
+		$consumer->subscribe($topics);
+		
+		$tmp_list = array();
+		$start = time();
+		$count = 0;
+		
+		
+		//HC_YYYYMMDD_HHIISS.dat
+		//HC_YYYYMMDD_HHIISS.md5
+		$localDir = C('FTP_LOCAL_DIR');
+		$timeFram = time();
+		$createTime = date('Ymd_His', $timeFram);
+		$fileTimeInterval = C('FTP_FILE_CREATE_INTERVAL');
+		if(!$fileTimeInterval){
+			$fileTimeInterval = 30;
+		}
+		// $x = 0;
+		// $sum = 0;
+		while (true) {
+			$message = $consumer->consume(30*1000);
+			// $_st  = microtime(TRUE);
+			switch ($message->err) {
+				case RD_KAFKA_RESP_ERR_NO_ERROR:
+				$locationPack = ($message->payload).'\n';
+				
+				$fileName = $localDir.'/HC_'.json_decode($message->payload)->mac.$createTime . '.dat';
+				$runTime = time() - $timeFram;
+		
+				if($runTime < $fileTimeInterval){
+					$datRes = $this->writeRouteFile($fileName, $locationPack);
+				}else{
+					$md5Res = $this->createRouteMD5file($fileName);
+		
+					$timeFram = time();
+					$createTime = date('Ymd_His', $timeFram);
+					$datRes = $this->writeRouteFile($fileName);
+				}
+				break;
+				case RD_KAFKA_RESP_ERR__PARTITION_EOF:
+				echo "No more messages; will wait for more".PHP_EOL;
+				break;
+				case RD_KAFKA_RESP_ERR__TIMED_OUT:
+				$fileName = $localDir.'/HC_'.$createTime . '.dat';
+				$md5Res = $this->createRouteMD5file($fileName);
+				$timeFram = time();
+				$createTime = date('Ymd_His', $timeFram);
+				echo "Timed out\n";
+				break;
+				default:
+				throw new \Exception($message->errstr(), $message->err);
+				break;
+			}
+		}
+	}
+	
+ 
+	private  function writeRouteFile( $fileName, $data ){
+		//deviceid,positioninfo.longitude,positioninfo.latitude,receivetime
+		$config = C('FTP_CONFIG');
+		
+		$sRedis = Redis('open_vehicle', 'hash');
+		
+		$writeData = $data;
+		
+		if(!file_exists($fileName)){
+			$writeData = 'deviceid,positioninfo.longitude,positioninfo.latitude,receivetime'.PHP_EOL.$writeData;
+		}
+		debug_log('route_info.log',json_encode($writeData,JSON_UNESCAPED_UNICODE));
+		
+		$writeData = utf8_encode($writeData);
+		
+		$res = Zmcoding\FtpFile::getInstance($config)->writeFile($fileName, $writeData.PHP_EOL);
+		
+		return $res;
+	}
+	
+ 
+	private  function createRouteMD5file( $fileName ){
+		if(!file_exists($fileName)){
+			return false;
+		}
+		$contents = strlen( file_get_contents($fileName, null, null, 0, 1) );
+		if($contents == 0){
+			unlink($fileName);
+			return false;
+		}
+		$config = C('FTP_CONFIG');
+		$writeData = md5_file($fileName);
+		
+		$pathInfo = pathinfo($fileName);
+		$md5File = $pathInfo['dirname'].'/'.$pathInfo['filename'].'.md5';
+		
+		$writeData = $writeData. '  '. $pathInfo['basename'];
+		
+		$res = Zmcoding\FtpFile::getInstance($config)->writeFile($md5File, $writeData);
+		
+		return $res;
+	}
+	
+ 
+	private  function getT61GpsParseReslut( $data ){
+		if(!$data){
+			echo 'data empty!'.PHP_EOL;
+			return false;
+		}
+		$imei = $data['imei']['value'];
+		if(!$imei){
+			echo 'imei not existed!'.PHP_EOL;
+			return false;
+		}
+		if(!isset($data['lng']['value'])){
+			echo '['.$imei.']data.lng.value not set!'.PHP_EOL;
+			return false;
+		}
+		//检测是否有打包位置参数
+		$is_have_pkgfields = $data['extctrl']['extctrl_conf']['is_have_pkgfields'];
+		if(!$is_have_pkgfields){
+			echo '['.$imei.']is_have_pkgfields empty!'.PHP_EOL;
+			return false;
+		}
+		
+		//检测是否有打包位置参数
+		$pkt_count = hexdec($data['pkt_count']['hex_value']);
+		if(!$pkt_count){
+			echo '['.$imei.']pkt_count empty!'.PHP_EOL;
+			return false;
+		}
+		
+		$pkt_position_params = $data['pkt_position_params'];
+		if(!$pkt_position_params){
+			echo '['.$imei.']pkt_position_params empty!'.PHP_EOL;
+			return false;
+		}
+		
+		//解析基准点定位信息
+		$base_points_info = array(
+			'DeviceId' => $imei,
+			'AlarmStatus' => $data['alarm_status']['hex_value'],//告警状态
+			'DeviceStatus' => $data['device_status']['hex_value'],//设备状态
+			'Longitude' => $data['lng']['value'],
+			'Latitude' => $data['lat']['value'],
+			'DeviceTime' => $data['timestamp']['value'],//本次打包时,第一个终端位置数据采集时间
+			'Voltage' => $data['voltage']['value'],//终端外部供电电压
+		);
+		//var_dump($base_points_info);
+		//echo 'lat_hex = '.$data['lat']['hex_value'].',lng_hex = '.$data['lng']['hex_value'].PHP_EOL;
+		//解析打包位置参数
+		$list = array();
+		foreach($pkt_position_params as $key => $row){
+			$tmp = array();
+			$tmp['DeviceId'] = $base_points_info['DeviceId'];
+			$tmp['Altitude'] = $row['altitude']['value'];
+			$tmp['Speed'] = $row['speed']['value'];
+			$tmp['Direction'] = $row['direction']['value'];
+			$tmp['SatelliteCount'] = $row['satellite_count']['value'];
+			if($key < 1){
+				$tmp['DeviceTime'] = $row['relative_time']['value'] + $base_points_info['DeviceTime'];
+				$tmp['Latitude'] = ($row['lat']['value'] + $base_points_info['Latitude'])/1000000;
+				$tmp['Longitude'] = ($row['lng']['value'] + $base_points_info['Longitude'])/1000000;
+			}else{
+				$tmp['DeviceTime'] = $row['relative_time']['value'] + $list[$key-1]['DeviceTime'];	
+				$tmp['Latitude'] = $row['lat']['value']/1000000 + $list[$key-1]['Latitude'];
+				$tmp['Longitude'] = $row['lng']['value']/1000000 + $list[$key-1]['Longitude'];
+			}
+			$list[$key] = $tmp;
+		}
+		
+		return $list;
+	}
+	
+
+}

+ 4 - 4
Home/Lib/Class/DahuaUtil.php

@@ -85,11 +85,11 @@ class DahuaUtil
         //}
         static $LOG_CONSOLE = false;//是否输出到控制台 fpm需要为false cli可以为true
         static $LOG_NAME = "dahua.log";//值为空时 不写入文件
-        static $LOG_SIZE = 128 * 1024 * 1024;//文件最大尺寸 大于这个尺寸时 会生成个后缀.old的文件
+        static $LOG_SIZE = 1024 * 1024 * 1024;//文件最大尺寸 大于这个尺寸时 会生成个后缀.old的文件
 
         static $LOG_CACHE = true;//是否缓存日志内容 用于批量写入文件 如需强制刷新第一个参数传sync
-        static $CACHE_DURATION = 10;//缓存最大时间 秒
-        static $CACHE_SIZE = 1024;//缓存大小
+        static $CACHE_DURATION = 30;//缓存最大时间 秒
+        static $CACHE_SIZE = 1024 * 1024 * 1;//缓存大小
         static $cacheStartTime = 0;
         static $cacheBuf = '';
 
@@ -178,7 +178,7 @@ class DahuaUtil
 				if ($logCount > 100) {
                     clearstatcache();
                 }
-                //超过尺寸后 删除旧文件 把新文件重命名为旧文件  多进程同时操作 加锁问题不大
+                //超过尺寸后 删除旧文件 把新文件重命名为旧文件  多进程同时操作 加锁
                 if (($logCount == 1 || $logCount > $LOG_TIMES) && filesize($LOG_NAME) > $LOG_SIZE) {
                   //获取独占锁
                     $fp = fopen($LOG_NAME . '.lock', 'a');

+ 1 - 0
pushDataOracle.sh

@@ -0,0 +1 @@
+php /data/wwwroot/nbfd.rltest.cn/index.php route_rfid_kafka/pushRfidRouteToNingbo