基于振动传感器数据构建预测性维护AI模型

2023-11-19

 预测性维修(Predictive Maintenance,简称PdM)是以状态为依据(Condition Based)的维修,在机器运行时,对它的主要(或需要)部位进行定期(或连续)的状态监测和故障诊断,判定装备所处的状态,预测装备状态未来的发展趋势,依据装备的状态发展趋势和可能的故障模式,预先制定预测性维修计划。

01

振动传感器的基础知识

传感器的主要应用领域:

土木桥梁;机械机床; 汽车NVH;航天航空;海洋船舶;风能电力;国防军工;石油化工;振动台控制;材料特性;教育教学。

传感器的产品类型:

有集中式;便携式;组合式;坚固式;分布式

描述振幅的三种基本参量:位移x,速度v,加速度a

 位移微分积分速度微分积分加速度位移x:  

速度v:  加速度:  可以看出,位移、速度和加速度幅值大小的关系是:

  

微积分前后波形的变化:

1)、相位差90°

2)、幅值变化与频率有关系:位移相同时,速度与频率成正比,加速度与频率的平方成正比。

在实际工程中低阶振动更重要,由于力和加速度成正比,假设在相同力的作用下,不同频率的振动有相同的加速度A=100,则推算到振动速度V和位移X的公式如下:

  

频率f 1 10 100 1000
圆频率   6.28 62.8 628 6280
加速度   100 100 100 100
加速度   16 1.6 0.16 0.016
位移   2.5 0.025 0.00025 0.0000025

可见,在相同振动加速度下,随着频率增加,振动位移按平方关系下降。工程中,高频的震动位移都是非常微弱的,对结构几乎不形成损伤,因此无需关心

02

常见振动传感器类型

  • 加速度传感器:输出振动加速度信号;

  • 速度传感器:输出振动速度信号;

  • 位移传感器:输出振动位移信号,如电涡流传感器;

  • 力传感器:输出力信号(力垂中的压力、拉力);

  • 应变传感器:应变片,需要通过惠斯通桥路,输出应变信号;

  • 声音传感器:传声器,输出声波在空气中的振动压力信号;

  • 转速传感器:多种形式(光电、涡流、编码器等),用于输出机械转速信息;

传感器的选择方法

  • 应用对象的频率特性:

    • 位移 适合较低频率,多用于大型结构、地震

    • 加速度适合较高频率,多用于机械振动、冲击等;

    • 速度 适合中频频率,多用于结构、地震等

    • 高频

    • 低频

  • 安装方式:根据合适的安装方式,可能要选择不同的传感器

    • 若测量转轴振动,需要非接触式测量,可选择电涡流式位移传感器

    • 若测量轴承座上的振动,则可以选择普通的加速度传感器

    • 例如:机械旋转部件的振动

  • 灵敏度(标定值)

    • 传感器将物理量转为电量的比例系数,如50mV/g,100pc/N

    • 根据被测量的大小,选择合适灵敏度的传感器,既保持信噪比,又保证量程

  • 测量的频率范围

    • 传感器均有其可用的频率范围,应能包含被测对象关心的频率。传感器可用于频率范围内,其灵敏度 是基本稳定的,此范围之外则会增大或变小

  • 测量的幅值范围

    • 传感器最大和最小可测量的幅值范围,应符合被测对象的要求

03

基于加速度传感器数据构建模型

1、老样子,我们导入机器学习三大件

import numpy as np
import pandas as pd
import random
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
# from sklearn.preprocessing import StandardScaler 
# scaler = StandardScaler()

2、读入机器健康时的振动数据

header_list = ['time','x','y','z']
mHealthy = pd.read_csv('data/m1_vib1.csv',header = None, names = header_list )
mHealthy['ds'] = mHealthy['time'].apply(lambda x: float((x- 15840094829302)/1000))

3、读入机器出现问题时的数据

mBroken = pd.read_csv('data/m2_vib3.csv',header = None, names = header_list )
mBroken['ds'] = mBroken['time'].apply(lambda x: float((x- 15840094829302)/1000))

4、从上面看来数据的特征似乎有点少,现在我们需要做的就是进行数据增强,我们对数据进行求均值,有效值,偏度,峰度等相关的数据变换。

Main = pd.DataFrame(columns=['SDx','SDy','SDz','RMSx','RMSy','RMSz','Mx','My','Mz','CRx','CRy','CRz','Kx','Ky','Kz','SKx','SKy','SKz','CFx','CFy','CFz','IFx','IFy','IFz','SFx','SFy','SFz','label'])
MainT = pd.DataFrame(columns=['SDx','SDy','SDz','RMSx','RMSy','RMSz','Mx','My','Mz','CRx','CRy','CRz','Kx','Ky','Kz','SKx','SKy','SKz','CFx','CFy','CFz','IFx','IFy','IFz','SFx','SFy','SFz','label'])
num = random.randint(0,99899)
df = mBroken[num:num+100]
num = random.randint(0,99899)
df = mBroken[num:num+100
def RMScalc(df,c):
    return np.sqrt(df[c].pow(2).sum()/1000)
def Clearance(df,c):
    root = (df[c].abs().pow(0.5).sum()/1000)**2
    return root
RMScalc(df,'x')
for i in range(0,100):
    num = random.randint(0,99899)
    df = mBroken[num:num+100]
    SDx = df.std()['x']
    SDy = df.std()['y']
    SDz = df.std()['z']
    RMSx = RMScalc(df,'x')
    RMSy = RMScalc(df,'y')
    RMSz = RMScalc(df,'z')
    Mx = df['x'].mean()
    My = df['y'].mean()
    Mz = df['z'].mean()
    CRx = float(df['x'].max()/RMSx)
    CRy = float(df['y'].max()/RMSy)
    CRz = float(df['z'].max()/RMSz)
    Kx = df['x'].kurt()
    Ky = df['y'].kurt()
    Kz = df['z'].kurt()
    SKx = df['x'].skew()
    SKy = df['y'].skew()
    SKz = df['z'].skew()
    CFx = float(df['x'].max()/Clearance(df,'x'))
    CFy = float(df['y'].max()/Clearance(df,'y'))
    CFz = float(df['z'].max()/Clearance(df,'z'))
    IFx = float(df['x'].max()/Mx)
    IFy = float(df['y'].max()/My)
    IFz = float(df['z'].max()/Mz)
    SFx = float(RMSx/Mx)
    SFy = float(RMSy/My)
    SFz = float(RMSz/Mz)
    label = 0
    list = [SDx,SDy,SDz,RMSx,RMSy,RMSz,Mx,My,Mz,CRx,CRy,CRz,Kx,Ky,Kz,SKx,SKy,SKz,CFx,CFy,CFz,IFx,IFy,IFz,SFx,SFy,SFz,label]
    MainT.loc[i] = list


for i in range(101,200):
    num = random.randint(0,99899)
    df = mHealthy[num:num+100]
    SDx = df.std()['x']
    SDy = df.std()['y']
    SDz = df.std()['z']
    RMSx = RMScalc(df,'x')
    RMSy = RMScalc(df,'y')
    RMSz = RMScalc(df,'z')
    Mx = df['x'].mean()
    My = df['y'].mean()
    Mz = df['z'].mean()
    CRx = float(df['x'].max()/RMSx)
    CRy = float(df['y'].max()/RMSy)
    CRz = float(df['z'].max()/RMSz)
    Kx = df['x'].kurt()
    Ky = df['y'].kurt()
    Kz = df['z'].kurt()
    SKx = df['x'].skew()
    SKy = df['y'].skew()
    SKz = df['z'].skew()
    CFx = float(df['x'].max()/Clearance(df,'x'))
    CFy = float(df['y'].max()/Clearance(df,'y'))
    CFz = float(df['z'].max()/Clearance(df,'z'))
    IFx = float(df['x'].max()/Mx)
    IFy = float(df['y'].max()/My)
    IFz = float(df['z'].max()/Mz)
    SFx = float(RMSx/Mx)
    SFy = float(RMSy/My)
    SFz = float(RMSz/Mz)
    label = 1
    list = [SDx,SDy,SDz,RMSx,RMSy,RMSz,Mx,My,Mz,CRx,CRy,CRz,Kx,Ky,Kz,SKx,SKy,SKz,CFx,CFy,CFz,IFx,IFy,IFz,SFx,SFy,SFz,label]
    MainT.loc[i] = list

我们来看看每个特征的相关系数,用sns中的一个热力图插件来看看

fig, ax = plt.subplots(figsize=(20,20))  
ax = sns.heatmap(Mainx.corr(),annot=True,cmap='viridis')

下面我们分别尝试用ANN、SVM、RandomForest来分别进行模型构建

1、ANN Classfier

X = Mainx.drop('label',axis=1).values
y = Mainx['label'].values
XT = MainT.drop('label',axis=1)
import seaborn as sns
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation,Dropout
from tensorflow.keras.constraints import max_norm
scaler = MinMaxScaler()
Scaled = scaler.fit_transform(MainT['SDx'].values.astype(float).reshape(-1, 1))
df_normalized = pd.DataFrame(Scaled,columns = ['SDx'])
df_normalized['label'] = MainT['label']
X = Mainx.drop('label',axis=1).values
y = Mainx['label'].values
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=101)
scaler = MinMaxScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)
model = Sequential()


