| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -78,18 +78,18 @@ def get_random_index(_mode='history', _index_type='history'): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        random_high, random_middle, random_low = get_index_from_db(_index_type) | 
					 | 
					 | 
					 | 
					        random_high, random_middle, random_low = get_index_from_db(_index_type) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    else: | 
					 | 
					 | 
					 | 
					    else: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        random_high, random_middle, random_low = get_random_index_group() | 
					 | 
					 | 
					 | 
					        random_high, random_middle, random_low = get_random_index_group() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print('分布区间(高概率区,中概率区,低概率区):', random_high, random_middle, random_low) | 
					 | 
					 | 
					 | 
					    # print('分布区间(高概率区,中概率区,低概率区):', random_high, random_middle, random_low) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    red_index_group = [int(random_high), int(random_middle), int(random_low)] | 
					 | 
					 | 
					 | 
					    red_index_group = [int(random_high), int(random_middle), int(random_low)] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    high_red_index_list = [(n[0] - 1) for n in new_num(1, 11, random_high)[0:random_high]] | 
					 | 
					 | 
					 | 
					    high_red_index_list = [(n[0] - 1) for n in new_num(1, 11, random_high)[0:random_high]] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    middle_red_index_list = [(n[0] - 1) for n in new_num(12, 22, random_middle)[0:random_middle]] | 
					 | 
					 | 
					 | 
					    middle_red_index_list = [(n[0] - 1) for n in new_num(12, 22, random_middle)[0:random_middle]] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    low_red_index_list = [(n[0] - 1) for n in new_num(23, 33, random_low)[0:random_low]] | 
					 | 
					 | 
					 | 
					    low_red_index_list = [(n[0] - 1) for n in new_num(23, 33, random_low)[0:random_low]] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(high_red_index_list) | 
					 | 
					 | 
					 | 
					    # print(high_red_index_list) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(middle_red_index_list) | 
					 | 
					 | 
					 | 
					    # print(middle_red_index_list) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(low_red_index_list) | 
					 | 
					 | 
					 | 
					    # print(low_red_index_list) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    red_index_list = sorted(high_red_index_list + middle_red_index_list + low_red_index_list) | 
					 | 
					 | 
					 | 
					    red_index_list = sorted(high_red_index_list + middle_red_index_list + low_red_index_list) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    red_index_list = [int(n) for n in red_index_list] | 
					 | 
					 | 
					 | 
					    red_index_list = [int(n) for n in red_index_list] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(f"排序后索引") | 
					 | 
					 | 
					 | 
					    # print(f"排序后索引") | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(red_index_list) | 
					 | 
					 | 
					 | 
					    # print(red_index_list) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return red_index_group, red_index_list | 
					 | 
					 | 
					 | 
					    return red_index_group, red_index_list | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -100,8 +100,7 @@ def get_forecast_red(_red_data, _index_type): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for i in index_list: | 
					 | 
					 | 
					 | 
					    for i in index_list: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        forecast_red_list.append(_red_data_list[i][0]) | 
					 | 
					 | 
					 | 
					        forecast_red_list.append(_red_data_list[i][0]) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    forecast_red_list = sorted(forecast_red_list) | 
					 | 
					 | 
					 | 
					    forecast_red_list = sorted(forecast_red_list) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print('随机红球推荐:') | 
					 | 
					 | 
					 | 
					    print('随机红球推荐:', forecast_red_list) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(forecast_red_list) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return {'forecast': forecast_red_list, 'group': index_group, 'index': index_list} | 
					 | 
					 | 
					 | 
					    return {'forecast': forecast_red_list, 'group': index_group, 'index': index_list} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -138,6 +137,27 @@ def red_forecast(): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    insert_red_data(all_data, history_red_delta, forecast_red_history_data, last_red_delta, forecast_red_last_data) | 
					 | 
					 | 
					 | 
					    insert_red_data(all_data, history_red_delta, forecast_red_history_data, last_red_delta, forecast_red_last_data) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					def red_forecast_with_same(_num): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    all_data = get_all_data() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    last_red = json.loads(db_history_get_last_data()['red']) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    history_red_delta = get_all_red_delta(all_data) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    # print(all_red_delta) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    last_red_delta = get_last_red_delta(get_all_red_in_last(all_data)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    # print(last_red_delta) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    print_data([history_red_delta, last_red_delta]) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    history_switch = True | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    while history_switch: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        forecast_red_history_data = get_forecast_red(history_red_delta, 'history') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if len(list(set(forecast_red_history_data['forecast']) & set(last_red))) == _num: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            history_switch = False | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    last_switch = True | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    while last_switch: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        forecast_red_last_data = get_forecast_red(last_red_delta, 'last') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if len(list(set(forecast_red_last_data['forecast']) & set(last_red))) == _num: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            last_switch = False | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    insert_red_data(all_data, history_red_delta, forecast_red_history_data, last_red_delta, forecast_red_last_data) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if __name__ == "__main__": | 
					 | 
					 | 
					 | 
					if __name__ == "__main__": | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # all_data = get_all_data() | 
					 | 
					 | 
					 | 
					    # all_data = get_all_data() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # history_red_delta = get_all_red_delta(all_data) | 
					 | 
					 | 
					 | 
					    # history_red_delta = get_all_red_delta(all_data) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -148,5 +168,5 @@ if __name__ == "__main__": | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # forecast_red_history_data = get_forecast_red(history_red_delta, 'history') | 
					 | 
					 | 
					 | 
					    # forecast_red_history_data = get_forecast_red(history_red_delta, 'history') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # forecast_red_last_data = get_forecast_red(last_red_delta, 'last') | 
					 | 
					 | 
					 | 
					    # forecast_red_last_data = get_forecast_red(last_red_delta, 'last') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # insert_red_data(all_data, history_red_delta, forecast_red_history_data, last_red_delta, forecast_red_last_data) | 
					 | 
					 | 
					 | 
					    # insert_red_data(all_data, history_red_delta, forecast_red_history_data, last_red_delta, forecast_red_last_data) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    red_forecast_with_same(2) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    pass | 
					 | 
					 | 
					 | 
					    pass | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |