游戏服务器之内存数据库redis客户端应用

本文主要介绍游戏服务器的对redis的应用。介绍下redis c++客户端的一些使用。


存储结构设计:

(1)装备道具的redis存储结构为例(Hashes存储类型

存储结构为:    key : EQUIPMENTBAG角色id  frield: 装备位置 value:装备信息

存储一个装备道具到redis(使用hset 命令)

一次存储玩家的装备背包里的所有道具(使用命令hmset)

一次获取一个玩家的装备包裹的所有道具(一次获取键的所有field和value(使用命令hgetall))

(2)角色基础属性的redis存储结构为例(字符串存储类型)

存储结构:key:BASE角色id ,value: 角色基础信息 

获取一个角色基础属性 (使用命令 get)

存储一个角色基础属性(使用命令set)

(3)过期时间

设置过期时间 30天.访问时需要判断key 是否还存在。


本文目录:

1、redis命令介绍

(1)基本命令

(2)应用介绍

2、redis存储结构之应用解析

3、写入redis的应用

(1)存储一个装备道具到redis(使用hset 命令)

存储结构 key : EQUIPMENTBAG角色id  frield: 装备位置 value:装备信息

key : EQUIPMENTBAGplayerId  frield: pos value:CBagItem

(2)一次存储玩家的装备背包里的所有道具(使用命令hmset)

(3)存储一个角色的基础信息(使用命令set)

存储结构:key BASE角色id ,value 角色基础信息 

4、读取redis的应用

(1)一次获取一个玩家的装备包裹的所有道具(一次获取键的所有field和value(使用命令hgetall))

(2)读取角色的基础信息(使用命令get)

存储结构:key BASE角色id,value 角色基础信息

5、redis客户端池

6、第三方的库接口

(1)redis客户端对象

(2)接口函数

(3)定义的异常


本文内容:

1、redis命令介绍

介绍一下redis客户端的接口对应使用到的redis的原生命令。

(1)基本命令

命令类型有:

(1)String
常用命令:
set,get,decr,incr,mget 等。
(2)Hash
常用命令:
hget,hset,hgetall 等。
(3)List
常用命令:
lpush,rpush,lpop,rpop,lrange等。
(4)Set
常用命令:
sadd,spop,smembers,sunion 等。
(5)Sorted set
常用命令:
zadd,zrange,zrem,zcard等

参考:http://blog.csdn.net/chenjiayi_yun/article/details/18887757

(2)应用介绍

常用命令:
hget,hset,hgetall、hmset  、mset 等。
应用场景:
我们简单举个实例来描述下Hash的应用场景,比如我们要存储一个用户信息对象数据,包含以下信息:
           用户ID,为查找的key,
           存储的value用户对象包含姓名name,年龄age,生日birthday 等信息,
   如果用普通的key/value结构来存储,主要有以下2种存储方式:
(1)   第一种方式将用户ID作为查找key,把其他信息封装成一个对象以序列化的方式存储,需要一次次地发送和返回。
           如:set u001 "李三,18,20010101"
           这种方式的缺点是,增加了序列化/反序列化的开销,并且在需要修改其中一项信息时,需要把整个对象取回,并且修改操作需要对并发进行保护,引入CAS等复杂问题。
(2)   第二种方法是这个用户信息对象有多少成员就存成多少个key-value对儿,用用户ID+对应属性的名称作为唯一标识来取得对应属性的值,不需要一次次地设置,可以一次设置多个,但命令信息有些冗余。
           如:mset user:001:name "李三 "user:001:age18user:001:birthday "20010101"
           虽然省去了序列化开销和并发问题,但是用户ID为重复存储,如果存在大量这样的数据,内存浪费还是非常可观的。
(3)第三个,那么Redis提供的Hash很好的解决了这个问题,Redis的Hash实际是内部存储的Value为一个HashMap,并提供了直接存取这个Map成员的接口,
           如:hmset user:001 name "李三" age 18 birthday "20010101"      
   也就是说,Key仍然是用户ID, value是一个Map,这个Map的key是成员的属性名,value是属性值,这样对数据的修改和存取都可以直接通过其内部Map的Key(Redis里称内部Map的key为field), 也就是通过 key(用户ID) + field(属性标签) 就可以操作对应属性数据了,既不需要重复存储数据,也不会带来序列化和并发修改控制的问题。很好的解决了问题。
这里同时需要注意,Redis提供了接口(hgetall)可以直接取到全部的属性数据,但是如果内部Map的成员很多,那么涉及到遍历整个内部Map的操作,由于Redis单线程模型的缘故,这个遍历操作可能会比较耗时,而另其它客户端的请求完全不响应,这点需要格外注意。

参考:http://www.cnblogs.com/stephen-liu74/archive/2012/04/16/2370212.html

2、redis存储结构之应用解析

如果是一个键对应一个值并且多个field和多个value的值,如整个背包的道具(键是角色id),可使用hash存储结构。

如果内容是一个键对应一个value,如角色属性,可考虑使用string存储结构。

hash存储结构(应用于装备背包道具)

HSET key field value                                                       O(1)               为指定的Key设定Field/Value对,如果Key不存在,该命令将创建新Key以参数中的Field/Value对,如果参数中的Field在该Key中已经存在,则用新值覆盖其原有值。 1表示新的Field被设置了新值,0表示Field已经存在,用新值覆盖原有值。 
HGET key field O(1) 返回指定Key中指定Field的关联值。返回参数中Field的关联值,如果参数中的Key或Field不存,返回nil。
HEXISTSkey field O(1) 判断指定Key中的指定Field是否存在。1表示存在,0表示参数中的Field或Key不存在。
HLEN key O(1)获取该Key所包含的Field的数量。返回Key包含的Field数量,如果Key不存在,返回0。

HGETALLkey                                 O(N)       时间复杂度中的N表示Key包含的Field数量。获取该键包含的所有Field/Value。其返回格式为一个Field、一个Value,并以此类推。Field/Value的列表。
HMSET key field value [field value ...]                                 O(N)                    时间复杂度中的N表示被设置的Field数量。逐对依次设置参数中给出的Field/Value对。如果其中某个Field已经存在,则用新值覆盖原有值。如果Key不存在,则创建新Key,同时设定参数中的Field/Value。  

参考:http://www.cnblogs.com/stephen-liu74/archive/2012/02/15/2352932.html

string存储结构(应用于角色属性)

GET key           O(1)         获取指定Key的Value。如果与该Key关联的Value不是string类型,Redis将返回错误信息,因为GET命令只能用于获取string Value。 与该Key相关的Value,如果该Key不存在,返回nil。
SET key value O(1) 
设定该Key持有指定的字符串Value,如果该Key已经存在,则覆盖其原有值。总是返回"OK"。
参考: http://www.cnblogs.com/stephen-liu74/archive/2012/02/13/2349815.html


3、写入redis的客户端应用

装备道具结构:

[cpp]  view plain  copy
  1. struct CBagItem  
  2. {  
  3. int m_nID;  //物品ID  
  4. int m_nCount; //物品个数 默认一  
  5. //物品的可变属性  
  6. int m_nUsedHole;  //能用孔的个数  
  7. int m_GremId[MAXGREMNUM];  //孔里面放置的宝石id 目前武器最多有5个孔  
  8. int m_nDeadTime;  //使用的结束时间  
  9. bool m_IsDead;    //是否到期  
  10. bool m_IsBand;//是否帮定  
  11. int m_augmentLevel; //强化等级  
  12. int m_score; //装备评分  
  13. public:  
  14. strengthen m_nStreng;//装备属性  
  15. int m_nCurNum;//当前已有进度  
  16. int m_nUpNum; //下一等级升级所需数量  
  17. };  


(1)存储一个装备道具到redis(使用hset 命令)

[cpp]  view plain  copy
  1. void CRWRedisClientOperator::add_equip_to_redis(CGamePlayer* player,int pos,CBagItem* bagItem)  
  2. {  
  3. if(NULL == player||NULL == bagItem))  
  4. {  
  5. return;  
  6. }  
  7. int playerId = player->get_player_base()->m_player_id;  
  8. //实际是以玩家id和装备关键字来作为key。例如  :  EQUIPMENTBAG%d  
  9. char tmpBuf[256];  
  10. memset(tmpBuf,0,sizeof(tmpBuf));  
  11. sprintf(tmpBuf,"EQUIPMENTBAG%d",playerId);  
  12. string key(tmpBuf);  
  13.   
  14. memset(tmpBuf,0,sizeof(tmpBuf));  
  15. sprintf(tmpBuf,"%d",pos);  
  16. string frield(tmpBuf);  
  17. memset(tmpBuf,0,sizeof(tmpBuf));  
  18. //这里可以直接用道具bagItem的地址是因为CBagItem类型里面的成员都是原子类型的,如果有容器(stl或其他的容器),则需要自己提供一个序列化的函数。  
  19. memcpy(tmpBuf,(void*)bagItem,sizeof(CBagItem));  
  20. string value;  
  21. value.assign(tmpBuf,sizeof(CBagItem));//这里是把一个道具的内存存到一个字符串类型(string)的内存里,最大的长度是256字节,不可以超过这个长度。  
  22.   
  23. CRWRedisClient redisClient;  
  24. redis::client* tmpRedisClient = redisClient.get_redis_client();//这里是redis客户端的一个实例池,做了个简单的封装  
  25. if(NULL == tmpRedisClient)  
  26. {  
  27. return;  
  28. }  
  29. try  
  30. {  
  31. tmpRedisClient->hset(key,frield,value);//key : EQUIPMENTBAGplayerId  frield: pos value:CBagItem  
  32. //设置过期时间 30天,需要设置redis内存数据的期限,鉴于内存受限  
  33. tmpRedisClient->expire(key,3600*24*30);  
  34. }  
  35. catch (redis::redis_error & e)  
  36. {  
  37. cerr << "got exception: " << e.what() << endl << "FAIL" << endl;  
  38. return;  
  39. }  
  40. }  