# https://stats.stackexchange.com/questions/181/how-to-choose-the-number-of-hidden-layers-and-nodes-in-a-feedforward-neural-netw




# input layer
model.add(Dense(4,input_dim = 4,  activation='tanh'))
model.add(Dropout(0.2))


# hidden layer
model.add(Dense(8, activation='relu'))
model.add(Dropout(0.2))


# hidden layer
model.add(Dense(8, activation='relu'))
model.add(Dropout(0.2))


# output layer
model.add(Dense(units=1,activation='tanh'))


# Compile model
model.compile(loss='binary_crossentropy', optimizer='adam',metrics = ['accuracy'])

模型训练

model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=400, verbose=2,batch_size = 50)

模型评估

model.evaluate(X_train, y_train, verbose=0)
from sklearn.metrics import classification_report,confusion_matrix
predictions = model.predict_classes(X_test)
print(classification_report(y_test,predictions))

可以看出准确率太低了,只有50%,还不如抛硬币。

下面来尝试SVM

from sklearn import svm
from sklearn.pipeline import Pipeline
clf = svm.SVC()
clf.fit(X_train,y_train)
preds = clf.predict(X_test)
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test,preds))

准确率还是只有55%,我们还是继续跑硬币吧。

最后我们再来尝试下随机森林,理论上,多管齐下,得到的结果应该会稍微好点,话不多说,我们来看看

from sklearn.feature_selection import SelectFromModel
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import LinearSVC
clf2 = Pipeline([
  ('feature_selection', SelectFromModel(LinearSVC())),
  ('classification', RandomForestClassifier())
])
clf2.fit(X_train, y_train)
print(accuracy_score(y_test,clf2.predict(X_test)))

得到的结果是0.825,相比前两种方法提高了不少,但是要能够实际应用还远远不够,还需要继续提高准确率。

那问题出在哪里呢,是不是数据的特征提取出现了什么问题,我们用遗传算法来重新进行特征选择

mBroken['dt'] = mBroken['time'].apply(lambda x: float((x- 15840094829302)/10000))
mHealthy['dt'] = mHealthy['time'].apply(lambda x: float((x-15839399805840)/10000))
Main = pd.DataFrame(columns=['SDx','SDy','SDz','RMSx','RMSy','RMSz','Mx','My','Mz','CRx','CRy','CRz','Kx','Ky','Kz','SKx','SKy','SKz','CFx','CFy','CFz','IFx','IFy','IFz','SFx','SFy','SFz','label'])
Main2 = pd.DataFrame(columns=['SDx','SDy','SDz','RMSx','RMSy','RMSz','Mx','My','Mz','CRx','CRy','CRz','Kx','Ky','Kz','SKx','SKy','SKz','CFx','CFy','CFz','IFx','IFy','IFz','SFx','SFy','SFz','label'])


#SAMPEL BROKEN coba 100
for i in range(0,100):
    num = random.randint(0,99899)
    df = mBroken[num:num+100]
    SDx = df.std()['x']
    SDy = df.std()['y']
    SDz = df.std()['z']
    RMSx = RMScalc(df,'x')
    RMSy = RMScalc(df,'y')
    RMSz = RMScalc(df,'z')
    Mx = df['x'].mean()
    My = df['y'].mean()
    Mz = df['z'].mean()
    CRx = float(df['x'].max()/RMSx)
    CRy = float(df['y'].max()/RMSy)
    CRz = float(df['z'].max()/RMSz)
    Kx = df['x'].kurt()
    Ky = df['y'].kurt()
    Kz = df['z'].kurt()
    SKx = df['x'].skew()
    SKy = df['y'].skew()
    SKz = df['z'].skew()
    CFx = float(df['x'].max()/Clearance(df,'x'))
    CFy = float(df['y'].max()/Clearance(df,'y'))
    CFz = float(df['z'].max()/Clearance(df,'z'))
    IFx = float(df['x'].max()/Mx)
    IFy = float(df['y'].max()/My)
    IFz = float(df['z'].max()/Mz)
    SFx = float(RMSx/Mx)
    SFy = float(RMSy/My)
    SFz = float(RMSz/Mz)
    label = 0
    list = [SDx,SDy,SDz,RMSx,RMSy,RMSz,Mx,My,Mz,CRx,CRy,CRz,Kx,Ky,Kz,SKx,SKy,SKz,CFx,CFy,CFz,IFx,IFy,IFz,SFx,SFy,SFz,label]
    Main.loc[i] = list
# SAMPEL HEALTHY COBA 100
for i in range(0,100):
    num = random.randint(0,99899)
    df = mHealthy[num:num+100]
    SDx = df.std()['x']
    SDy = df.std()['y']
    SDz = df.std()['z']
    RMSx = RMScalc(df,'x')
    RMSy = RMScalc(df,'y')
    RMSz = RMScalc(df,'z')
    Mx = df['x'].mean()
    My = df['y'].mean()
    Mz = df['z'].mean()
    CRx = float(df['x'].max()/RMSx)
    CRy = float(df['y'].max()/RMSy)
    CRz = float(df['z'].max()/RMSz)
    Kx = df['x'].kurt()
    Ky = df['y'].kurt()
    Kz = df['z'].kurt()
    SKx = df['x'].skew()
    SKy = df['y'].skew()
    SKz = df['z'].skew()
    CFx = float(df['x'].max()/Clearance(df,'x'))
    CFy = float(df['y'].max()/Clearance(df,'y'))
    CFz = float(df['z'].max()/Clearance(df,'z'))
    IFx = float(df['x'].max()/Mx)
    IFy = float(df['y'].max()/My)
    IFz = float(df['z'].max()/Mz)
    SFx = float(RMSx/Mx)
    SFy = float(RMSy/My)
    SFz = float(RMSz/Mz)
    label = 1
    list = [SDx,SDy,SDz,RMSx,RMSy,RMSz,Mx,My,Mz,CRx,CRy,CRz,Kx,Ky,Kz,SKx,SKy,SKz,CFx,CFy,CFz,IFx,IFy,IFz,SFx,SFy,SFz,label]
    Main2.loc[i] = list
Main = Main.append(Main2)

模型训练

def modelGA(train_data,train_labels,test_data,test_labels):
    inputSize = train_data[1].size
    modelG = Sequential()
    # input layer
    modelG.add(Dense(inputSize,input_dim = inputSize,  activation='tanh'))
    #model.add(Dropout(0.2))


    # hidden layer
    modelG.add(Dense(13, activation='relu'))
    modelG.add(Dropout(0.2))


    # hidden layer
    modelG.add(Dense(13, activation='relu'))
    modelG.add(Dropout(0.2))


    # output layer
    modelG.add(Dense(units=1,activation='tanh'))


    # Compile model
    modelG.compile(loss='binary_crossentropy', optimizer='adam',metrics = ['accuracy'])
    modelG.fit(train_data, train_labels, validation_data=(test_data, test_labels), epochs=150, verbose=2,batch_size = 50)
    acc = modelG.evaluate(test_data, test_labels, verbose=0)[1]
    return acc
    
def reduce_features(solution, features):
    selected_elements_indices = np.where(solution == 1)[0]
    reduced_features = features[:, selected_elements_indices]
    return reduced_features


def classification_accuracy(labels, predictions):
    correct = np.where(labels == predictions)[0]
    accuracy = correct.shape[0]/labels.shape[0]
    return accuracy


def cal_pop_fitness(pop, features, labels, train_indices, test_indices):
    accuracies = np.zeros(pop.shape[0])
    idx = 0


    for curr_solution in pop:
        reduced_features = reduce_features(curr_solution, features)
        train_data = reduced_features[train_indices, :]
        test_data = reduced_features[test_indices, :]


        train_labels = labels[train_indices]
        test_labels = labels[test_indices]


        #SV_classifier = sklearn.svm.SVC(gamma='scale')
        #SV_classifier.fit(X=train_data, y=train_labels)
        
        #predictions = SV_classifier.predict(test_data)
        accuracy = modelGA(train_data,train_labels,test_data,test_labels)
        #accuracies[idx] = classification_accuracy(test_labels, predictions)
        accuracies[idx] = accuracy
        idx = idx + 1
    return accuracies


