一文教会你如何使用 iLogtail SPL 处理日志

作者:阿柄

随着流式处理的发展,出现了越来越多的工具和语言,使得数据处理变得更加高效、灵活和易用。在此背景下,SLS 推出了 SPL(SLS Processing Language) 语法,以此统一查询、端上处理、数据加工等的语法,保证了数据处理的灵活性。iLogtail 作为日志、时序数据采集器,在 2.0 版本中,全面支持了 SPL 。本文对处理插件进行了梳理,介绍了如何编写 SPL 语句,从插件处理模式迁移到 2.0 版本的 SPL 处理模式,帮助用户实现更加灵活的端上数据处理。

SPL

iLogtail 一共支持 3 种处理模式。

  • 原生插件模式: 由 C++ 实现的原生插件,性能最强。
  • 拓展插件模式: 由 Go 实现的拓展插件,提供了丰富的生态,足够灵活。
  • SPL 模式: 随着 iLogtail 2.0 在 C++ 处理插件中支持了 SPL 的处理能力,对数据处理能力带来了很大的提升,兼顾性能与灵活性。用户只需要编写 SPL 语句,即可以利用 SPL 的计算能力,完成对数据的处理。SPL 语法可以参考:https://help.aliyun.com/zh/sls/user-guide/spl-syntax/

总的来说,iLogtail 2.0 + SPL 主要有以下的优势:

  1. 统一数据处理语言: 对于同样一种格式的数据,用户可以在不同场景中使用同一种语言进行处理,提高了数据处理的效率
  2. 查询处理更高效: SPL 对弱结构化数据友好,同时 SPL 主要算子由 C++ 实现,接近 iLogtail 1.X 版本的原生性能
  3. 丰富的工具和函数: SPL 提供了丰富的内置函数和算子,用户可以更加灵活地进行组合
  4. 简单易学: SPL 属于一种低代码语言,用户可以快速上手,日志搜索、处理一气呵成

接下来,本文将介绍如何用灵活的 SPL 语句,实现其他两种处理模式相同的处理能力。

原生插件对比

正则解析

根据正则提取提取字段。输入 Nginx 格式:

127.0.0.1 - - [07/Jul/2022:10:43:30 +0800] "POST /PutData?Category=YunOsAccountOpLog" 0.024 18204 200 37 "-" "aliyun-sdk-java"

原有插件:

enable: true
inputs:- Type: input_fileFilePaths: - /workspaces/ilogtal/debug/simple.log
processors:- Type: processor_parse_regex_nativeSourceKey: contentRegex: ([\d\.]+) \S+ \S+ \[(\S+) \S+\] \"(\w+) ([^\\"]*)\" ([\d\.]+) (\d+) (\d+) (\d+|-) \"([^\\"]*)\" \"([^\\"]*)\"Keys:- ip- time- method- url- request_time- request_length- status- length- ref_url- browser
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-regexp content, '([\d\.]+) \S+ \S+ \[(\S+) \S+\] \"(\w+) ([^\\"]*)\" ([\d\.]+) (\d+) (\d+) (\d+|-) \"([^\\"]*)\" \"([^\\"]*)\"' as ip, time, method, url, request_time, request_length, status, length, ref_url, browser| project-away content
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"ip": "127.0.0.1","time": "07/Jul/2022:10:43:30","method": "POST","url": "/PutData?Category=YunOsAccountOpLog","request_time": "0.024","request_length": "18204","status": "200","length": "37","ref_url": "-","browser": "aliyun-sdk-java","__time__": "1713184059"
}

分隔符解析

根据分隔符分隔提取字段,输入:

127.0.0.1,07/Jul/2022:10:43:30 +0800,POST,PutData Category=YunOsAccountOpLog,0.024,18204,200,37,-,aliyun-sdk-java

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_delimiter_nativeSourceKey: contentSeparator: ","Quote: '"'Keys:- ip- time- method- url- request_time- request_length- status- length- ref_url- browser
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-csv content as ip, time, method, url, request_time, request_length, status, length, ref_url, browser| project-away content
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"ip": "127.0.0.1","time": "07/Jul/2022:10:43:30 +0800","method": "POST","url": "PutData?Category=YunOsAccountOpLog","request_time": "0.024","request_length": "18204","status": "200","length": "37","ref_url": "-","browser": "aliyun-sdk-java","__time__": "1713231487"
}

Json 解析

解析 json 格式日志,输入:

{"url": "POST /PutData?Category=YunOsAccountOpLog HTTP/1.1","ip": "10.200.98.220",    "user-agent": "aliyun-sdk-java",    "request": "{"status":"200","latency":"18204"}",    "time": "07/Jul/2022:10:30:28",    "__time__": "1713237315"}

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_json_nativeSourceKey: content
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-json content| project-away content
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{    "url": "POST /PutData?Category=YunOsAccountOpLog HTTP/1.1","ip": "10.200.98.220","user-agent": "aliyun-sdk-java","request": "{\"status\":\"200\",\"latency\":\"18204\"}","time": "07/Jul/2022:10:30:28","__time__": "1713237315"
}

正则解析+时间解析

根据正则表达式解析字段,并将其中的一个字段解析成日志时间,输入:

127.0.0.1,07/Jul/2022:10:43:30 +0800,POST,PutData Category=YunOsAccountOpLog,0.024,18204,200,37,-,aliyun-sdk-java

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_regex_nativeSourceKey: contentRegex: ([\d\.]+) \S+ \S+ \[(\S+) \S+\] \"(\w+) ([^\\"]*)\" ([\d\.]+) (\d+) (\d+) (\d+|-) \"([^\\"]*)\" \"([^\\"]*)\"Keys:- ip- time- method- url- request_time- request_length- status- length- ref_url- browser- Type: processor_parse_timestamp_nativeSourceKey: timeSourceFormat: '%Y-%m-%dT%H:%M:%S'
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |* | parse-regexp content, '([\d\.]+) \S+ \S+ \[(\S+)\] \"(\w+) ([^\\"]*)\" ([\d\.]+) (\d+) (\d+) (\d+|-) \"([^\\"]*)\" \"([^\\"]*)\"' as ip, time, method, url, request_time, request_length, status, length, ref_url, browser| extend ts=date_parse(time, '%Y-%m-%d %H:%i:%S')| extend __time__=cast(to_unixtime(ts) as INTEGER)| project-away ts| project-away content
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"ip": "127.0.0.1","time": "07/Jul/2022:10:43:30 +0800","method": "POST","url": "PutData?Category=YunOsAccountOpLog","request_time": "0.024","request_length": "18204","status": "200","length": "37","ref_url": "-","browser": "aliyun-sdk-java","__time__": "1713231487"
}

正则解析+过滤

根据正则表达式解析字段,并根据解析后的字段值过滤日志。输入:

127.0.0.1 - - [07/Jul/2022:10:43:30 +0800] "POST /PutData?Category=YunOsAccountOpLog" 0.024 18204 200 37 "-" "aliyun-sdk-java"
127.0.0.1 - - [07/Jul/2022:10:44:30 +0800] "Get /PutData?Category=YunOsAccountOpLog" 0.024 18204 200 37 "-" "aliyun-sdk-java"

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_regex_nativeSourceKey: contentRegex: ([\d\.]+) \S+ \S+ \[(\S+) \S+\] \"(\w+) ([^\\"]*)\" ([\d\.]+) (\d+) (\d+) (\d+|-) \"([^\\"]*)\" \"([^\\"]*)\"Keys:- ip- time- method- url- request_time- request_length- status- length- ref_url- browser- Type: processor_filter_regex_nativeFilterKey:- method- statusFilterRegex:- ^(POST|PUT)$- ^200$
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-regexp content, '([\d\.]+) \S+ \S+ \[(\S+) \S+\] \"(\w+) ([^\\"]*)\" ([\d\.]+) (\d+) (\d+) (\d+|-) \"([^\\"]*)\" \"([^\\"]*)\"' as ip, time, method, url, request_time, request_length, status, length, ref_url, browser| project-away content| where regexp_like(method, '^(POST|PUT)$') and regexp_like(status, '^200$')
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"ip": "127.0.0.1","time": "07/Jul/2022:10:43:30","method": "POST","url": "/PutData?Category=YunOsAccountOpLog","request_time": "0.024","request_length": "18204","status": "200","length": "37","ref_url": "-","browser": "aliyun-sdk-java","__time__": "1713238839"
}

脱敏

将日志中的敏感信息脱敏。输入:

{"account":"1812213231432969","password":"04a23f38"}

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_desensitize_nativeSourceKey: contentMethod: constReplacingString: "******"ContentPatternBeforeReplacedString: 'password":"'ReplacedContentPattern: '[^"]+'
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-regexp content, 'password":"(\S+)"' as password| extend content=replace(content, password, '******')
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"content": "{\"account\":\"1812213231432969\",\"password\":\"******\"}","__time__": "1713239305"
}

拓展插件对比

添加字段

在输出结果中添加字段,输入:

this is a test log

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_add_fieldsFields:service: AIgnoreIfExist: false
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend service='A'
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"content": "this is a test log","service": "A","__time__": "1713240293"
}

Json 解析+丢弃字段

解析 json 并删除解析后的指定字段。输入:

{"key1": 123456, "key2": "abcd"}

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_json_nativeSourceKey: content- Type: processor_dropDropKeys: - key1
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-json content| project-away content| project-away key1
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{    "key2": "abcd","__time__": "1713245944"
}

Json 解析+重命名字段

解析 json 并重命名解析后的字段。输入:

{"key1": 123456, "key2": "abcd"}

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_json_nativeSourceKey: content- Type: processor_renameSourceKeys:- key1DestKeys:- new_key1
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-json content| project-away content| project-rename new_key1=key1
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"new_key1": "123456","key2": "abcd","__time__": "1713249130"
}

Json 解析+过滤日志

解析 json 并根据字段条件过滤日志。输入:

{"ip": "10.**.**.**", "method": "POST", "browser": "aliyun-sdk-java"}
{"ip": "10.**.**.**", "method": "POST", "browser": "chrome"}
{"ip": "192.168.**.**", "method": "POST", "browser": "aliyun-sls-ilogtail"}

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_json_nativeSourceKey: content- Type: processor_filter_regexInclude:ip: "10\\..*"method: POSTExclude:browser: "aliyun.*"
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-json content| project-away content| where regexp_like(ip, '10\..*') and regexp_like(method, 'POST') and not regexp_like(browser, 'aliyun.*')
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"ip": "10.**.**.**","method": "POST","browser": "chrome","__time__": "1713246645"
}

Json 解析+字段值映射处理

解析 json 并根据字段值的不同,映射为不同的值。输入:

{"_ip_":"192.168.0.1","Index":"900000003"}
{"_ip_":"255.255.255.255","Index":"3"}

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_parse_json_nativeSourceKey: content- Type: processor_dict_mapMapDict:"127.0.0.1": "LocalHost-LocalHost""192.168.0.1": "default login"SourceKey: "_ip_"DestKey: "_processed_ip_"Mode: "overwrite"HandleMissing": trueMissing: "Not Detected"
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-json content| project-away content| extend _processed_ip_= CASE WHEN _ip_ = '127.0.0.1' THEN 'LocalHost-LocalHost' WHEN _ip_ = '192.168.0.1' THEN 'default login' ELSE 'Not Detected'END
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"_ip_": "192.168.0.1","Index": "900000003","_processed_ip_": "default login","__time__": "1713259557"
}

字符串替换

替换日志中的指定字符串。输入:

hello,how old are you? nice to meet you

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_string_replaceSourceKey: contentMethod: constMatch: "how old are you?"ReplaceString: ""
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend content=replace(content, 'how old are you?', '')
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{    "content": "hello, nice to meet you","__time__": "1713260499"
}

数据编码与解码

Base64

对日志进行 Base64 加密。输入:

this is a test log

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_base64_encodingSourceKey: contentNewKey: content1
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend content1=to_base64(cast(content as varbinary))
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{    "content": "this is a test log","content1": "dGhpcyBpcyBhIHRlc3QgbG9n","__time__": "1713318724"
}

MD5

对日志进行 MD5 加密。输入:

hello,how old are you? nice to meet you

原有插件:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_string_replaceSourceKey: contentMethod: constMatch: "how old are you?"ReplaceString: ""
flushers:- Type: flusher_stdoutOnlyStdout: true

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend content1=lower(to_hex(md5(cast(content as varbinary))))
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"content": "this is a test log","content1": "4f3c93e010f366eca78e00dc1ed08984","__time__": "1713319673"
}

新增能力项

数学计算

输入:4。

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend val = cast(content as double)| extend power_test = power(val, 2)| extend round_test = round(val)| extend sqrt_test = sqrt(val)
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"content": "4","power_test": 16.0,"round_test": 4.0,"sqrt_test": 2.0,"val": 4.0,"__time__": "1713319673"
}

URL 计算

URL 编码解码

输入:

https://homenew.console.aliyun.com/home/dashboard/ProductAndService

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend encoded = url_encode(content)| extend decoded = url_decode(encoded)
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"content": "https://homenew.console.aliyun.com/home/dashboard/ProductAndService","decoded": "https://homenew.console.aliyun.com/home/dashboard/ProductAndService","encoded": "https%3A%2F%2Fhomenew.console.aliyun.com%2Fhome%2Fdashboard%2FProductAndService","__time__": "1713319673"
}

URL 提取

输入:

https://sls.console.aliyun.com:443/lognext/project/dashboard-all/logsearch/nginx-demo?accounttraceid=d6241a173f88471c91d3405cda010ff5ghdw

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| extend host = url_extract_host(content)| extend query = url_extract_query(content)| extend path = url_extract_path(content) | extend protocol = url_extract_protocol(content) | extend port = url_extract_port(content) | extend param = url_extract_parameter(content, 'accounttraceid')
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{"content": "https://sls.console.aliyun.com:443/lognext/project/dashboard-all/logsearch/nginx-demo?accounttraceid=d6241a173f88471c91d3405cda010ff5ghdw","host": "sls.console.aliyun.com","param": "d6241a173f88471c91d3405cda010ff5ghdw","path": "/lognext/project/dashboard-all/logsearch/nginx-demo","port": "443","protocol": "https","query": "accounttraceid=d6241a173f88471c91d3405cda010ff5ghdw","__time__": "1713319673"
}

比较&逻辑运算符

输入:

{"num1": 199, "num2": 10, "num3": 9}

SPL:

enable: true
inputs:- Type: input_fileFilePaths:- /workspaces/ilogtail/debug/simple.log
processors:- Type: processor_splScript: |*| parse-json content| extend compare_result = cast(num1 as double) > cast(num2 as double) AND cast(num2 as double) > cast(num3 as double)
flushers:- Type: flusher_stdoutOnlyStdout: true

输出:

{    "compare_result": "true","content": "{\"num1\": 199, \"num2\": 10, \"num3\": 9}","num1": "199","num2": "10","num3": "9","__time__": "1713319673"
}

其他

更多能力请参考:https://help.aliyun.com/zh/sls/user-guide/function-overview

欢迎大家补充更多 iLogtail SPL 实践案例!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/57704.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

rpc的客户端为什么称为stub

1.client为什么是stub Stub 在分布式系统中是一种 代理对象(Proxy Object),它本质上是一个在本地系统中扮演远程服务角色的代理。 在早期的 RPC 术语中,客户端端叫做 Stub,而服务器端的处理部分叫做 Skeleton。这种对…

vue3使用i18n做国际化多语言,实现常量跟随语言切换翻译

因为我有一个常量的配置文件在项目中,而且有中文内容,我想在切换语言的时候,跟着这个翻译也实时切换,就可以使用computed计算属性实现。 把name改成下面的样子: name: computed(() > t(pad.regularMode)), 就可以…

深度学习:元学习(Meta-Learning)详解

元学习(Meta-Learning)详解 元学习,也称为“学会学习”,是机器学习中的一个重要子领域,旨在开发能够快速适应新任务或环境的模型,即使这些任务的可用数据非常有限。元学习的核心思想是通过经验学习如何学习…

Springboot配置方式和优先级

Springboot配置方式和优先级 调试思路key的获取过程application.properties优先级总结 在阅读开源项目时看到一种不太常见的属性配置方式,在项目根路径定义配置文件。并且提到下面的顺序,验证并看一下源码实现。 # spring boot支持外部application.yml …

N-gram详解

文章目录 一、什么是 N-gram?二、马尔可夫假设三、如何估计概率四、优缺点PS:补充参考 一、什么是 N-gram? 在自然语言处理中,n-gram 是一种重要的文本表示方法。n-gram 是指给定文本中连续的 n n n 个项目,这些项目可以是声音、单词、字…

Element Plus的el-tree-v2 组件实现仅叶子节点显示勾选框,并且只能单选

实现代码 <template><el-tree-v2:data"treeData":props"defaultProps"node-key"id"ref"treeRef"show-checkbox:check-strictly"true":expand-on-click-node"false"node-click"handleNodeClick&quo…

中小企业设备管理信息化:Spring Boot系统构建

摘要 随着信息技术在管理上越来越深入而广泛的应用&#xff0c;管理信息系统的实施在技术上已逐步成熟。本文介绍了中小企业设备管理系统的开发全过程。通过分析中小企业设备管理系统管理的不足&#xff0c;创建了一个计算机管理中小企业设备管理系统的方案。文章介绍了中小企业…

java springboot项目如何计算经纬度在围栏内以及坐标点距离

在Maven项目中&#xff0c;你可以通过向pom.xml文件中的<dependencies>部分添加以下内容&#xff0c;来添加GeoTools和JTS的依赖&#xff1a; xml <dependencies> <!-- JTS Topology Suite --> <dependency> <groupId>org.locationtech.jts…

AI服务器HBA卡的国产PCIe4.0/5.0 switch信号完整性设计与实现,支持定制(二)

表 &#xff12; 展示了 &#xff30;&#xff23;&#xff22; 板所选介质材料 &#xff30;&#xff33;&#xff32;&#xff14;&#xff10;&#xff10;&#xff10;&#xff21;&#xff35;&#xff33;&#xff17;&#xff10;&#xff13; &#xff0c; &#xff3…

FreeRTOS实时操作系统(2)

前言&#xff1a;FreeRTOS内容较多&#xff0c;分篇发布&#xff0c;较为基础&#xff0c;旨在梳理知识&#xff0c;适合入门的同学 &#xff08;基于正点原子STM32F103开发板V2&#xff09; &#xff08;对于本篇&#xff0c;若有疑问&#xff0c;欢迎在评论区留言&#xf…

萤石设备视频接入平台EasyCVR私有化视频平台变电站如何实现远程集中监控?

一、方案背景 随着城市经济的发展和电力系统的改造&#xff0c;变电站的数量和规模逐渐增加&#xff0c;对变电站的安全管理和监控需求也越来越高。视频监控系统作为重要的安全管理手段&#xff0c;在变电站中起到了关键的作用。 目前青犀视频研发的萤石设备视频接入平台EasyC…

[网络协议篇] UDP协议

文章目录 1. 简介2. 特点3. UDP数据报结构4. 基于UDP的应用层协议5. UDP安全性问题6. 使用udp传输数据的系统就一定不可靠吗&#xff1f;7. 基于UDP的主机探活 python实现 1. 简介 User Datagram Protocol&#xff0c;用户数据报协议&#xff0c;基于IP协议提供面向无连接的网…

CAN诊断答疑

1.”DUT不应该在开始CAN通信前发送显性脉冲或者无效的报文“这句话中的显性脉冲是什么意思 在CAN (Controller Area Network) 通信中&#xff0c;显性脉冲指的是 CAN 总线上的电压状态处于“显性”水平。当 CAN 总线上有两种电压状态&#xff1a; 显性状态 (Dominant state)&a…

Spring AOP原理

&#xff08;一&#xff09;Spring AOP原理 Spring AOP是基于动态代理来实现AOP的&#xff0c;但是在讲之前我们要来先认识一下代理模式 1.代理模式 其实代理模式很好理解&#xff0c;简单来说就是&#xff0c;原本有一个对象&#xff0c;然后来了另一个对象&#xff08;我们称…

26.Redis主从架构

Redis主从架构 redis主从架构搭建&#xff0c;配置从节点步骤&#xff1a; 1、复制一份redis.conf文件 2、将相关配置修改为如下值&#xff1a; port 6380 pidfile /var/run/redis_6380.pid # 把pid进程号写入pidfile配置的文件 logfile "6380.log" dir /usr/local/…

3D-IC——超越平面 SoC 芯片的前沿技术

“3D-IC”&#xff0c;顾名思义是“立体搭建的集成电路”&#xff0c;相比于传统平面SoC&#xff0c;3D-IC引入垂直堆叠芯片裸片&#xff08;die&#xff09;和使用硅通孔&#xff08;TSV&#xff09;等先进封装技术&#xff0c;再提高性能、降低功耗和增加集成度方面展现了巨大…

同世界,共北斗|遨游通讯亮相第三届北斗规模应用国际峰会!

10月24日&#xff0c;第三届北斗规模应用国际峰会在湖南省株洲市隆重开幕&#xff0c;此次峰会以“同世界&#xff0c;共北斗”为主题&#xff0c;旨在加速北斗系统的市场化进程、促进其产业化布局及国际化拓展。全国政协副主席、农工党中央常务副主席杨震讲话并宣布开幕&#…

window7虚拟机VMware与主机共享文件

文件管理器》计算机网络右键》属性》高级共享设置——全部启用 新建文件夹》右键》属性》共享》选择可以共享的用户——我这里选的是所有用户 点击高级共享》权限》保存设置——设置文件权限 文件管理器》计算机网络》右键》属性》————查看虚拟机计算机名称 主机访问 主机…

构建安全基石:网络安全等级保护定级指南

在数字化时代&#xff0c;网络安全已成为企业与个人不可忽视的重要课题。网络安全等级保护定级指南&#xff0c;作为国家指导网络安全保护的重要文件&#xff0c;为各类机构提供了精准的安全防护蓝图。本文旨在深度解析网络安全等级保护定级指南的精髓&#xff0c;助力建构全面…

HarmonyOS 5.0应用开发——Navigation实现页面路由

【高心星出品】 文章目录 Navigation实现页面路由完整的Navigation入口页面子页面 页面跳转路由拦截其他的 Navigation实现页面路由 Navigation&#xff1a;路由导航的根视图容器&#xff0c;一般作为页面&#xff08;Entry&#xff09;的根容器去使用&#xff0c;包括单页面&…