(2)一次存储一个玩家的装备背包里的所有道具(使用命令hmset)

存储结构:

key : EQUIPMENTBAGplayerId  frield: pos value:CBagItem

[cpp]  view plain  copy
  1. void CRWRedisClientOperator::player_equipbag_insert_db_redis(CGamePlayer* player)  
  2. {  
  3.     if(NULL == player)  
  4.     {  
  5.         return;  
  6.     }  
  7.     CPlayerBag* bag = player->get_player_bag();  
  8.     if(NULL == bag)  
  9.     {  
  10.         return;  
  11.     }  
  12.     //玩家装备道具的map存储到strPairVec,然后调用接口void hmset( const string_type & key, const string_pair_vector & field_value_pairs )发送到redis 服务器  
  13.     map<int,CBagItem*>* tmpMap = bag->get_equip_map();  
  14.     map<int,CBagItem*>::iterator iter = tmpMap->begin();  
  15.       
  16.     //以hash格式插入redis的元素  
  17.     vector<pair<string,string> > strPairVec;  
  18.     for(;iter != tmpMap->end();iter++)  
  19.     {  
  20.         CBagItem* equipItem = iter->second;  
  21.         if(NULL == equipItem)  
  22.         {  
  23.             return;  
  24.         }  
  25.         //设置frield值,道具id  
  26.         char frieldBuf[64];  
  27.         memset(frieldBuf, 0, sizeof(frieldBuf));  
  28.         sprintf(frieldBuf,"%d",iter->first);  
  29.         string frield(frieldBuf);  
  30.           
  31.         //设置value,道具二进制信息  
  32.         char valueBuf[256];  
  33.         memset(valueBuf, 0, sizeof(valueBuf));  
  34.         memcpy(valueBuf,equipItem,sizeof(CBagItem));  
  35.         string value;  
  36.         value.assign(valueBuf,sizeof(CBagItem));  
  37.         strPairVec.push_back(pair<string,string>(frield,value));  
  38.     }  
  39.     //通过playerId得到key值 EQUIPMENTBAGplayerId  
  40.     int playerId = player->get_player_base()->m_player_id;  
  41.     if(0 == playerId)  
  42.     {  
  43.         return;  
  44.     }  
  45.     char tmpBuf[64];  
  46.     memset(tmpBuf,0,64);  
  47.     sprintf(tmpBuf,"EQUIPMENTBAG%d",playerId);  
  48.     string key(tmpBuf);  
  49.       
  50.     CRWRedisClient redisClient;  
  51.     redis::client* tmpRedisClient = redisClient.get_redis_client();  
  52.     if(NULL == tmpRedisClient)  
  53.     {  
  54.         return ;  
  55.     }  
  56.     try  
  57.     {  
  58.         //使用命令hmset 设置 key : EQUIPMENTBAGplayerId  frield: pos value:CBagItem  
  59.         tmpRedisClient->hmset(key,strPairVec);  
  60.         //设置过期时间 30天  
  61.         tmpRedisClient->expire(key,60*60*24*30);  
  62.     }  
  63.     catch (redis::redis_error & e)  
  64.     {  
  65.         cerr << "got exception: " << e.what() << endl << "FAIL" << endl;  
  66.         return ;  
  67.     }  
  68. }  

(3)存储一个角色的基础信息(使用命令set)

存储结构:

key:BASE角色id ,value 角色基础信息 

[cpp]  view plain  copy
  1. int playerId = player->get_player_base()->m_player_id;  
  2. char tmpBuf[64];  
  3. memset(tmpBuf,0,64);  
  4. sprintf(tmpBuf,"BASE%d",playerId);  
  5. string key(tmpBuf);  
  6. CRWRedisClient redisClient;  
  7. redis::client* tmpRedisClient = redisClient.get_redis_client();  
  8. if(NULL == tmpRedisClient)  
  9. {  
  10.     return ;  
  11. }  
  12. try  
  13. {  
  14.     tmpRedisClient->set(key, value);  
  15. }  
  16. catch (redis::redis_error & e)  
  17. {  
  18.     cerr << "got exception: " << e.what() << endl << "FAIL" << endl;  
  19.     return ;  
  20. }  

4、读取redis的客户端应用

(1)一次获取一个玩家的装备包裹的所有道具(使用命令hgetall)

存储结构:

key : EQUIPMENTBAGplayerId  frield: pos value:CBagItem


[cpp]  view plain  copy
  1. bool CRWRedisClientOperator::load_player_equipbag_from_redis(CGamePlayer* player)  
  2. {  
  3.     if(NULL == player)  
  4.     {  
  5.         return false;  
  6.     }  
  7.     //通过playerId得到key值  
  8.     int playerId = player->get_player_base()->m_player_id;  
  9.     if(0 == playerId)  
  10.     {  
  11.         return false;  
  12.     }  
  13.       
  14.     char tmpBuf[64];  
  15.     memset(tmpBuf,0,64);  
  16.     //根据键(EQUIPMENTBAG%d",playerId),获取该玩家 所有装备道具的数据到vector<pair<string,string> > strPairVec  
  17.     //使用到接口void hgetall( const string_type & key, string_pair_vector & out )  
  18.     sprintf(tmpBuf,"EQUIPMENTBAG%d",playerId);  
  19.     string key(tmpBuf);  
  20.     if(false == CRWRedisClientOperator::instance()->is_key_exist_in_redis(key))  
  21.     {  
  22.         return false;  
  23.     }  
  24.     vector<pair<string,string> > strPairVec;  
  25.     //通过key值从redis取数据  
  26.     CRWRedisClient redisClient;  
  27.     redis::client* tmpRedisClient = redisClient.get_redis_client();  
  28.     if(NULL == tmpRedisClient)  
  29.     {  
  30.         return false;  
  31.     }  
  32.     try  
  33.     {  
  34.         tmpRedisClient->hgetall(key,strPairVec);//获取一个玩家的所有装备背包道具  
  35.     }  
  36.     catch (redis::redis_error & e)  
  37.     {  
  38.         cerr << "got exception: " << e.what() << endl << "FAIL" << endl;  
  39.         return false;  
  40.     }  
  41.     //得到背包  
  42.     CPlayerBag* tmpBag = player->get_player_bag();  
  43.     if(NULL == tmpBag)  
  44.     {  
  45.         return false;  
  46.     }  
  47.     vector<pair<string,string> >::iterator iter = strPairVec.begin();  
  48.     for(;iter != strPairVec.end();iter++)  
  49.     {  
  50.         string frield = iter->first;  
  51.         int pos = ACE_OS::atoi(frield.c_str());  
  52.         string value = iter->second;  
  53.         if(value.length() != sizeof(CBagItem))  
  54.         {  
  55.         return false;  
  56.         }  
  57.         CBagItem* equipItem = new CBagItem();  
  58.         if(NULL == equipItem)  
  59.         {  
  60.         return false;  
  61.         }  
  62.         memcpy(equipItem,value.c_str(),value.length());  
  63.         if(!tmpBag->insert_bagitem_equip(pos,equipItem))  
  64.         {  
  65.             return false;  
  66.         }  
  67.     }  
  68.     return true;  
  69. }  

(2)读取角色的基础信息(使用命令get)

存储结构:

key BASE角色id,value 角色基础信息

[cpp]  view plain  copy
  1. char tmpBuf[64];  
  2. memset(tmpBuf,0,64);  
  3. sprintf(tmpBuf,"BASE%d",player->get_player_base()->m_player_id);  
  4. string key(tmpBuf);  
  5.   
  6. struct CPlayerBase playerMsg;  
  7. memset(&playerMsg, 0, sizeof(CPlayerBase));  
  8. string getValue;  
  9. CRWRedisClient redisClient;  
  10. redis::client* tmpRedisClient = redisClient.get_redis_client();  
  11.   
  12. if(NULL == tmpRedisClient)  
  13. {  
  14.     return false;  
  15. }  
  16. try  
  17. {  
  18.     if (false == tmpRedisClient->exists(key))  
  19.     {  
  20.         cout <<key <<" not exists !!!" << endl;  
  21.         return false;  
  22.     }  
  23.     getValue = tmpRedisClient->get(key);  
  24. }  
  25. catch (redis::redis_error & e)//对于会抛出异常的接口,需要捕捉异常  
  26. {  
  27.     cerr << "got exception: " << e.what() << endl << "FAIL" << endl;  
  28.     return false;  
  29. }  
  30.       
  31. if(getValue.length() > sizeof(CPlayerBase))//如果比需要的长度要大,则是不合法的  
  32. {  
  33.     return false;  
  34. }  
  35. memcpy(&playerMsg, getValue.c_str(), getValue.length());//直接在redis,copy到player中  
  36. //开始拷贝数据到角色指针的数据里  
  37. player->get_player_base()->m_player_id = playerMsg.m_player_id;  
  38. ......  

5、redis客户端池

客户端池的初始化

[cpp]  view plain  copy
  1. bool CRedisClientPool::init_redis_client_pool()  
  2. {  
  3.     CRedisServer tmpRedisServer = CConfigManager::instance()->get_srv_config().get_redis_server_conf();  
  4.     string redisIp = tmpRedisServer.get_ip();  
  5.     int port = tmpRedisServer.get_port();  
  6.     for(int i = 0; i < 5; i++)  
  7.     {  
  8.         if(false == init_redis_client(redisIp,port))  
  9.         {  
  10.             return false;  
  11.         }  
  12.     }  
  13.     return true;  
  14. }  



客户端连接初始化
[cpp]  view plain  copy
  1. bool CRedisClientPool::init_redis_client(string redisIp, int port)  
  2. {  
  3.     try  
  4.     {  
  5.         redis::client* m_redis_client = new redis::client(redisIp,port,"");  
  6.         if(NULL != m_redis_client)  
  7.         {  
  8.             push_redis_client(m_redis_client);//压到redis客户端池列表  
  9.         }  
  10.     }  
  11.     catch (redis::redis_error & e)  
  12.     {  
  13.         cerr << "got exception: " << e.what() << endl << "FAIL" << endl;  
  14.         return false;  
  15.     }  
  16.     return true;  
  17. }  


添加客户端连接到客户端池
[cpp]  view plain  copy
  1. void CRedisClientPool::push_redis_client(redis::client* redisClient)  
  2. {  
  3.     if(NULL == redisClient)  
  4.     {  
  5.         return ;  
  6.     }  
  7.     m_q_mutex.acquire();  
  8.     m_redis_client_list.push_back(redisClient);  
  9.     m_q_mutex.release();  
  10. }  



6、第三方的库接口

(1)redis客户端对象

[cpp]  view plain  copy
  1. typedef base_client<default_hasher> client;  
  2. struct default_hasher  
  3.   {  
  4.     inline size_t operator()(const std::string & key, const std::vector<connection_data> & connections)  
  5.     {  
  6.       return boost::hash<std::string>()(key) % connections.size();//每次操作是根据键哈希获取连接列表里的一个,这样每个键可以尽量使用不同的连接(可能是为了某些多线程场景的减少锁竞争)  
  7.     }  
  8.   };  
  9.   
  10. template<typename CONSISTENT_HASHER>  
  11.   class base_client  
  12.   {  
  13.   private:  
  14.     void init(connection_data & con)  
  15.     {  
  16.       char err[ANET_ERR_LEN];  
  17.       con.socket = anetTcpConnect(err, const_cast<char*>(con.host.c_str()), con.port);//使用anet库做网络通信客户端接口  
  18.       if (con.socket == ANET_ERR)  
  19.       {  
  20.         std::ostringstream os;  
  21.         os << err << " (redis://" << con.host << ':' << con.port << ")";  
  22.         throw connection_error( os.str() );  
  23.       }  
  24.       anetTcpNoDelay(NULL, con.socket);  
  25.       select(con.dbindex, con);  
  26.     }  
  27.   
  28.   
  29.   public:  
  30.    ...  
  31.    explicit base_client(const string_type & host = "localhost",  
  32.                     uint16_t port = 6379,const string_type &pwd ="",int_type dbindex = 0)  
  33.     {  
  34.       connection_data con;  
  35.       con.host = host;  
  36.       con.port = port;  
  37.       con.dbindex = dbindex;  
  38.       con.pwd = pwd;  
  39.       init(con);  
  40.       connections_.push_back(con);//初始化连接后放到连接列表里  
  41.     }  


(2)接口函数

获取redis的哈希表的值

[cpp]  view plain  copy
  1. void hgetall( const string_type & key, string_pair_vector & out )  
  2.     {  
  3.       int socket = get_socket(key);  
  4.       send_(socket, makecmd("HGETALL") << key);//命令  
  5.       string_vector s;  
  6.       recv_multi_bulk_reply_(socket, s);//获取多个返回的回应消息作为HGETALL 的结果  
  7.       for(size_t i = 0; i < s.size(); i+=2)  
  8.         out.push_back( make_pair(s[i], s[i+1]) );  
  9.     }  


插入到redis的哈希表用到的

[cpp]  view plain  copy
  1. void hmset( const string_type & key, const string_pair_vector & field_value_pairs )  
  2.     {  
  3.       int socket = get_socket(key);  
  4.       makecmd m("HMSET");//命令  
  5.       m << key;  
  6.       for(size_t i=0; i < field_value_pairs.size(); i++)  
  7.         m << field_value_pairs[i].first << field_value_pairs[i].second;//把一个vector的键值发送过去设置  
  8.       send_(socket, m);  
  9.       recv_ok_reply_(socket);//接收应答结果  
  10.     }  

get命令

[cpp]  view plain  copy
  1. string_type get(const string_type & key)  
  2.     {  
  3.       int socket = get_socket(key);  
  4.       send_(socket, makecmd("GET") << key);  
  5.       return recv_bulk_reply_(socket);  
  6.     }  


读取网络数据

[cpp]  view plain  copy
  1. std::string recv_bulk_reply_(int socket)  
  2.     {  
  3.       int_type length = recv_bulk_reply_(socket, REDIS_PREFIX_SINGLE_BULK_REPLY );  
  4.   
  5.       if (length == -1)  
  6.         return missing_value();  
  7.   
  8.       int_type real_length = length + 2;    // CRLF  
  9.   
  10.       std::string data = read_n(socket, real_length);  
  11.   
  12. #ifndef NDEBUG  
  13.       //output_proto_debug(data.substr(0, data.length()-2));  
  14. #endif  
  15.   
  16.       if (data.empty())  
  17.         throw protocol_error("invalid bulk reply data; empty");  
  18.   
  19.       if (data.length() != static_cast<std::string::size_type>(real_length))  
  20.         throw protocol_error("invalid bulk reply data; data of unexpected length");  
  21.   
  22.       data.erase(data.size() - 2);  
  23.   
  24.       return data;  
  25.     }  



(3)定义的异常

定义的redis异常的基础类

[cpp]  view plain  copy
  1. class redis_error : public std::exception  
  2.   {  
  3.   public:  
  4.     redis_error(const std::string & err) : err_(err) {}  
  5.     virtual ~redis_error() throw () {}  
  6.     operator const std::string () const { return err_; }  
  7.     virtual const char* what() const throw ()  
  8.     {  
  9.       return err_.c_str();  
  10.     }  
  11.   
  12.   
  13.   private:  
  14.     std::string err_;  
  15.   };  


转载。 https://blog.csdn.net/jiayichendddd/article/details/18887647

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值