def select_mating_pool(pop, fitness, num_parents):
    # Selecting the best individuals in the current generation as parents for producing the offspring of the next generation.
    parents = np.empty((num_parents, pop.shape[1]))
    for parent_num in range(num_parents):
        max_fitness_idx = np.where(fitness == np.max(fitness))
        max_fitness_idx = max_fitness_idx[0][0]
        parents[parent_num, :] = pop[max_fitness_idx, :]
        fitness[max_fitness_idx] = -99999999999
    return parents




def crossover(parents, offspring_size):
    offspring = np.empty(offspring_size)
    # The point at which crossover takes place between two parents. Usually, it is at the center.
    crossover_point = np.uint8(offspring_size[1]/2)


    for k in range(offspring_size[0]):
        # Index of the first parent to mate.
        parent1_idx = k%parents.shape[0]
        # Index of the second parent to mate.
        parent2_idx = (k+1)%parents.shape[0]
        # The new offspring will have its first half of its genes taken from the first parent.
        offspring[k, 0:crossover_point] = parents[parent1_idx, 0:crossover_point]
        # The new offspring will have its second half of its genes taken from the second parent.
        offspring[k, crossover_point:] = parents[parent2_idx, crossover_point:]
    return offspring




def mutation(offspring_crossover, num_mutations=2):
    mutation_idx = np.random.randint(low=0, high=offspring_crossover.shape[1], size=num_mutations)
    # Mutation changes a single gene in each offspring randomly.
    for idx in range(offspring_crossover.shape[0]):
        # The random value to be added to the gene.
        offspring_crossover[idx, mutation_idx] = 1 - offspring_crossover[idx, mutation_idx]
    return offspring_crossover


data_inputs = X
data_outputs = y
num_samples = data_inputs.shape[0]
num_feature_elements = data_inputs.shape[1]
print("num samples: ",num_samples)
print("num_feature_elements: ", num_feature_elements)




train_indices = np.arange(1, num_samples, 4)
test_indices = np.arange(0, num_samples, 4)
print("Number of training samples: ", train_indices.shape[0])
print("Number of test samples: ", test_indices.shape[0])


"""
Genetic algorithm parameters:
    Population size
    Mating pool size
    Number of mutations
"""
sol_per_pop = 5 # Population size.
num_parents_mating = 3 # Number of parents inside the mating pool.
num_mutations = 2 # Number of elements to mutate.


# Defining the population shape.
pop_shape = (sol_per_pop, num_feature_elements)


# Creating the initial population.
new_population = np.random.randint(low=0, high=2, size=pop_shape)
print("shape = ",new_population.shape[1])




best_outputs = []
num_generations = 20
for generation in range(num_generations):
    print("Generation : ", generation)
    # Measuring the fitness of each chromosome in the population.
    fitness = cal_pop_fitness(new_population, data_inputs, data_outputs, train_indices, test_indices)


    best_outputs.append(np.max(fitness))
    # The best result in the current iteration.
    print("Best result : ", best_outputs[-1])


    # Selecting the best parents in the population for mating.
    parents = select_mating_pool(new_population, fitness, num_parents_mating)


    # Generating next generation using crossover.
    offspring_crossover = crossover(parents, offspring_size=(pop_shape[0]-parents.shape[0], num_feature_elements))


    # Adding some variations to the offspring using mutation.
    offspring_mutation = mutation(offspring_crossover, num_mutations=num_mutations)


    # Creating the new population based on the parents and offspring.
    new_population[0:parents.shape[0], :] = parents
    new_population[parents.shape[0]:, :] = offspring_mutation


# Getting the best solution after iterating finishing all generations.
# At first, the fitness is calculated for each solution in the final generation.
fitness = cal_pop_fitness(new_population, data_inputs, data_outputs, train_indices, test_indices)
# Then return the index of that solution corresponding to the best fitness.
best_match_idx = np.where(fitness == np.max(fitness))[0]
best_match_idx = best_match_idx[0]


best_solution = new_population[best_match_idx, :]
best_solution_indices = np.where(best_solution == 1)[0]
best_solution_num_elements = best_solution_indices.shape[0]
best_solution_fitness = fitness[best_match_idx]

数据切分

XZ = X[:,best_solution_indices]
XZ_train, XZ_test, yz_train, yz_test = train_test_split(XZ, y, test_size=0.20, random_state=101)

构建模型

modelZ = Sequential()


# https://stats.stackexchange.com/questions/181/how-to-choose-the-number-of-hidden-layers-and-nodes-in-a-feedforward-neural-netw


# input layer
modelZ.add(Dense(best_solution_num_elements,input_dim = best_solution_num_elements,  activation='tanh'))
#model.add(Dropout(0.2))


# hidden layer
modelZ.add(Dense(13, activation='relu'))
modelZ.add(Dropout(0.2))


# hidden layer
modelZ.add(Dense(13, activation='relu'))
modelZ.add(Dropout(0.2))


# output layer
modelZ.add(Dense(units=1,activation='tanh'))


# Compile model
modelZ.compile(loss='binary_crossentropy', optimizer='adam',metrics = ['accuracy'])

模型训练

modelZ.fit(XZ_train, yz_train, validation_data=(XZ_test, yz_test), epochs=200, verbose=2,batch_size = 50)

预测结果

predictionsZ = modelZ.predict_classes(XZ_test)
print(classification_report(yz_test,predictionsZ))

从结果看来似乎达到100%的准确率,实际应用效果还有待验证,我们现在这个模型只能预测出机器出现了问题,并不能预测出是什么问题。

听说关注公众号的都是大牛

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

基于振动传感器数据构建预测性维护AI模型 的相关文章

  • 在 Java 中如何将类作为参数传递?

    有什么方法可以将类作为 Java 中的参数传递并从该类中触发一些方法吗 void main callClass that class void callClass classObject classObject somefunction o
  • 如何在 GWT 的 Jetty 中启用 HTTPS?

    如何在 GWT 附带的 Jetty 中启用 HTTPS gwt dev jar 中 隐藏 了一个 README SSL txt 你可以找到最新版本在 Github 上 https github com gwtproject gwt blob
  • SetTimeout() 不会执行该函数

    这是我的代码片段 in VBScript Sub Main Dim timeoutTimer more scripts here more scripts here more scripts here timeoutTimer window
  • 并排启动两个资源管理器窗口

    有没有办法使用批处理脚本并排 垂直平铺 启动两个资源管理器窗口 如果没有 我该如何使用 VBS 来做到这一点 我已经修改了上面的VBS脚本Hackoo完全按照OP的要求去做 脚本中的注释准确地解释了它将做什么 如果两个窗口未设置到正确位置
  • 从输入跳到 CellTable 中的输入

    我有一个 CellTable 其中包含一堆渲染到的单元格
  • 如何在 GWT 中取消转义字符串

    我使用了 SafeHtmlUtils htmlEscape text 并且我想使用相反的功能 你能告诉我 gwt 中是否有像 unescapeHtml 这样的函数 如果 并且仅当 您可以相信文本不包含恶意内容 您可以使用 import co
  • 带有编辑器框架的 GWT 验证器

    有没有人意识到编辑器和 jsr 303 验证如何与 GWT 2 3 一起工作 未来 验证 API 已添加到 gwt sdk 但我无法使用编辑器框架验证实体 无论 我确实从来没有从客户端或服务器端抛出错误 这是一个代码片段 public cl
  • TextField“更改”事件仅在模糊时触发

    通常 Change 事件将在 TextField 失去焦点 模糊 后触发 但我需要它在字段值发生变化时立即触发 而不需要失去对该字段的关注 KeyListener 不会删除它 因为该值可能来自条形码扫描仪等 有什么办法可以做到这一点吗 提前
  • 经典的 asp/vbscript - 使用正则表达式修改所有 href

    在经典 ASP VB 脚本 中 我需要通过对当前 url 进行编码并在其前面挂起来修改字符串中包含的多个不同的 href 基本上 我想让所有的 href 都通过我的redirect asp 并将现有的 href 编码传递到新链接中 例如 现
  • 如何清除gwt中的缓存?

    我怎样才能清除缓存gwt 或者有什么方法可以阻止浏览器保留缓存gwt 当您部署 GWT 应用程序时 避免代理和浏览器缓存 GWT 生成的 nocache js 文件非常重要 一种解决方案是实现一个 Servlet 过滤器 添加控制缓存行为的
  • 如何启动 VBS 的交互式控制台?

    与这个问题非常相似 如何启动 Perl 的交互式控制台 https stackoverflow com questions 73667 how can i start an interactive console for perl 我只是希
  • GWT 和 Web 服务 (wsdl)

    谁能告诉我一种从 GWT 客户端访问 WSDL Web 服务的方法 这可能吗 Thanks 智能网关 http www smartclient com product index jsp支持 WSDL 数据源 除此之外 您始终可以将 WSD
  • 使用 qtp 功能单击特定链接

    我想通过创建一个在操作中调用的函数来自动执行 Flipkart 的登录过程 Function Website this is the function Systemutil Run iexplore exe http www flipkar
  • 从命令行使用 VBScript 从 Excel 外部运行 Excel 宏

    我正在尝试从 Excel 文件外部运行 Excel 宏 我目前正在使用从命令行运行的 vbs 文件 但它一直告诉我找不到宏 这是我尝试使用的脚本 Set objExcel CreateObject Excel Application Set
  • GWT:将自定义小部件添加到单元格丢失自定义小部件的事件

    我们的要求是使用以下命令制作一个可编辑的网格CellTable在其单元格中包含自定义小部件 自定义小部件具有文本框和与文本框关联的搜索按钮 要将自定义小部件添加为单元格 请创建以下子类AbstractEditableCell类 由 GWT
  • 想要在 GWT 单元列表中实现“标记为已读”功能

    我想实施这个单元格列表的例子 http gwt googleusercontent com samples Showcase Showcase html CwCellList经过一处修改 我想在有人点击后将每一行设置为灰色 它应该保留在那里
  • 等待程序完成

    为了监视带宽使用情况并且不要在启动时加载不必要的程序 我想先执行dumeter exe 然后执行firefox exe 当我关闭firefox时 它应该杀死dumeter 我使用以下代码启动 Set WshShell WScript Cre
  • VBscript 以提升的权限运行 bat 文件

    这是我的bat文件 REG DELETE HKLM Software Microsoft Windows CurrentVersion WindowsUpdate v SusClientId f REG DELETE HKLM Softwa
  • 从多个 UiBinder 引用单个 ClientBundle 类会产生任何费用吗?

    我有一个 ClientBundle 其中包含整个应用程序所需的 css 资源 默认背景颜色 常见布局模式等 一位表示设计目标 http code google com webtoolkit doc latest DevGuideClient
  • 我对一些小概念感到困惑

    我对 VBscript 非常陌生 正在努力学习所有概念 在我的实践过程中 我一直有一个疑问 dim a b c set a CreateObject scripting filesystemobject initiate the file

