Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
A
aidso-data
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yaowentong
aidso-data
Commits
b3a35136
Commit
b3a35136
authored
Aug 14, 2026
by
Yaowentong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
宝洁品牌映射
电商spuname修复
parent
a58e2b76
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
538 additions
and
120 deletions
+538
-120
base_config.py
aidso_geo/config/base_config.py
+1
-1
down_load_bot.py
aidso_geo/core/down_load_bot.py
+15
-2
feishu_snipaste_v4.py
aidso_geo/core/feishu_snipaste_v4.py
+12
-11
eco_data_process.py
aidso_geo/models/eco_data_process.py
+84
-41
process.py
aidso_geo/models/process.py
+400
-56
ai_utils.py
aidso_geo/utils/ai_utils.py
+26
-9
No files found.
aidso_geo/config/base_config.py
View file @
b3a35136
...
@@ -280,7 +280,7 @@ if __name__ == '__main__':
...
@@ -280,7 +280,7 @@ if __name__ == '__main__':
# mt:snipaste_v3:only_content
# mt:snipaste_v3:only_content
init_redis_4
=
init_redis4
()
init_redis_4
=
init_redis4
()
# print(init_redis_4.delete('mt:snipaste_v3:only_content'))
# print(init_redis_4.delete('mt:snipaste_v3:only_content'))
print
(
init_redis_4
.
llen
(
'mt:snipaste_v3:only_content
'
))
print
(
init_redis_4
.
delete
(
'image_video_ocr2
'
))
# old_count, new_count = deduplicate_redis_list(
# old_count, new_count = deduplicate_redis_list(
# redis_client8,
# redis_client8,
# "geo:task_commit:list",
# "geo:task_commit:list",
...
...
aidso_geo/core/down_load_bot.py
View file @
b3a35136
...
@@ -1357,5 +1357,18 @@ def qian_report2(req_ids,plan_name):
...
@@ -1357,5 +1357,18 @@ def qian_report2(req_ids,plan_name):
# 使用示例
# 使用示例
# =========================
# =========================
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
req_list
=
[
'05e40120-018e-430d-9fb7-c921bde61920'
,
'09b179f5-8de3-4e10-a2f4-576e7e1af661'
,
'3716b2e7-41f3-45bb-beb2-1329e6c44670'
,
'585e35c9-2783-4706-87f5-469085349a3f'
,
'eccc4af3-2320-4fee-a415-2c6d26a6b5e8'
,
'0320b50f-ebfc-42d5-9050-01071b5205bd'
,
'75f9fc76-c27f-4573-8954-cea9e915b618'
,
'72e688fa-2d73-438e-81aa-1460290f6a82'
,
'cb18a066-8c88-4821-9d22-9e517332cf05'
,
'd8b3a651-abec-450f-8052-72e3d17a3503'
,
'b0ffffa2-5900-46ba-a049-ead25a895d96'
,
'1cc4a4a1-2923-47bb-b392-f4ffdde112c7'
,
'e352fd0e-7f70-4e88-9034-547c39267d61'
,
'440b52a2-beba-4c84-9cce-c09c7998d14c'
,
'91f485f3-1a3d-4ed5-a733-8197254f3f3a'
,
'c8990254-ba68-4790-bea9-ba40bf1c9774'
,
'24bf1e91-eb2f-4e4a-96fe-d1d91fda7889'
,
'90054909-aa64-444e-b935-d59044f9407d'
,
'0e5b86ba-ac03-4179-827f-696ff6fba15f'
,
'1ef447ef-aa86-44ec-b4fd-4cd20834edd9'
,
'4e09725d-228f-4bd7-9547-b484cbd9efdd'
,
'3a6e128e-7c77-4fdf-b0f4-0881fe6dfeee'
,
'd0fba64d-c2ab-438a-b5f2-47fb7eaffcd1'
,
'49288de5-9cf8-4cfe-8c7f-d81c8909ca35'
,
'e50d3df5-395b-4c26-a885-66088ba1c8a5'
,
'ed79787c-78be-41df-866d-777b29d0fe67'
,
'be59190a-452d-4e58-873b-a65dbfd87945'
,
'ad827a32-9c04-4b1f-b314-a4f3520f6cd9'
,
'91cb4eed-e8d9-4666-975b-6e079d279c72'
,
'19781ed3-fee9-4848-b936-0dc1517682f5'
,
'c6b962a9-6851-4238-83c6-4be6fc09d299'
,
'38f0eb5b-ed46-4ab9-8d57-3b6f5ebee2a3'
,
'55769d35-310f-4d81-8685-dbecd928e14a'
,
'cdc316ad-c8bb-407b-8587-e8f01deb306c'
,
'821a68df-7f6c-491d-9dc9-5b550e307aaf'
,
'dc1ee718-6e8c-4a99-8bda-aaa518523705'
,
'0ea1f698-d9fb-4085-9334-f72226566a70'
]
phone
=
'15100000026'
qian_report2
(
req_list
,
'养生酒'
)
begin
=
'2026-08-05'
\ No newline at end of file
end
=
'2026-08-05'
plan_name
=
'豆包PC/APP_快速_0805'
req_list
=
get_req_id
(
phone
,
begin
,
end
)
req_ids
=
[]
req_time_map
=
{}
for
item
in
req_list
:
if
item
.
get
(
'plan_name'
)
==
plan_name
:
req_id
=
item
.
get
(
"req_id"
)
created_at
=
item
.
get
(
"created_at"
)
req_ids
.
append
(
req_id
)
req_time_map
[
req_id
]
=
created_at
print
(
req_ids
)
\ No newline at end of file
aidso_geo/core/feishu_snipaste_v4.py
View file @
b3a35136
...
@@ -851,15 +851,16 @@ def doubao_process_original_data(file_path, original_content):
...
@@ -851,15 +851,16 @@ def doubao_process_original_data(file_path, original_content):
except
(
IndexError
,
json
.
JSONDecodeError
):
except
(
IndexError
,
json
.
JSONDecodeError
):
continue
continue
if
json_content
.
get
(
'query_list'
):
if
json_content
.
get
(
'query_list'
):
extra
=
json_content
.
get
(
'ack_client_meta'
)
.
get
(
'conversation_info'
)
.
get
(
'extra'
)
...
if
json_content
.
get
(
'ack_client_meta'
)
.
get
(
'conversation_info'
)
.
get
(
'extra'
):
# extra = json_content.get('ack_client_meta').get('conversation_info').get('extra')
extra_json
=
json
.
loads
(
extra
)
# if json_content.get('ack_client_meta').get('conversation_info').get('extra'):
inner_user_ip
=
extra_json
.
get
(
'inner_user_ip'
)
# extra_json = json.loads(extra)
inner_pc_version
=
extra_json
.
get
(
'inner_pc_version'
)
# inner_user_ip = extra_json.get('inner_user_ip')
if
inner_user_ip
:
# inner_pc_version = extra_json.get('inner_pc_version')
tos_utils
.
put_string_to_tos
(
f
"{file_path_result}/inner_user_ip.txt"
,
inner_user_ip
)
# if inner_user_ip:
if
inner_pc_version
:
# tos_utils.put_string_to_tos(f"{file_path_result}/inner_user_ip.txt", inner_user_ip)
tos_utils
.
put_string_to_tos
(
f
"{file_path_result}/inner_pc_version.txt"
,
inner_pc_version
)
# if inner_pc_version:
# tos_utils.put_string_to_tos(f"{file_path_result}/inner_pc_version.txt", inner_pc_version)
if
json_content
.
get
(
'event_type'
)
==
2001
:
if
json_content
.
get
(
'event_type'
)
==
2001
:
even_data
=
json
.
loads
(
json_content
.
get
(
'event_data'
))
even_data
=
json
.
loads
(
json_content
.
get
(
'event_data'
))
...
@@ -936,7 +937,7 @@ def doubao_process_original_data(file_path, original_content):
...
@@ -936,7 +937,7 @@ def doubao_process_original_data(file_path, original_content):
index
=
next
(
index
=
next
(
(
(
item
[
"text_card"
][
"index"
]
item
[
"text_card"
][
"index"
]
for
item
in
url_list
for
item
in
(
url_list
or
[])
if
item
.
get
(
"text_card"
,
{})
.
get
(
"title"
)
==
target_title
if
item
.
get
(
"text_card"
,
{})
.
get
(
"title"
)
==
target_title
),
),
None
None
...
@@ -3511,7 +3512,7 @@ def run_daily_pipeline_safely(
...
@@ -3511,7 +3512,7 @@ def run_daily_pipeline_safely(
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# platform = "DB"
# platform = "DB"
# try:
# try:
# run_daily_pipeline(pt="2026081
1
", platform="DB")
# run_daily_pipeline(pt="2026081
3
", platform="DB")
# except Exception:
# except Exception:
# logger.exception(
# logger.exception(
# f"[每日任务 platform={platform} count=1-99] "
# f"[每日任务 platform={platform} count=1-99] "
...
...
aidso_geo/models/eco_data_process.py
View file @
b3a35136
This diff is collapsed.
Click to expand it.
aidso_geo/models/process.py
View file @
b3a35136
This diff is collapsed.
Click to expand it.
aidso_geo/utils/ai_utils.py
View file @
b3a35136
...
@@ -4,6 +4,8 @@ import time
...
@@ -4,6 +4,8 @@ import time
import
requests
import
requests
import
json
import
json
from
loguru
import
logger
def
ai_get_brand_list
(
content
,
prompt
):
def
ai_get_brand_list
(
content
,
prompt
):
url
=
"https://ark.cn-beijing.volces.com/api/v3/chat/completions"
url
=
"https://ark.cn-beijing.volces.com/api/v3/chat/completions"
...
@@ -53,7 +55,8 @@ def ai_get_brand_list(content, prompt):
...
@@ -53,7 +55,8 @@ def ai_get_brand_list(content, prompt):
"thinking"
:
{
"thinking"
:
{
"type"
:
"disabled"
"type"
:
"disabled"
},
},
"temperature"
:
0
"temperature"
:
0
,
"top_p"
:
1
})
})
headers
=
{
headers
=
{
'Authorization'
:
'Bearer ark-7afc3be2-37a8-47fd-9f02-996258a3d305-27da0'
,
'Authorization'
:
'Bearer ark-7afc3be2-37a8-47fd-9f02-996258a3d305-27da0'
,
...
@@ -150,23 +153,31 @@ def ai_get_product_relation_spu(product_list, keyword):
...
@@ -150,23 +153,31 @@ def ai_get_product_relation_spu(product_list, keyword):
"role"
:
"system"
,
"role"
:
"system"
,
"content"
:
"""
"content"
:
"""
你的核心任务为:基于给定的商品列表与查询关键词,为列表内的每一件商品匹配对应信息,最终输出符合规范要求的JSON结果,执行过程需严格遵循以下规则:
你的核心任务为:基于给定的商品列表与查询关键词,为列表内的每一件商品匹配对应信息,最终输出符合规范要求的JSON结果,执行过程需严格遵循以下规则:
1. 需为商品列表中的每一件商品单独生成一条匹配记录,每条记录必须固定包含以下4个字段,各字段的取值规则明确如下:
1. 需为商品列表中的每一件商品单独生成一条匹配记录,每条记录必须固定包含以下5个字段,各字段的取值规则明确如下:
(1)produce_name:填写对应商品的完整原始名称,即商品列表中给出的该商品全称,不得做任何增删修改;
(1)row_id:原样返回输入商品中的row_id,禁止修改、遗漏、重新编号或与其他商品交换;
(2)brand:填写该商品对应的SPU品牌名称,需精准识别商品所属品牌,参考示例:“北京同仁堂陈皮茯苓茶”的品牌取值为“北京同仁堂”,“红魔11 Pro+”的品牌取值为“红魔”;若商品无明确可识别的品牌信息,则直接返回该商品的完整名称作为brand字段值;
(2)produce_name:填写对应商品的完整原始名称,即商品列表中给出的该商品全称,不得做任何增删修改;
(3)spu_name:填写该商品的标准SPU名称,即去除品牌前缀后的商品核心名称,参考示例:“北京同仁堂陈皮茯苓茶”的spu_name取值为“陈皮茯苓茶”,“一加 Ace 6 至尊版”的spu_name取值为“Ace 6 至尊版”;需注意同一款商品的spu_name表述必须完全统一,禁止出现同一SPU存在空格差异、格式差异的情况,例如不得同时出现“无线洗地机5”和“无线洗地机 5”这类仅空格/格式有区别的命名,需统一为规范表述;
(3)brand:填写该商品对应的SPU品牌名称,需精准识别商品所属品牌,参考示例:“北京同仁堂陈皮茯苓茶”的品牌取值为“北京同仁堂”,“红魔11 Pro+”的品牌取值为“红魔”;若商品无明确可识别的品牌信息,则直接返回该商品的完整名称作为brand字段值;
(4)current:判断该商品与给定查询关键词是否存在关联,关联判定范围包括但不限于:关键词为该商品的品牌名、关键词为该品牌旗下的子品牌/系列名称、商品属于该关键词对应的品牌产品线;只要满足上述任意一种关联情形,该字段取值为1,若不存在任何关联则取值为0。
(4)spu_name:填写该商品的标准SPU名称,即去除品牌前缀后的商品核心名称,参考示例:“北京同仁堂陈皮茯苓茶”的spu_name取值为“陈皮茯苓茶”,“一加 Ace 6 至尊版”的spu_name取值为“Ace 6 至尊版”;需注意同一款商品的spu_name表述必须完全统一,禁止出现同一SPU存在空格差异、格式差异的情况,例如不得同时出现“无线洗地机5”和“无线洗地机 5”这类仅空格/格式有区别的命名,需统一为规范表述;
(5)current:判断该商品与给定查询关键词是否存在关联,关联判定范围包括但不限于:关键词为该商品的品牌名、关键词为该品牌旗下的子品牌/系列名称、商品属于该关键词对应的品牌产品线;只要满足上述任意一种关联情形,该字段取值为1,若不存在任何关联则取值为0。
2. 一致性校验特别要求:同批次传入的商品中,若商品标题指向的品牌名相同,brand字段的取值必须保持完全统一,禁止出现同一品牌同时标注“小米”和“xiaomi”这类中英文/不同写法混用的情况,需统一为规范名称;同批次商品的spu_name也需保持表述一致,禁止出现同一SPU同时标注“12 promax”和“12promax”这类格式不统一的情况,需统一为规范表述。
2. 一致性校验特别要求:同批次传入的商品中,若商品标题指向的品牌名相同,brand字段的取值必须保持完全统一,禁止出现同一品牌同时标注“小米”和“xiaomi”这类中英文/不同写法混用的情况,需统一为规范名称;同批次商品的spu_name也需保持表述一致,禁止出现同一SPU同时标注“12 promax”和“12promax”这类格式不统一的情况,需统一为规范表述。
3。row_id关联要求:
(1)输出的product_words数量必须与输入的product_list数量完全一致;
(2)每个输入row_id必须在输出中出现且只能出现一次;
(3)不得输出输入中不存在的row_id;
(4)row_id只用于数据关联,不参与商品分析;
(5)输出顺序可以变化,但row_id与商品信息的对应关系不得变化。
{
{
"row_id": 0,
"produce_name": "郎酒 红花郎15",
"produce_name": "郎酒 红花郎15",
"brand": "郎酒",
"brand": "郎酒",
"spu_name": "
郎酒
红花郎15",
"spu_name": "红花郎15",
"current": 1
"current": 1
}
,
}
"""
"""
},
},
{
{
"role"
:
"user"
,
"role"
:
"user"
,
"content"
:
f
"""需要处理的商品列表:{product_list} 本次查询的关键词为:{keyword}"""
"content"
:
json
.
dumps
({
"product_list"
:
product_list
,
"keyword"
:
keyword
,},
ensure_ascii
=
False
,)
}
}
],
],
"thinking"
:
{
"thinking"
:
{
...
@@ -188,6 +199,10 @@ def ai_get_product_relation_spu(product_list, keyword):
...
@@ -188,6 +199,10 @@ def ai_get_product_relation_spu(product_list, keyword):
"items"
:
{
"items"
:
{
"type"
:
"object"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
"row_id"
:
{
"type"
:
"integer"
,
"description"
:
"原样返回输入商品的row_id"
,
},
"produce_name"
:
{
"produce_name"
:
{
"type"
:
"string"
,
"type"
:
"string"
,
"description"
:
"商品完整原始名称"
,
"description"
:
"商品完整原始名称"
,
...
@@ -207,6 +222,7 @@ def ai_get_product_relation_spu(product_list, keyword):
...
@@ -207,6 +222,7 @@ def ai_get_product_relation_spu(product_list, keyword):
},
},
},
},
"required"
:
[
"required"
:
[
"row_id"
,
"produce_name"
,
"produce_name"
,
"brand"
,
"brand"
,
"spu_name"
,
"spu_name"
,
...
@@ -255,6 +271,7 @@ def ai_get_product_relation_spu(product_list, keyword):
...
@@ -255,6 +271,7 @@ def ai_get_product_relation_spu(product_list, keyword):
return
product_words
if
isinstance
(
product_words
,
list
)
else
[]
return
product_words
if
isinstance
(
product_words
,
list
)
else
[]
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"AI调用失败:"
,
repr
(
e
))
return
[]
return
[]
def
ai_get_product_list_search
(
product_list
):
def
ai_get_product_list_search
(
product_list
):
...
...
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