Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
speech_nlu_parse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵文静
speech_nlu_parse
Commits
22207490
Commit
22207490
authored
Aug 05, 2025
by
赵文静
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改音量调节,增加判断仅只有符号的情况
parent
2645ae89
Pipeline
#5668
passed with stage
in 0 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
CHANGELOG.md
CHANGELOG.md
+4
-0
c2c.http
c2c.http
+5
-5
service/speechNlu/domain.go
service/speechNlu/domain.go
+17
-1
No files found.
CHANGELOG.md
View file @
22207490
# 更新日志
# 更新日志
## [3.4.4-beta] - 2025.8.5
### Changed
-
修改音量调节,增加判断仅只有符号的情况
## [3.4.3] - 2025.7.4
## [3.4.3] - 2025.7.4
### Changed
### Changed
-
上线正式服
-
上线正式服
...
...
c2c.http
View file @
22207490
...
@@ -26,7 +26,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
...
@@ -26,7 +26,7 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
"ip": "14.215.222.17",
"ip": "14.215.222.17",
"mac": "ece154a865eb",
"mac": "ece154a865eb",
"mid": "11011",
"mid": "11011",
"query":"
播放三国演义
" ,
"query":"
声音调得小一点
" ,
"requestId": "123456111"
"requestId": "123456111"
}
}
###
###
...
@@ -40,13 +40,13 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
...
@@ -40,13 +40,13 @@ X-AppKey: 391b50b5ed634fc49a3db7cfd6bc40db
"ip": "14.215.222.17",
"ip": "14.215.222.17",
"mac": "ece154a865eb",
"mac": "ece154a865eb",
"mid": "10f05",
"mid": "10f05",
"query":"
我想听梁山伯与祝英台
",
"query":"
声音升高10
",
"requestId": "123456111"
"requestId": "123456111"
}
}
###
###
#
POST https://nlu.gree.com/semantic/unisoundc2c/querys
POST https://nlu.gree.com/semantic/unisoundc2c/querys
POST https://testnlu.gree.com/semantic/unisoundc2c/querys
#
POST https://testnlu.gree.com/semantic/unisoundc2c/querys
#POST http://172.28.124.216:9999/semantic/unisoundc2c/querys
#POST http://172.28.124.216:9999/semantic/unisoundc2c/querys
#POST http://172.28.5.39:9999/semantic/unisoundc2c/querys
#POST http://172.28.5.39:9999/semantic/unisoundc2c/querys
Content-Type: application/json
Content-Type: application/json
...
@@ -61,7 +61,7 @@ Content-Type: application/json
...
@@ -61,7 +61,7 @@ Content-Type: application/json
"trafficParameter": "mode=childxxx;macWifi=28b77c218ed1;mid=10f05;vender=7e000025;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;"
"trafficParameter": "mode=childxxx;macWifi=28b77c218ed1;mid=10f05;vender=7e000025;macVoice=testyuntiancloud;ver=3.0;scenario=smarthome;filterName=nlu;req_nlu_length=1;returnType=json;fullDuplex=true;appendLength=1;additionalService=geli_nlu2;version=0.5;filterUrl=https://testnlu.gree.com:443/semantic/unisoundc2c/querys;"
},
},
"nluRet": {
"nluRet": {
"text": "
上一首
"
"text": "
珠海天气
"
},
},
"postProc": {}
"postProc": {}
}
}
...
...
service/speechNlu/domain.go
View file @
22207490
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"encoding/json"
"encoding/json"
"errors"
"errors"
"fmt"
"fmt"
"log"
"regexp"
"regexp"
"speech-nlu-parse/global"
"speech-nlu-parse/global"
"speech-nlu-parse/model"
"speech-nlu-parse/model"
...
@@ -734,12 +735,24 @@ func globalCtrlDomain(params *model.SpeechDomainParams) []byte {
...
@@ -734,12 +735,24 @@ func globalCtrlDomain(params *model.SpeechDomainParams) []byte {
if
volume
!=
""
&&
params
.
SpeechWsResp
.
Dm
.
Command
.
Api
==
"DUI.MediaController.SetVolume"
{
if
volume
!=
""
&&
params
.
SpeechWsResp
.
Dm
.
Command
.
Api
==
"DUI.MediaController.SetVolume"
{
if
strings
.
Contains
(
volume
,
"-"
)
||
strings
.
Contains
(
volume
,
"+"
)
{
if
strings
.
Contains
(
volume
,
"-"
)
||
strings
.
Contains
(
volume
,
"+"
)
{
var
sign
,
numStr
,
action
string
// 检查纯符号
if
volume
==
"-"
{
semanticParams
:=
make
(
map
[
string
]
interface
{})
semanticParams
[
"degree"
]
=
model
.
ParamsStr
{
Origin
:
"一"
,
Norm
:
"1"
,
Code
:
0
}
return
transformGreeProtocolReply
(
query
,
"UniversalControl"
,
"control_reduceVol"
,
&
semanticParams
)
}
else
if
volume
==
"+"
{
semanticParams
:=
make
(
map
[
string
]
interface
{})
semanticParams
[
"degree"
]
=
model
.
ParamsStr
{
Origin
:
"一"
,
Norm
:
"1"
,
Code
:
0
}
return
transformGreeProtocolReply
(
query
,
"UniversalControl"
,
"control_riseVol"
,
&
semanticParams
)
}
// 检查符号+数字(如 "-5")
pattern
:=
`([+-]?)(\d+)`
// 分组1:符号(+/-),分组2:数字
pattern
:=
`([+-]?)(\d+)`
// 分组1:符号(+/-),分组2:数字
re
:=
regexp
.
MustCompile
(
pattern
)
re
:=
regexp
.
MustCompile
(
pattern
)
// 查找所有匹配项
// 查找所有匹配项
matches
:=
re
.
FindAllStringSubmatch
(
volume
,
-
1
)
matches
:=
re
.
FindAllStringSubmatch
(
volume
,
-
1
)
var
sign
,
numStr
,
action
string
for
_
,
match
:=
range
matches
{
for
_
,
match
:=
range
matches
{
sign
=
match
[
1
]
// 符号部分(可能为空)
sign
=
match
[
1
]
// 符号部分(可能为空)
...
@@ -754,6 +767,9 @@ func globalCtrlDomain(params *model.SpeechDomainParams) []byte {
...
@@ -754,6 +767,9 @@ func globalCtrlDomain(params *model.SpeechDomainParams) []byte {
semanticParams
[
"degree"
]
=
model
.
ParamsStr
{
Origin
:
"一"
,
Norm
:
"1"
,
Code
:
0
}
semanticParams
[
"degree"
]
=
model
.
ParamsStr
{
Origin
:
"一"
,
Norm
:
"1"
,
Code
:
0
}
}
}
log
.
Println
(
"11111111111111111"
)
fmt
.
Println
(
sign
)
if
sign
==
"-"
{
if
sign
==
"-"
{
action
=
"control_reduceVol"
action
=
"control_reduceVol"
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment