diff options
| author | handingkang <[email protected]> | 2024-01-19 17:50:57 +0800 |
|---|---|---|
| committer | handingkang <[email protected]> | 2024-01-19 17:50:57 +0800 |
| commit | c423b3072b19c34a7f777cfa7e019baac6c3d7f1 (patch) | |
| tree | 60fb4edd5df29a4cb835211ce6c2d0b0ac8b5250 /script | |
| parent | 54a5df53fb0c69c3a812234702335451c356c369 (diff) | |
Diffstat (limited to 'script')
| -rw-r--r-- | script/neo4jcommand.py | 15 | ||||
| -rw-r--r-- | script/sched.py | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/script/neo4jcommand.py b/script/neo4jcommand.py index b12d509..64cf051 100644 --- a/script/neo4jcommand.py +++ b/script/neo4jcommand.py @@ -33,8 +33,19 @@ CALL gds.pageRank.stream('myGraph') YIELD nodeId, score with gds.util.asNode(nodeId) as n WHERE n.IPType contains "6" -RETURN n.IP as ip, n.ISP as isp,n.CCODE as ccode,n.COU as cou,n.PROV as prov, score -ORDER BY score DESC, ip ASC,isp ASC,ccode ASC,cou ASC,prov ASC limit 30''' +RETURN n.IP as ip, n.ISP as isp,n.CCODE as ccode,n.COU as cou,n.PROV as prov, n.LAT as lat,n.LNG as lng ,score +ORDER BY score DESC limit %s''' + +# 高危节点邻居 +dnode_neighbor = ''' +CALL gds.pageRank.stream('myGraph') +YIELD nodeId, score +WHERE gds.util.asNode(nodeId).IPType contains "6" +with gds.util.asNode(nodeId) AS no, score ORDER BY score DESC limit %s +with collect(no) as nlist +MATCH (m:NodeResolver53)-[r:IP_LINK]->(n:NodeResolver53) +WHERE n in nlist and m.IPType contains "4" +RETURN n.IP,r.W,m''' # 节点邻居 node_neighbors = '''MATCH(n:NodeResolver53{IP:'%s'})-[]->(m:NodeResolver53) RETURN m''' diff --git a/script/sched.py b/script/sched.py index 44b3622..60eaf5b 100644 --- a/script/sched.py +++ b/script/sched.py @@ -174,6 +174,9 @@ def refresh_neo4j(): except Exception as e: log.error(e) + # 获取高危节点及其邻居节点信息 + DANGER_noderesult = to_dataframe(db.cypher_query(dangerous_nodes, retry_on_session_expire=True)) + log.info("完成数据一轮刷新,下一次刷新开始于: " + str(int(idle_seconds())) + "秒后") |