随机推荐

  • MySQL数据库被攻击,被删库勒索,逼迫我使出洪荒之力进行恢复数据

    昨天连夜赶了一篇文章 讲述了一个被黑客连续攻击服务器三次的普通 搬砖人 一次比一次艰难 一次比一次狠 我给大家看几张图 看看黑客的 佳作 首先创建一个数据库 README FHX 然后创建表 README 插入一条数据 内容如下 内容 以下
  • 学生信息后台管理系统(GUI)

    一 目的 通过制作学生信息后台管理系统熟悉java中JDBC和CUI 图形用户接口 的使用 二 实验工具 1 Eclipse IDE Version 2020 12 4 18 0 2 mysql 3 Navicat Premium 15 数
  • string常见接口的使用(基于c++标准库中的STL)

    前言 string是c 中常见的容器 它是用来管理字符的 它在物理上是可以动态增长的线性表 对于了解它的使用 以及常见的接口使用对于我们日常开发和使用是很有必要的 所以接下来让我们一起来了解一下string常见的接口吧 目录 1 strin
  • 线程池用例

    线程池逻辑类 public class TaskExecutorService private final ExecutorService pool private final ThreadPoolExecutor pool private
  • HTML 5 标签、属性、事件及浏览器兼容性速查表

    HTML 5 可以说是近十年来 Web 标准最巨大的飞跃 和以前的版本不同 HTML 5 并非仅仅用来表示 Web 内容 它的使命是将 Web 带入一个成熟的应用平台 在这个平台上 视频 音频 图象 动画 以及同电脑的交互都被标准化 尽管
  • 相比引流,期货公司更应该借助私域提升留存和转化

    近期 我们和很多期货公司都有过交流和沟通 相较于如何提升产品留存和转化 大家似乎更关注如何引流 我理解大家对流量获取的焦虑 但回归运营的底层逻辑 产品的留存和转化其实更为重要 现如今很多期货公司已陆续借助企业微信搭建私域流量池 虽然了解了市
  • VFloss pytorch

    Loss functions import torch import torch nn as nn from utils general import bbox iou from utils torch utils import is pa
  • Unity3D之Rigidbody

    目录 常用的Rigidbody属性和方法 rigidbody AddForce rigidbody AddTorque rigidbody velocity rigidbody angularVelocity rigidbody Sleep
  • 国家语言对照表

    国家 地区 语言代码 国家 地区 语言代码 简体中文 中国 zh cn 繁体中文 台湾地区 zh tw 繁体中文 香港 zh hk 英语 香港 en hk 英语 美国 en us 英语 英国 en gb 英语 全球 en ww 英语 加拿大
  • Spring源码从入门到精通---@Scope&@Lazy(三)

    上篇文章主要介绍了 ComponentScan的注解 Spring源码从入门到精通 ComponentScan 二 这篇文章主要介绍单例模式 多例模式 懒加载 先上目录结构 这篇文章先创建了beanConfig2文件 1 多例模式 单例模式
  • Compile Options--编译选项

    目的 其主要作用是用于调试跟踪和测试 主要包含 MT TASK MT ZDO FUNC and other MT compile options LCD SUPPORTED LCD SUPPORTED DEBUG BLINK LEDS 且看
  • 【产量预测】BP和GRNN神经网络预测粮食产量【含Matlab源码 1247期】

    一 BP神经网络简介 1 BP神经网络概述 BP Back Propagation 神经网络是1986年由Rumelhart和McCelland为首的科研小组提出 参见他们发表在Nature上的论文 Learning representat
  • 第二章 常用安全工具

    目录 1 Kali系统工具分类 2 Kali Top10工具 1 Kali系统工具分类 信息收集 Information Gathering 主要目的是收集渗透测试目标的基本信息 包括操作系统信息 网络配置信息 应用服务信息等 脆弱性分析
  • Python:读取CSV文件的某几列

    三种读取方式如下 import csv import pandas as pd with open 2 csv r as csvfile reader csv reader csvfile column1 row 1 for row in
  • 【Docker应用篇】GitLab代码私服

    Docker应用篇 GitLab代码私服 什么是GitLab 概述 基于 Docker 安装 GitLab 访问 GitLab 的账户管理 创建用户 设置账户信息 修改用户密码 退出并使用新账户登录 GitLab GitHub 使用 SSH
  • 单例模式的八种写法比较

    单例模式是最常用到的设计模式之一 熟悉设计模式的朋友对单例模式都不会陌生 一般介绍单例模式的书籍都会提到 饿汉式 和 懒汉式 这两种实现方式 但是除了这两种方式 本文还会介绍其他几种实现单例的方式 让我们来一起看看吧 简介 单例模式是一种常
  • Java开发工具

    文章目录 一 Sublime Text 二 IDEA 一 Sublime Text 官网 Sublime Text 说明 文本编辑器 适合初学者练习手写代码 特点 支持多行编辑 二 IDEA
  • Windows powershell添加自定义快捷指令(Linux下对比)

    Windows Powershell 1 创建并修改Windows Powershell 启动执行文件 echo PROFILE 编辑C Users hongyang jia Documents PowerShell Microsoft P
  • QT编程----事件

    QT程序设计进阶 事件 Qt事件 Qt程序是事件驱动的 程序的每个动作都是由幕后某个事件所触发 Qt事件的类型很多 常见的qt的事件如下 键盘事件 按键按下和松开 鼠标事件 鼠标移动 鼠标按键的按下和松开 拖放事件 用鼠标进行拖放 滚轮事件
  • 基于振动传感器数据构建预测性维护AI模型

    预测性维修 Predictive Maintenance 简称PdM 是以状态为依据 Condition Based 的维修 在机器运行时 对它的主要 或需要 部位进行定期 或连续 的状态监测和故障诊断 判定装备所处的状态 预测装备状态未来