8-23总结

总结一下JEVAWEBDEMO的例子
https://download.youkuaiyun.com/download/crystallf/11599848
若有需要,可私信

独立储能的现货电能量与调频辅助服务市场出清协调机制(Matlab代码实现)内容概要:本文围绕“独立储能的现货电能量与调频辅助服务市场出清协调机制”展开,提出了一种基于Matlab代码实现的优化模型,旨在协调独立储能系统在电力现货市场与调频辅助服务市场中的联合出清问题。文中结合鲁棒优化、大M法和C&CG算法处理不确定性因素,构建了多市场耦合的双层或两阶段优化框架,实现了储能资源在能量市场和辅助服务市场间的最优分配。研究涵盖了市场出清机制设计、储能运行策略建模、不确定性建模及求解算法实现,并通过Matlab仿真验证了所提方法的有效性和经济性。; 适合人群:具备一定电力系统基础知识和Matlab编程能力的研究生、科研人员及从事电力市场、储能调度相关工作的工程技术人员。; 使用场景及目标:①用于研究独立储能在多电力市场环境下的协同优化运行机制;②支撑电力市场机制设计、储能参与市场的竞价策略分析及政策仿真;③为学术论文复现、课题研究和技术开发提供可运行的代码参考。; 阅读建议:建议读者结合文档中提供的Matlab代码与算法原理同步学习,重点关注模型构建逻辑、不确定性处理方式及C&CG算法的具体实现步骤,宜在掌握基础优化理论的前提下进行深入研读与仿真调试。
<4>2025-08-23 23:02:15[NVMP]Main progress start ... <4>2025-08-23 23:02:16[AMS] MD start <4>2025-08-23 23:02:16[AVTS]rssi = -49, bitrate = 1500, encode_type = H264 <4>2025-08-23 23:02:16[MCU_PROXY]GET RESPONSE of PROXY AVAILABLE <4>2025-08-23 23:02:16[MCU_PROXY]GET RESPONSE of PROXY AVAILABLE <4>2025-08-23 23:02:17[AVTS]set ev stable if is_adc_valid = 0 <4>2025-08-23 23:02:17[ring]init! <4>2025-08-23 23:02:17[MCU_PROXY]get bpi_mode=1,mcu_rst_reason=2 <4>2025-08-23 23:02:17[TDPC]tdpc timer ctx init. <4>2025-08-23 23:02:17[NIFC]Link status: LINK_DOWN -> LINK_DOWN <4>2025-08-23 23:02:17[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:02:17[MCU_PROXY]bat_percent:87,bat_decimal:33,bat_voltage:3995,bat_temperature:30,charging_status:no charge,bat_capacity:5200 <4>2025-08-23 23:02:17[MCU_PROXY]system_time:1755961337,up_time:302348112,cam_uptime:3904354,charge_time:64,discharge_time:0 <4>2025-08-23 23:02:17[MCU_PROXY]wd_fail:0_0_0 <4>2025-08-23 23:02:17[MCU_PROXY]FREQ_INFO:2 0 0 3 1755685419 1755961202 <4>2025-08-23 23:02:17[CloudIot]{"infoType":2,"notiEnable":1,"richNotiEnable":1,"planEnable":0,"pushPlan":"0000-0000,127"} <4>2025-08-23 23:02:17[CloudIot]No need to sync <4>2025-08-23 23:02:17[CloudIot]********** conn_status:1, last_conn_status: 1 ****************** <4>2025-08-23 23:02:17[CloudIot]No need to sync <3>2025-08-23 23:02:17[HUB_MANAGE]support detection <3>2025-08-23 23:02:17[HUB_MANAGE]support personDetection <3>2025-08-23 23:02:17[HUB_MANAGE]support petDetection <3>2025-08-23 23:02:17[HUB_MANAGE]support vehicleDetection <3>2025-08-23 23:02:17[HUB_MANAGE]hub_manage start over. <4>2025-08-23 23:02:17[AVTS]encode_type: 0, change attr->bitrate: 1500 <4>2025-08-23 23:02:17[STM][0] stm_fd is allocated. channel = 0, type = video, flags = 0x1, mode = 0x1 <4>2025-08-23 23:02:17[STM]sd_recording stop, endtime(0) <4>2025-08-23 23:02:17[SnapshotIdx]post msg(0) time(0). <4>2025-08-23 23:02:17[STM]record stopped <4>2025-08-23 23:02:17[RTSP]register rtsp server done. <4>2025-08-23 23:02:17[clip]MB_DETECTION enabled, enable AMS <4>2025-08-23 23:02:17[STREAM_COMMON]set clips power down timeout: 10s. <4>2025-08-23 23:02:17[TapoCare]tapoCare start over. <4>2025-08-23 23:02:17[clip]clips stop, start ts:0, end ts: 0, clips last=0s. <4>2025-08-23 23:02:17[CHIME_CTRL]unpair list(num:0 mac:) <4>2025-08-23 23:02:17[Transmit]default_bufsize(65536) relay_bufsize(192512) <4>2025-08-23 23:02:17[HTTP]hub_auth usrname is HUB, password is , ciphertext:123456789 <4>2025-08-23 23:02:17[ring]start! <4>2025-08-23 23:02:17[ring]pre_stream_status: 0, stream_status: 0, http_status: 0, rtsp_status: 0, srtp_status: 0, main_stream_count: 0, minor_stream_count: 0, talk_count: 0 <4>2025-08-23 23:02:17[STM]record_plan new rec type:(motion) <4>2025-08-23 23:02:17[HUB_STORAGE]cur_rec_type:3 <4>2025-08-23 23:02:17[CloudIot]{"infoType":4,"msgPushEnable":1,"stream_status":0} <4>2025-08-23 23:02:17[CloudIot]{"eventType":0,"ringCycleStarttime":0,"ringCycleEndtime":0,"needImage":0,"lastCycleStarttime":0,"lastCycleEndtime":0,"ringEventId":""}. <4>2025-08-23 23:02:17[ring]--> RING_STATE_IDLE <4>2025-08-23 23:02:18[AVTS][0, 32]update ae_table(11900340/14113717,1755->2240) <4>2025-08-23 23:02:18[AVTS]31: 2620->2683 <4>2025-08-23 23:02:18[AVTS]33: 1570->2028 <4>2025-08-23 23:02:18[AVTS][TAG]ev=2725,dn=0,adc=592382,adc_boot=11900340 <4>2025-08-23 23:02:18[STM]found matched disk(1) has path "/dev/mmcblk0" <4>2025-08-23 23:02:18[STM] **** disk status: 0 -> 7 <4>2025-08-23 23:02:18[STM]disk->status from 0(offline) to 7(recognizing) <4>2025-08-23 23:02:18[STM]add disk 1 <4>2025-08-23 23:02:18[STM]disk->detect_status from 0(offline) to 1(normal) <4>2025-08-23 23:02:18[STM]sd card detect status: normal. <4>2025-08-23 23:02:18[STM]sd card write_protect status: 0. <4>2025-08-23 23:02:18[STM]disk version: 1.1.0.20250730 (1)20250823 23:02:18 <4>2025-08-23 23:02:18[STM]reading index info from /tmp/mnt/harddisk_1/index_info.bin for [video] on disk 1 <4>2025-08-23 23:02:18[STM]disk->status from 7(recognizing) to 2(normal) <4>2025-08-23 23:02:18[STM] **** disk status: 7 -> 2 <4>2025-08-23 23:02:18[STM]sd_available[1] <4>2025-08-23 23:02:18[STM]Success adding disk(1) <4>2025-08-23 23:02:18[SnapshotIdx]post msg(4) time(0). <4>2025-08-23 23:02:18[SnapshotIdx]snapshot available(1)! <4>2025-08-23 23:02:18[STM]current disk: [video]1, [pic]1, [crossline]1, [msg push pic]1 <4>2025-08-23 23:02:18[STM]battery cam get time from MCU, no need to update timestamp from sdcard <4>2025-08-23 23:02:18[STM] **** disk status: 2 -> 7 <4>2025-08-23 23:02:18[STM]sd_available[0] <4>2025-08-23 23:02:18[STM]Dropped cache: 2048 kB-> 3592 kB <4>2025-08-23 23:02:18[STM] **** disk status: 7 -> 2 <4>2025-08-23 23:02:18[STM]sd_available[1] <4>2025-08-23 23:02:18[STM]update index before change to pre_record <4>2025-08-23 23:02:18[STM]update event entry end status <4>2025-08-23 23:02:18[STM]record started <6>2025-08-23 23:02:19[KERNEL] device wlan0 entered promiscuous mode <6>2025-08-23 23:02:19[KERNEL] br-wan: port 1(wlan0) entered forwarding state <6>2025-08-23 23:02:19[KERNEL] br-wan: port 1(wlan0) entered forwarding state <6>2025-08-23 23:02:19[KERNEL] [TRK module]driver derive_key ok <6>2025-08-23 23:02:19[KERNEL] [TRK module]driver derive_key close ok <6>2025-08-23 23:02:19[KERNEL] mmc0: Got command interrupt 0x00000001 even though no command operation was in progress. <6>2025-08-23 23:02:19[KERNEL] mmc0: new high speed SDHC card at address aaaa <6>2025-08-23 23:02:19[KERNEL] mmcblk0: mmc0:aaaa SD32G 29.7 GiB <6>2025-08-23 23:02:19[KERNEL] mmcblk0: <6>2025-08-23 23:02:19[KERNEL] FAT-fs (mmcblk0): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. <6>2025-08-23 23:02:19[KERNEL] vpu_stop()-376: vpu has been stopped <4>2025-08-23 23:02:19[AMS] bpi_mode 1 <4>2025-08-23 23:02:19[AMS] bpi_mode 1 <4>2025-08-23 23:02:19[AMS] bpi_mode 1 <4>2025-08-23 23:02:19[AMS] bpi_mode 1 <4>2025-08-23 23:02:19[AMS] mini frame idx: 0, boot_time: 1389, frame_time: 858 <4>2025-08-23 23:02:19[AMS] mini frame idx: 1, boot_time: 1447, frame_time: 991 <4>2025-08-23 23:02:19[AMS] mini frame idx: 2, boot_time: 1857, frame_time: 1125 <4>2025-08-23 23:02:19[AMS] mini frame idx: 3, boot_time: 1968, frame_time: 1791 <4>2025-08-23 23:02:19[AMS] mini frame idx: 4, boot_time: 2101, frame_time: 1924 <4>2025-08-23 23:02:19[AMS] mini frame idx: 5, boot_time: 2239, frame_time: 2058 <4>2025-08-23 23:02:19[AMS] mini frame idx: 6, boot_time: 2367, frame_time: 2191 <4>2025-08-23 23:02:19[AMS] mini frame idx: 7, boot_time: 2501, frame_time: 2325 <4>2025-08-23 23:02:19[AMS] mini frame idx: 8, boot_time: 2631, frame_time: 2458 <4>2025-08-23 23:02:19[AMS] mini frame idx: 9, boot_time: 2768, frame_time: 2591 <4>2025-08-23 23:02:19[AMS] vframe_first_recv: 5966000 <4>2025-08-23 23:02:19[AMS] dla_first_recv: 5970000 <4>2025-08-23 23:02:19[AMS] mini md alarm timestamp: 5978 ms, frame pts: 1791 ms <4>2025-08-23 23:02:19[AMS] MD start <4>2025-08-23 23:02:19[clip]send clip event[1755961335~1755961355], event_type=2, event_time=1755961339, duration=20 <4>2025-08-23 23:02:19[clip]send clip event[1755961335~1755961355], event_type=2, event_time=1755961339, duration=20 <4>2025-08-23 23:02:19[STM]clip not start, event->chn:0 <4>2025-08-23 23:02:19[TapoCare]receive clip manage info, clip start time: 1755961335, clip end time: 1755961355, msgSubType: 2, time: 1755961339. <4>2025-08-23 23:02:19[tpssl][5.905]domain:aps1-device-tapo-care.i.tplinknbu.com idle --> dns query. <4>2025-08-23 23:02:19[STREAM_COMMON][5.923][event] req state: idle -> connecting. <4>2025-08-23 23:02:19[TapoCare]event go through elb <4>2025-08-23 23:02:19[STM]rec status change: pre => recording <4>2025-08-23 23:02:19[SnapshotIdx] clip state: idle -> prepare <4>2025-08-23 23:02:19[CloudIot]{"infoType":3,"clipStarttime":1755961335,"clipEndtime":1755961355} (2)20250823 23:02:20 <4>2025-08-23 23:02:19[STM]shm curr disk: 1, curr disk: 255 <4>2025-08-23 23:02:19[STM]finish releasing curr disk. <4>2025-08-23 23:02:19[NVMP]Main progress start done <4>2025-08-23 23:02:20[tpssl][6.023]DNS aps1-device-tapo-care.i.tplinknbu.com --> 18.141.59.214 (3)20250823 23:02:20 <3>2025-08-23 23:02:20[HUB_MANAGE]main start done prepare sync <4>2025-08-23 23:02:20[tpssl][6.141]ip:18.141.59.214 tcp connecting --> tcp connected. <4>2025-08-23 23:02:20[tpssl][6.202]ip:18.141.59.214 tcp connected --> ssl connecting. <4>2025-08-23 23:02:20[WLAN]WLAN STA CONNECTED. <4>2025-08-23 23:02:20[STM]skip recover <4>2025-08-23 23:02:20[STM]partition fctrl cur file id = 25 <4>2025-08-23 23:02:20[STM]next file id = 25 <4>2025-08-23 23:02:20[SnapshotIdx]post msg(2) time(0). <4>2025-08-23 23:02:20[STM]block type 0(sub 0), file 25 range [1838, 1838) empty <4>2025-08-23 23:02:20[SnapshotIdx]post msg(3) time(-1). <4>2025-08-23 23:02:20[SnapshotIdx]clean snapthot: time(-1) invalid! <4>2025-08-23 23:02:20[NIFC]Link status: LINK_DOWN -> LINK_LINKING_UP <4>2025-08-23 23:02:20[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:02:20[NIFC]Link status: LINK_DOWN -> LINK_LINKING_UP <4>2025-08-23 23:02:20[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:02:20[STM]MP4 mux context is initial, file: /tmp/mnt/harddisk_1/20250823_230215_tp00025.mp4 <4>2025-08-23 23:02:20[STM]Dropped cache: 824 kB-> 2532 kB <4>2025-08-23 23:02:20[tpssl][6.667]ip:18.141.59.214 ssl connecting --> ssl connected. <4>2025-08-23 23:02:20[STREAM_COMMON][6.694][event] req state: connecting -> connected. <4>2025-08-23 23:02:20[STREAM_COMMON][6.789][event] req state: connected -> send_req. <4>2025-08-23 23:02:20[STM]Dropped cache: 800 kB-> 2684 kB <4>2025-08-23 23:02:21[STM]stm_write time_cost(1089ms) ret(0) new(0) v_gop(361KB) a_gop(31KB) v_gop_time:(1755961335-1755961337), a_gop_time:(1755961335-1755961337) <4>2025-08-23 23:02:21[SnapshotIdx] clip state: prepare -> process <4>2025-08-23 23:02:21[SnapshotIdx]post msg(1) time(1755961335). <4>2025-08-23 23:02:21[STREAM_COMMON][7.039][event] req state: send_req -> recv_rsp. <4>2025-08-23 23:02:21[TapoCare]xtoken:8f60c5ff-453c-4b91-8fda-af297ac5d364, host:aps1-device-i-060d4195a7bb5c56e.tapo-care.i.tplinknbu.com:443, ip: 13.228.23.237. <4>2025-08-23 23:02:21[SnapshotIdx](/tmp/mnt/harddisk_1/snapshot/20250823/23/1755961335_0_00.jpg) success! <4>2025-08-23 23:02:21[STREAM_COMMON][7.170][video] req state: idle -> connecting. (4)20250823 23:02:22 <6>2025-08-23 23:02:32[KERNEL] br-wan: port 1(wlan0) entered forwarding state (5)20250823 23:02:34 <4>2025-08-23 23:02:21[ring]reload! <4>2025-08-23 23:02:21[ring]/connection_count/count msg <4>2025-08-23 23:02:21[ring]pre_stream_status: 0, stream_status: 0, http_status: 0, rtsp_status: 0, srtp_status: 0, main_stream_count: 0, minor_stream_count: 0, talk_count: 0 <4>2025-08-23 23:02:21[CloudIot]{"infoType":4,"msgPushEnable":1,"stream_status":0} <4>2025-08-23 23:02:24[NIFC]Link status: LINK_LINKING_UP -> LINK_UP <4>2025-08-23 23:02:24[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <2>2025-08-23 23:02:26[STREAM_COMMON]Fail to tcp connect with server ip: 13.228.23.237:443. <2>2025-08-23 23:02:26[STREAM_COMMON]video conn server 2 err: -1 <2>2025-08-23 23:02:26[STREAM_COMMON]video conn server 2 err: -1 <4>2025-08-23 23:02:28[STREAM_COMMON]video go through server 1 <4>2025-08-23 23:02:28[STREAM_COMMON][14.461][video] req state: connecting -> connected. <1>2025-08-23 23:02:28[STREAM_COMMON]get pre vu failed, clip start time: 1755961335 < vu utc: 1755961343 <4>2025-08-23 23:02:28[STREAM_COMMON]first vu pts: 8858360, vu utc: 1755961343, clip_startime: 1755961335. <4>2025-08-23 23:02:31[SnapshotIdx]post msg(2) time(0). <4>2025-08-23 23:02:35[STREAM_COMMON]clip stop, start pts:8858360, end pts:20858360, current vu pts:20858368. <4>2025-08-23 23:02:35[STREAM_COMMON]clips upload stop, expected start ts:1755961335, expected end ts: 1755961355, cur time: 1755961355, expected duration=20s. <4>2025-08-23 23:02:35[STREAM_COMMON]clips upload stop, actual start ts:1755961343, actual end ts: 1755961355, event time: 1755961339, actual duration=12.000s. <4>2025-08-23 23:02:35[STREAM_COMMON]ts total length: 2655743, last_time:6.609s, transmission bitrate: 401.837KB/s, video bitrate: 221.312KB/s <4>2025-08-23 23:02:35[STREAM_COMMON]RSSI: -49, TCP InSegs: 894, OutSegs:1892, RetransSegs:0, retrans:0.00% <4>2025-08-23 23:02:35[STREAM_COMMON]video_integrity_rate:0.600000 minimum required video_integrity_rate:0.500000 <4>2025-08-23 23:02:35[STREAM_COMMON][21.150][video] req state: connected -> idle. <4>2025-08-23 23:02:35[ring]reload! <4>2025-08-23 23:02:35[ring]/connection_count/count msg <4>2025-08-23 23:02:35[ring]pre_stream_status: 0, stream_status: 0, http_status: 0, rtsp_status: 0, srtp_status: 0, main_stream_count: 0, minor_stream_count: 0, talk_count: 0 (6)20250823 23:02:36 <4>2025-08-23 23:02:35[CloudIot]{"infoType":4,"msgPushEnable":1,"stream_status":0} <4>2025-08-23 23:02:35[tpssl][21.301]DNS aps1-device-i-060d4195a7bb5c56e.tapo-care.i.tplinknbu.com --> 13.228.23.237 <4>2025-08-23 23:02:35[STREAM_COMMON][21.307][summary] req state: idle -> connecting. <4>2025-08-23 23:02:37[clip]silent until 1755961366 <4>2025-08-23 23:02:37[clip]clips stop, start ts:1755961335, end ts: 1755961355, clips last=20s. <4>2025-08-23 23:02:37[STM]change gop end_time(1755961356->1755961355), clip duration(19) end_time(1755961355) gop start_time(1755961355) <4>2025-08-23 23:02:37[STM]video block reach endtime, stop clip, cur block[1755961355~1755961356], clip[1755961335~1755961355] <4>2025-08-23 23:02:37[SnapshotIdx] clip state: process -> idle <4>2025-08-23 23:02:37[SnapshotIdx] clip end! <4>2025-08-23 23:02:37[STM]update index before change to pre_record <4>2025-08-23 23:02:37[STM]update event entry end status <4>2025-08-23 23:02:37[SnapshotIdx]post msg(2) time(0). <4>2025-08-23 23:02:37[STM]write index info to /tmp/mnt/harddisk_1/index_info.bin for [video] on disk 1 <4>2025-08-23 23:02:38[clip]pir verified, start clip <4>2025-08-23 23:02:38[clip]silent until 1755961366 <4>2025-08-23 23:02:40[AMS] MD end <4>2025-08-23 23:02:40[STM]clip not start, event->chn:0 <4>2025-08-23 23:02:41[tpssl][27.739]connect with server: aps1-device-i-060d4195a7bb5c56e.tapo-care.i.tplinknbu.com --> 13.228.23.237:443 failed, connect status: 2, error_type: 1206. <2>2025-08-23 23:02:41[TapoCare]req [summary] failed, error_type: 1206. <4>2025-08-23 23:02:41[STREAM_COMMON][27.767][summary] req state: connecting -> idle. <4>2025-08-23 23:02:41[BATTERY]wait for everything prepared before power_down <4>2025-08-23 23:02:41[BATTERY]bpi_mode:1,mcu_rst:WDT,bat_percent:87,bat_decimal:33,bat_voltage:3995,mcu_up_tm:302369539,soc_up_tm:3925781,rtc_tm:1755961359 <4>2025-08-23 23:02:41[BATTERY]event[0]-enable:1, end_time=22 <4>2025-08-23 23:02:41[BATTERY]event[9]-enable:0, end_time=18 <4>2025-08-23 23:02:41[BATTERY]event[17]-enable:0, end_time=24 <4>2025-08-23 23:02:41[BATTERY]event[18]-enable:0, end_time=22 <4>2025-08-23 23:02:41[BATTERY]event[19]-enable:0, end_time=28 <4>2025-08-23 23:02:41[BATTERY]event[21]-enable:0, end_time=5 <4>2025-08-23 23:02:41[BATTERY]event[22]-enable:0, end_time=5 <5>2025-08-23 23:02:41[BATTERY]cur_time=28, will send power_down to MCU,soc work 27872 in 1s (7)20250823 23:02:56 <6>2025-08-23 23:02:56[KERNEL] device wlan0 entered promiscuous mode <6>2025-08-23 23:02:56[KERNEL] br-wan: port 1(wlan0) entered forwarding state <6>2025-08-23 23:02:56[KERNEL] br-wan: port 1(wlan0) entered forwarding state <6>2025-08-23 23:02:56[KERNEL] FAT-fs (mmcblk0): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. <6>2025-08-23 23:02:58[KERNEL] vpu_stop()-376: vpu has been stopped <4>2025-08-23 23:02:54[NVMP]Main progress start ... <4>2025-08-23 23:02:55[AVTS]rssi = -48, bitrate = 1500, encode_type = H264 <4>2025-08-23 23:02:55[STM] **** disk status: 0 -> 7 <4>2025-08-23 23:02:55[MCU_PROXY]GET RESPONSE of PROXY AVAILABLE <4>2025-08-23 23:02:55[AVTS]set ev stable if is_adc_valid = 0 <4>2025-08-23 23:02:55[ring]init! <4>2025-08-23 23:02:55[MCU_PROXY]GET RESPONSE of PROXY AVAILABLE <4>2025-08-23 23:02:56[MCU_PROXY]get bpi_mode=1,mcu_rst_reason=2 <4>2025-08-23 23:02:56[TDPC]tdpc timer ctx init. <4>2025-08-23 23:02:56[NIFC]Link status: LINK_DOWN -> LINK_DOWN <4>2025-08-23 23:02:56[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:02:56[CloudIot]{"infoType":2,"notiEnable":1,"richNotiEnable":1,"planEnable":0,"pushPlan":"0000-0000,127"} <4>2025-08-23 23:02:56[CloudIot]No need to sync <3>2025-08-23 23:02:56[HUB_MANAGE]support detection <4>2025-08-23 23:02:56[MCU_PROXY]bat_percent:87,bat_decimal:28,bat_voltage:3994,bat_temperature:30,charging_status:no charge,bat_capacity:5200 <4>2025-08-23 23:02:56[MCU_PROXY]system_time:1755961376,up_time:302387092,cam_uptime:3933314,charge_time:64,discharge_time:0 <4>2025-08-23 23:02:56[MCU_PROXY]wd_fail:0_0_0 <3>2025-08-23 23:02:56[HUB_MANAGE]support personDetection <3>2025-08-23 23:02:56[HUB_MANAGE]support petDetection <3>2025-08-23 23:02:56[HUB_MANAGE]support vehicleDetection <3>2025-08-23 23:02:56[HUB_MANAGE]hub_manage start over. <4>2025-08-23 23:02:56[MCU_PROXY]FREQ_INFO:2 0 0 4 1755685419 1755961202 <4>2025-08-23 23:02:56[AVTS]encode_type: 0, change attr->bitrate: 1500 <4>2025-08-23 23:02:56[STM]disk->status from 0(offline) to 7(recognizing) <4>2025-08-23 23:02:56[STM][0] stm_fd is allocated. channel = 0, type = video, flags = 0x1, mode = 0x1 <4>2025-08-23 23:02:56[STM]record stopped <4>2025-08-23 23:02:56[STM]sd_recording stop, endtime(0) <4>2025-08-23 23:02:56[SnapshotIdx]post msg(0) time(0). <4>2025-08-23 23:02:56[RTSP]register rtsp server done. <4>2025-08-23 23:02:56[clip]MB_DETECTION enabled, enable AMS <4>2025-08-23 23:02:56[STREAM_COMMON]set clips power down timeout: 10s. <4>2025-08-23 23:02:56[TapoCare]tapoCare start over. <4>2025-08-23 23:02:56[clip]clips stop, start ts:0, end ts: 0, clips last=0s. <4>2025-08-23 23:02:56[CloudIot]********** conn_status:1, last_conn_status: 1 ****************** <4>2025-08-23 23:02:56[CloudIot]No need to sync <4>2025-08-23 23:02:56[CHIME_CTRL]unpair list(num:0 mac:) <4>2025-08-23 23:02:56[Transmit]default_bufsize(65536) relay_bufsize(192512) <4>2025-08-23 23:02:56[HTTP]hub_auth usrname is HUB, password is , ciphertext:123456789 <4>2025-08-23 23:02:56[ring]start! <4>2025-08-23 23:02:56[ring]pre_stream_status: 0, stream_status: 0, http_status: 0, rtsp_status: 0, srtp_status: 0, main_stream_count: 0, minor_stream_count: 0, talk_count: 0 <4>2025-08-23 23:02:56[STM]found matched disk(1) has path "/dev/mmcblk0" <4>2025-08-23 23:02:56[STM]record_plan new rec type:(motion) <4>2025-08-23 23:02:56[HUB_STORAGE]cur_rec_type:3 <4>2025-08-23 23:02:56[STM]disk->status from 7(recognizing) to 7(recognizing) <4>2025-08-23 23:02:56[STM]add disk 1 <4>2025-08-23 23:02:56[CloudIot]{"infoType":4,"msgPushEnable":1,"stream_status":0} <4>2025-08-23 23:02:56[STM]disk->detect_status from 0(offline) to 1(normal) <4>2025-08-23 23:02:56[STM]sd card detect status: normal. <4>2025-08-23 23:02:56[STM]sd card write_protect status: 0. <4>2025-08-23 23:02:56[STM]disk version: 1.1.0.20250730 (8)20250823 23:02:58 <4>2025-08-23 23:02:56[CloudIot]{"eventType":0,"ringCycleStarttime":0,"ringCycleEndtime":0,"needImage":0,"lastCycleStarttime":0,"lastCycleEndtime":0,"ringEventId":""}. <4>2025-08-23 23:02:56[STM]reading index info from /tmp/mnt/harddisk_1/index_info.bin for [video] on disk 1 <4>2025-08-23 23:02:56[ring]--> RING_STATE_IDLE <4>2025-08-23 23:02:56[STM]disk->status from 7(recognizing) to 2(normal) <4>2025-08-23 23:02:56[STM] **** disk status: 7 -> 2 <4>2025-08-23 23:02:56[STM]sd_available[1] <4>2025-08-23 23:02:56[STM]Success adding disk(1) <4>2025-08-23 23:02:56[SnapshotIdx]post msg(4) time(0). <4>2025-08-23 23:02:56[SnapshotIdx]snapshot available(1)! <4>2025-08-23 23:02:56[STM]current disk: [video]1, [pic]1, [crossline]1, [msg push pic]1 <4>2025-08-23 23:02:56[STM]battery cam get time from MCU, no need to update timestamp from sdcard <4>2025-08-23 23:02:56[STM]Dropped cache: 2700 kB-> 4616 kB <4>2025-08-23 23:02:56[STM]update index before change to pre_record <4>2025-08-23 23:02:56[STM]update event entry end status <4>2025-08-23 23:02:56[STM]record started <4>2025-08-23 23:02:57[AVTS][TAG]ev=2298,dn=0,adc=718560,adc_boot=11598464 <4>2025-08-23 23:02:57[STM]record started <4>2025-08-23 23:02:58[AMS] bpi_mode 1 <4>2025-08-23 23:02:58[AMS] bpi_mode 1 <4>2025-08-23 23:02:58[AMS] bpi_mode 1 <4>2025-08-23 23:02:58[AMS] bpi_mode 1 (9)20250823 23:02:58 <4>2025-08-23 23:02:58[AMS] bpi_mode 1 <4>2025-08-23 23:02:58[AMS] dla_first_recv: 5819000 <4>2025-08-23 23:02:58[AMS] mini frame idx: 0, boot_time: 1409, frame_time: 891 <4>2025-08-23 23:02:58[AMS] mini frame idx: 1, boot_time: 1500, frame_time: 1024 <4>2025-08-23 23:02:58[AMS] mini frame idx: 2, boot_time: 1880, frame_time: 1158 <4>2025-08-23 23:02:58[AMS] mini frame idx: 3, boot_time: 1950, frame_time: 1758 <4>2025-08-23 23:02:58[AMS] mini frame idx: 4, boot_time: 2068, frame_time: 1891 <4>2025-08-23 23:02:58[AMS] mini frame idx: 5, boot_time: 2222, frame_time: 2024 <4>2025-08-23 23:02:58[AMS] mini frame idx: 6, boot_time: 2345, frame_time: 2158 <4>2025-08-23 23:02:58[AMS] mini frame idx: 7, boot_time: 2467, frame_time: 2291 <4>2025-08-23 23:02:58[AMS] mini frame idx: 8, boot_time: 2599, frame_time: 2424 <4>2025-08-23 23:02:58[AMS] mini frame idx: 9, boot_time: 2736, frame_time: 2558 <4>2025-08-23 23:02:58[AMS] vframe_first_recv: 5820000 <4>2025-08-23 23:02:58[NVMP]Main progress start done <4>2025-08-23 23:02:58[AMS] PD start <3>2025-08-23 23:02:58[HUB_MANAGE]main start done prepare sync <4>2025-08-23 23:02:58[clip]send clip event[1755961374~1755961394], event_type=26, event_time=1755961378, duration=20 <4>2025-08-23 23:02:58[clip]send clip event[1755961374~1755961394], event_type=26, event_time=1755961378, duration=20 <4>2025-08-23 23:02:58[STM]clip not start, event->chn:0 <4>2025-08-23 23:02:58[TapoCare]receive clip manage info, clip start time: 1755961374, clip end time: 1755961394, msgSubType: 21, time: 1755961378. <4>2025-08-23 23:02:58[tpssl][5.966]domain:aps1-device-tapo-care.i.tplinknbu.com idle --> dns query. <4>2025-08-23 23:02:58[STREAM_COMMON][5.977][event] req state: idle -> connecting. <4>2025-08-23 23:02:58[TapoCare]event go through elb <4>2025-08-23 23:02:58[STM]rec status change: pre => recording <4>2025-08-23 23:02:58[SnapshotIdx] clip state: idle -> prepare <4>2025-08-23 23:02:58[STM]shm curr disk: 1, curr disk: 255 <4>2025-08-23 23:02:58[STM]finish releasing curr disk. <4>2025-08-23 23:02:58[CloudIot]{"infoType":3,"clipStarttime":1755961374,"clipEndtime":1755961394} <4>2025-08-23 23:02:59[tpssl][6.022]DNS aps1-device-tapo-care.i.tplinknbu.com --> 13.215.11.227 <4>2025-08-23 23:02:59[tpssl][6.109]ip:13.215.11.227 tcp connecting --> tcp connected. <4>2025-08-23 23:02:59[tpssl][6.117]ip:13.215.11.227 tcp connected --> ssl connecting. <4>2025-08-23 23:02:59[tpssl][6.386]ip:13.215.11.227 ssl connecting --> ssl connected. <4>2025-08-23 23:02:59[STREAM_COMMON][6.438][event] req state: connecting -> connected. <4>2025-08-23 23:02:59[STM]MP4 mux context is initial, file: /tmp/mnt/harddisk_1/20250823_230215_tp00025.mp4 <4>2025-08-23 23:02:59[STM]Dropped cache: 1460 kB-> 2660 kB <4>2025-08-23 23:02:59[STREAM_COMMON][6.561][event] req state: connected -> send_req. <4>2025-08-23 23:02:59[STM]stm_write time_cost(630ms) ret(0) new(0) v_gop(210KB) a_gop(31KB) v_gop_time:(1755961374-1755961376), a_gop_time:(1755961374-1755961376) <4>2025-08-23 23:02:59[SnapshotIdx] clip state: prepare -> process <4>2025-08-23 23:02:59[SnapshotIdx]post msg(1) time(1755961374). <4>2025-08-23 23:02:59[SnapshotIdx](/tmp/mnt/harddisk_1/snapshot/20250823/23/1755961374_0_00.jpg) success! <4>2025-08-23 23:02:59[WLAN]WLAN STA CONNECTED. <4>2025-08-23 23:02:59[NIFC]Link status: LINK_DOWN -> LINK_LINKING_UP <4>2025-08-23 23:02:59[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:02:59[NIFC]Link status: LINK_DOWN -> LINK_LINKING_UP <4>2025-08-23 23:02:59[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:02:59[STREAM_COMMON][6.862][event] req state: send_req -> recv_rsp. <4>2025-08-23 23:02:59[TapoCare]xtoken:09131f48-c973-4382-b984-23c7bb1e6167, host:aps1-device-i-02f03ac0b78fce111.tapo-care.i.tplinknbu.com:443, ip: 13.229.52.92. <4>2025-08-23 23:02:59[STREAM_COMMON][6.886][video] req state: idle -> connecting. (10)20250823 23:03:00 <4>2025-08-23 23:02:59[ring]reload! <4>2025-08-23 23:02:59[ring]/connection_count/count msg <4>2025-08-23 23:02:59[ring]pre_stream_status: 0, stream_status: 0, http_status: 0, rtsp_status: 0, srtp_status: 0, main_stream_count: 0, minor_stream_count: 0, talk_count: 0 <4>2025-08-23 23:02:59[CloudIot]{"infoType":4,"msgPushEnable":1,"stream_status":0} <4>2025-08-23 23:03:00[STREAM_COMMON]video go through server 2 <4>2025-08-23 23:03:00[STREAM_COMMON][7.329][video] req state: connecting -> connected. <1>2025-08-23 23:03:00[STREAM_COMMON]get pre vu failed, clip start time: 1755961374 < vu utc: 1755961376 <4>2025-08-23 23:03:00[STREAM_COMMON]first vu pts: 2891580, vu utc: 1755961376, clip_startime: 1755961374. (11)20250823 23:03:00 <6>2025-08-23 23:03:11[KERNEL] br-wan: port 1(wlan0) entered forwarding state (12)20250823 23:03:12 <4>2025-08-23 23:03:00[AMS] MD start <4>2025-08-23 23:03:01[clip]send clip event[1755961374~1755961394], event_type=2, event_time=1755961381, duration=20 <4>2025-08-23 23:03:03[NIFC]Link status: LINK_LINKING_UP -> LINK_UP <4>2025-08-23 23:03:03[NIFC]IP: ********, mask: 255.255.255.0, gateway: 192.168.2.1, DNS: 192.168.1.1, 192.168.2.1, conn_type:0 <4>2025-08-23 23:03:07[AMS] PD end <4>2025-08-23 23:03:10[SnapshotIdx]post msg(2) time(0). <4>2025-08-23 23:03:10[SnapshotIdx]last_event(1755961335_1755961355_02) new_event(1755961374_1755961389_06) total(2) <4>2025-08-23 23:03:11[AMS] MD end <4>2025-08-23 23:03:11[clip]send clip event[1755961374~1755961394], event_type=0, event_time=0, duration=20 <4>2025-08-23 23:03:13[HTTP]New client accessing: 192.168.2.117 sock 43 <4>2025-08-23 23:03:13[HTTP]HTTPSessionSetSendBuf() tcp send_buf_size = 512KB <4>2025-08-23 23:03:13[HTTP]p2p startconnectTime: 20856 <4>2025-08-23 23:03:13[HTTP]p2p startconnectTime: 20857 <4>2025-08-23 23:03:13[HTTP] http client(local-0) add! <4>2025-08-23 23:03:13[HTTP][20.858] http client(local-0) state: idle -> idle <4>2025-08-23 23:03:13[HTTP]replay send(337) <4>2025-08-23 23:03:13[HTTP][20.882] http client(local-0) state: idle -> init <4>2025-08-23 23:03:13[HTTP]Authentication pass <4>2025-08-23 23:03:13[HTTP]replay send(348) <4>2025-08-23 23:03:13[HTTP]use HD resolution <4>2025-08-23 23:03:13[HTTP][20.954] http client(local-0) state: init -> ready <4>2025-08-23 23:03:13[HTTP]replay send(637) <4>2025-08-23 23:03:13[Transmit]stream(main) force iframe <4>2025-08-23 23:03:13[Transmit]init stream(preview) stream_id(0) <4>2025-08-23 23:03:13[Transmit]init stream(preview) stream_id(3) <4>2025-08-23 23:03:14[HTTP]Add a main stream, current main stream preview client count is 1 <4>2025-08-23 23:03:14[HTTP]current streams: main(1) minor(0) audio(0) playback(0) download(0) tapocare(1) talk(0) <4>2025-08-23 23:03:14[HTTP][21.041] http client(local-0) state: ready -> playing <4>2025-08-23 23:03:14[STREAM_COMMON]clip stop, start pts:2891580, end pts:20891580, current vu pts:20891589. <4>2025-08-23 23:03:14[STREAM_COMMON]clips upload stop, expected start ts:1755961374, expected end ts: 1755961394, cur time: 1755961394, expected duration=20s. <4>2025-08-23 23:03:14[STREAM_COMMON]clips upload stop, actual start ts:1755961376, actual end ts: 1755961394, event time: 1755961378, actual duration=18.000s. <4>2025-08-23 23:03:14[STREAM_COMMON]ts total length: 4161741, last_time:14.130s, transmission bitrate: 294.532KB/s, video bitrate: 231.208KB/s <4>2025-08-23 23:03:14[STREAM_COMMON]RSSI: -48, TCP InSegs: 1586, OutSegs:3210, RetransSegs:0, retrans:0.00% <4>2025-08-23 23:03:14[STREAM_COMMON]video_integrity_rate:0.900000 minimum required video_integrity_rate:0.500000 <4>2025-08-23 23:03:14[STREAM_COMMON][21.714][video] req state: connected -> idle. <4>2025-08-23 23:03:15[ring]reload! <4>2025-08-23 23:03:15[ring]/connection_count/count msg <4>2025-08-23 23:03:15[ring]pre_stream_status: 0, stream_status: 1, http_status: 1, rtsp_status: 0, srtp_status: 0, main_stream_count: 1, minor_stream_count: 0, talk_count: 0 <4>2025-08-23 23:03:15[ring]reload! <4>2025-08-23 23:03:15[ring]/connection_count/count msg <4>2025-08-23 23:03:15[ring]pre_stream_status: 1, stream_status: 1, http_status: 1, rtsp_status: 0, srtp_status: 0, main_stream_count: 1, minor_stream_count: 0, talk_count: 0两段,一段少了2秒,一段少了8秒。分析一下
11-28
我们来深入分析你提供的日志中 **两次事件剪辑(clip)上传过程**,分别出现了: - 第一次:`actual duration = 12s`(期望 20s,少了 8s) - 第二次:`actual duration = 18s`(期望 20s,少了 2s) 我们将结合时间戳、视频帧可用性、系统状态等信息进行对比和归因。 --- ## ✅ 日志关键事件提取与对比 | 项目 | 第一次事件(约 23:02:19) | 第二次事件(约 23:02:58) | |------|--------------------------|----------------------------| | **事件触发时间** | `event_time=1755961339` | `event_time=1755961378` | | **预期时间段** | 1755961335 ~ 1755961355(20s) | 1755961374 ~ 1755961394(20s) | | **实际开始时间** | 1755961343 | 1755961376 | | **实际结束时间** | 1755961355 | 1755961394 | | **实际持续时间** | 12 秒 | 18 秒 | | **缺失时长** | **8 秒** | **2 秒** | | **失败原因提示** | `get pre vu failed, clip start time < vu utc` | 同上,但差距更小 | --- ## 🔍 核心机制回顾:为什么“前录”会失败? 摄像头在检测到运动事件后,希望生成一个包含“事件发生前 + 发生中”的完整视频片段。这个功能依赖于: ### 📌 Pre-record(预录)机制 - 摄像头持续将视频流缓存到内存环形缓冲区(ring buffer),通常是最近的 10~30 秒。 - 当事件触发时,从 `clip_start_time` 开始读取该缓冲区中的数据。 - 但由于 H.264 编码特性,**必须从 I 帧(关键帧)开始解码**。 - 因此,即使有数据,若没有合适的 I 帧,就只能等到下一个 I 帧才能开始编码输出 → 导致起始点后移。 --- ## 🧩 分析第一次事件(少 8 秒) ```log <4>2025-08-23 23:02:19[clip]send clip event[1755961335~1755961355] ... <1>2025-08-23 23:02:28[STREAM_COMMON]get pre vu failed, clip start time: 1755961335 < vu utc: 1755961343 <4>2025-08-23 23:02:28[STREAM_COMMON]first vu pts: 8858360, vu utc: 1755961343 ``` - 系统想从 `1755961335` 开始 - 实际第一个可用视频帧(vu utc)是 `1755961343` - 差值:**8 秒** 💡 这说明: - 在 `1755961335` 到 `1755961343` 之间虽然可能有 P/B 帧,但没有可作为起点的 I 帧 - 或者环形缓冲区尚未完全初始化或填充 🔍 可能原因: 1. **设备刚启动不久**,视频编码器还未稳定输出足够历史帧 2. **I 帧间隔太长(GOP 太大)** - 若每 10 秒才一个 I 帧,则最多可能丢失近 10 秒前录 3. **网络连接延迟导致上传延迟判断时机不准** ✅ 结论:**首次事件因 GOP 过长 + 系统刚启动 → 前录缺失严重(8s)** --- ## 🧩 分析第二次事件(少 2 秒) ```log <4>2025-08-23 23:02:58[clip]send clip event[1755961374~1755961394] ... <1>2025-08-23 23:03:00[STREAM_COMMON]get pre vu failed, clip start time: 1755961374 < vu utc: 1755961376 <4>2025-08-23 23:03:00[STREAM_COMMON]first vu pts: 2891580, vu utc: 1755961376 ``` - 预期开始:`1755961374` - 实际开始:`1755961376` - 差值:**2 秒** ✅ 显著改善! 💡 说明此时系统已运行一段时间,环形缓冲区已有连续数据,且最近的 I 帧距离事件仅差 2 秒。 👉 这表明: - 视频流已经稳定 - GOP 设置为大约每 2~3 秒一个 I 帧(合理配置) - 缓冲区管理正常工作 ✅ 结论:**系统进入稳定状态 → 前录恢复能力增强 → 仅丢失 2s** --- ## 📊 对比总结表 | 维度 | 第一次事件(-8s) | 第二次事件(-2s) | 解释 | |------|------------------|------------------|------| | **系统状态** | 刚开机/唤醒 | 已运行稳定 | 影响缓冲区初始化 | | **期望开始时间** | 1755961335 | 1755961374 | —— | | **首个可用帧时间** | 1755961343 | 1755961376 | 差 8s vs 差 2s | | **缺失原因** | 无可用 I 帧 | 最近 I 帧稍晚 | | **根本因素** | GOP 过长 + 缓冲未满 | 正常调度延迟 | | **是否可接受** | ❌ 不理想 | ✅ 可接受 | --- ## 🛠️ 改进建议(如何减少 pre-record 丢失) ### 1. **缩短 GOP(Group of Pictures)长度** 确保每 2 秒至少一个 I 帧: ```c // 示例代码:设置 GOP size = 60(假设帧率 30fps) encoder_set_fps(&enc_ctx, 30); encoder_set_gop_size(&enc_ctx, 60); // 每 2 秒一个 I 帧 ``` > 推荐:GOP ≤ 2 秒(即 60 帧以内) --- ### 2. **强制插入 I 帧在事件触发时** 当检测到 motion 或 person detection,立即请求编码器插入 IDR 帧: ```c void on_motion_detected() { request_idr_frame(); // 强制生成关键帧 start_clip_recording(); } ``` 这样可以保证事件发生时刻附近有一个强同步点。 --- ### 3. **增大环形缓冲区内存大小** 确保至少缓存 15 秒以上的压缩视频数据用于 pre-record: ```c #define PRE_RECORD_BUFFER_MS 15000 // 15秒 allocate_ring_buffer(PRE_RECORD_BUFFER_MS); ``` 避免因缓冲区过小被覆盖。 --- ### 4. **优化启动流程:等待视频流稳定后再启用事件响应** 在设备启动初期,先不处理事件,直到收到第一个 I 帧并确认编码器就绪: ```c if (video_stream_ready && first_i_frame_received) { enable_motion_detection(); } ``` 否则容易出现首段事件无法回溯的问题。 --- ### 5. **监控 `video_integrity_rate` 并告警** 日志中已有指标: ```log video_integrity_rate:0.600000 minimum required:0.500000 video_integrity_rate:0.900000 minimum required:0.500000 ``` - 第一次:60% → 虽然大于阈值,但仍偏低 - 第二次:90% → 表示完整性高 ✅ 建议: - 若 `video_integrity_rate < 0.8`,上报质量警告 - 可通过 APP 提醒用户调整 GOP 或检查性能 --- ## ✅ 总结结论 | 问题 | 原因 | 解决方案 | |------|------|-----------| | **第一次少 8 秒** | 设备刚启动,环形缓冲区未填满,且 GOP 过长导致无法找到合适 I 帧 | 优化启动逻辑,缩短 GOP,延迟开启事件响应 | | **第二次少 2 秒** | 属于正常调度偏差,在可接受范围内 | 保持当前参数即可,无需干预 | > ✅ **结论:这是典型的“冷启动 vs 热运行”差异。第二次表现良好,说明系统设计基本合理;第一次需优化初始化策略以提升用户体验。** ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值