Files
autoAiWorkSys/_doc/简历存储和分析功能说明.md
张成 5d7444cd65 1
2025-11-24 13:23:42 +08:00

170 lines
5.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 简历存储和分析功能说明
## 📋 功能概述
本功能实现了从在线平台Boss直聘获取用户简历数据并自动存储到数据库同时使用AI进行智能分析的完整流程。
## 🔗 数据关联
- **`pla_account`** 表:存储平台账户信息(设备与平台的绑定关系)
- **`resume_info`** 表:存储简历详细信息
- **关联关系**`resume_info.account_id` = `pla_account.id`自增ID
- **查询逻辑**:通过 `sn_code` + `platform` 查询 `pla_account` 获取 `account_id`
## 🔧 核心功能
### 1. 简历数据获取与存储
**位置**: `api/middleware/job/jobManager.js`
**主要方法**:
- `get_online_resume(sn_code, mqttClient, params)` - 获取在线简历
- `saveResumeToDatabase(sn_code, platform, resumeData)` - 保存简历到数据库
**数据流程**:
```
MQTT请求 → 获取简历数据 → 解析数据 → 存储到resume_info表 → AI分析 → 更新AI分析字段
```
### 2. 数据映射关系
#### 从Boss直聘响应到数据库字段的映射
| Boss直聘字段 | 数据库字段 | 说明 |
|-------------|-----------|------|
| `baseInfo.name` | `fullName` | 姓名 |
| `baseInfo.gender` | `gender` | 性别1=男0=女) |
| `baseInfo.age` | `age` | 年龄 |
| `baseInfo.account` | `phone` | 电话 |
| `baseInfo.emailBlur` | `email` | 邮箱 |
| `expectList[0].locationName` | `location` | 所在地 |
| `educationExpList[0].degreeName` | `education` | 学历 |
| `educationExpList[0].major` | `major` | 专业 |
| `educationExpList[0].school` | `school` | 毕业院校 |
| `educationExpList[0].endYear` | `graduationYear` | 毕业年份 |
| `baseInfo.workYearDesc` | `workYears` | 工作年限 |
| `workExpList[0].positionName` | `currentPosition` | 当前职位 |
| `workExpList[0].companyName` | `currentCompany` | 当前公司 |
| `expectList[0].positionName` | `expectedPosition` | 期望职位 |
| `expectList[0].salaryDesc` | `expectedSalary` | 期望薪资 |
| `expectList[0].locationName` | `expectedLocation` | 期望地点 |
| `expectList[0].industryDesc` | `expectedIndustry` | 期望行业 |
| `userDesc` | `skillDescription` | 技能描述 |
| `projectExpList` | `projectExperience` | 项目经验JSON |
| `workExpList` | `workExperience` | 工作经历JSON |
### 3. AI智能分析
**分析维度**:
1. **技能标签提取** - 从简历描述中自动提取技术栈
2. **优势分析** - 分析候选人的核心优势
3. **劣势分析** - 指出需要改进的方面
4. **职业建议** - 提供职业发展建议
5. **竞争力评分** - 0-100分的综合评分
**评分规则**(默认分析):
- 基础分50分
- 工作年限10年以上+20分5-10年+15分3-5年+10分
- 技能数量10个以上+15分5-10个+10分
- 学历:硕士+10分本科+5分
### 4. 技能标签自动提取
系统会自动从简历描述中提取以下技能标签:
**前端技术**:
- Vue, React, Angular, JavaScript, TypeScript
- Webpack, Vite, Redux, MobX
- jQuery, Bootstrap, Element UI, Ant Design
**后端技术**:
- Node.js, Python, Java, C#, .NET
- Express, Koa, Django, Flask
**数据库**:
- MySQL, MongoDB, Redis
**其他技术**:
- WebRTC, FFmpeg, Canvas, WebSocket
- Git, Docker, Kubernetes, AWS, Azure
- Selenium, Jest, Mocha, Cypress
## 📊 数据库表结构
**表名**: `resume_info`
**主要字段**:
```sql
- id: IDUUID
- sn_code: SN码
- platform: boss/liepin
- fullName:
- gender:
- age:
- phone:
- email:
- education:
- workYears:
- expectedPosition:
- expectedSalary:
- skills: JSON
- projectExperience: JSON
- workExperience: JSON
- aiSkillTags: AI提取的技能标签JSON
- aiStrengths: AI分析的优势
- aiWeaknesses: AI分析的劣势
- aiCareerSuggestion: AI职业建议
- aiCompetitiveness: AI竞争力评分
- originalData: JSON
- isActive:
- syncTime:
```
## 🚀 使用示例
### 调用方式
```javascript
const jobManager = require('./api/middleware/job/jobManager');
// 获取在线简历(自动存储和分析)
const resumeData = await jobManager.get_online_resume(
'GHJU', // 设备SN码
mqttClient, // MQTT客户端实例
{ platform: 'boss' } // 参数(可选)
);
```
### 响应数据示例
参考文件: `_doc/在线简历响应文本.json`
## 🔍 日志输出
系统会输出以下日志信息:
```
[工作管理] 开始获取设备 GHJU 的在线简历
[工作管理] 成功获取简历数据: {...}
[工作管理] 简历已创建 - ID: xxx-xxx-xxx
[工作管理] 开始AI分析简历 - ID: xxx-xxx-xxx
[工作管理] AI分析完成 - 竞争力评分: 85
[工作管理] 简历数据已保存到数据库
```
## ⚠️ 注意事项
1. **数据安全**: 原始简历数据会完整保存在 `originalData` 字段中
2. **去重机制**: 同一设备同一平台只保留一份活跃简历
3. **容错处理**: 如果AI分析失败会使用基于规则的默认分析
4. **异步处理**: 简历保存失败不会影响数据返回
## 📝 后续优化建议
1. 增加更多平台支持(猎聘、拉勾等)
2. 优化AI提示词提高分析准确度
3. 添加简历版本管理功能
4. 实现简历对比功能
5. 增加简历导出功能PDF、Word等