需要从一串信息中根据关键词提取相关信息:
{ "full": 1, "version": "*1.5.622*", "model": "MiCasaVerde VeraLite", "zwave_heal": 1, "temperature": "C", "serial_number": "35110793\n", "fwd1": "fwd7.mios.com", "fwd2": "fwd8.mios.com", "sections": [ { "name": "My Home", "id": 1 } ], "rooms": [ { "name": "Bedroom", "id": 1, "section": 1 }, { "name": "Kitchen", "id": 2, "section": 1 }, { "name": "Living Room", "id": 3, "section": 1 } ], "scenes": [ { "name": "LeavingHome", "id": 3, "room": 0, "active": 0 } ], "devices": [ { "name": "Dimmer", "altid": "10", "id": 7, "category": 2, "subcategory": 0, "room": 1, "parent": 1, "level": "100", "status": "1", "state": -1, "comment": "" }, { "name": "Fan", "altid": "8", "id": 5, "category": 3, "subcategory": 0, "room": 3, "parent": 1, "status": "1", "state": -1, "comment": "" } ], "categories": [ { "name": "Dimmable Light", "id": 2 }, { "name": "Switch", "id": 3 } ], "ir": 0, "irtx": "", "loadtime": 946684828, "dataversion": 684828193, "state": -1, "comment": "" }
比如"devices"里面的name和它对应的id。
怎么才能实现呢?
{ "full": 1, "version": "*1.5.622*", "model": "MiCasaVerde VeraLite", "zwave_heal": 1, "temperature": "C", "serial_number": "35110793\n", "fwd1": "fwd7.mios.com", "fwd2": "fwd8.mios.com", "sections": [ { "name": "My Home", "id": 1 } ], "rooms": [ { "name": "Bedroom", "id": 1, "section": 1 }, { "name": "Kitchen", "id": 2, "section": 1 }, { "name": "Living Room", "id": 3, "section": 1 } ], "scenes": [ { "name": "LeavingHome", "id": 3, "room": 0, "active": 0 } ], "devices": [ { "name": "Dimmer", "altid": "10", "id": 7, "category": 2, "subcategory": 0, "room": 1, "parent": 1, "level": "100", "status": "1", "state": -1, "comment": "" }, { "name": "Fan", "altid": "8", "id": 5, "category": 3, "subcategory": 0, "room": 3, "parent": 1, "status": "1", "state": -1, "comment": "" } ], "categories": [ { "name": "Dimmable Light", "id": 2 }, { "name": "Switch", "id": 3 } ], "ir": 0, "irtx": "", "loadtime": 946684828, "dataversion": 684828193, "state": -1, "comment": "" }
比如"devices"里面的name和它对应的id。
怎么才能实现呢?