Peking — In its weekend shelling of the Vietnam border, China may be trying to weaken Hanoi's recent offensive against rebels in Kampuchea. The heavy fighting was apparently an attempt by Peking to divert Vietnamese troops who have been attacking Chinese-backed guerrilla strongholds on the frontier between Thailand and Vietnamese-occupied Kampuchea.
Thailand has had close relations with China in the past four years, and diplomats say that China has agreed to react on its border with Vietnam if Thailand felt threatened by Vietnamese troops.
Chinese shelling on the border destroyed Vietnamese fortifications and was still going on Sunday, the New China News Agency said. It gave no indication of casualties, but the fighting seems to be the fiercest in two years.
China has drawn special attention to the current fighting by highlighting its own counterattacks rather than reporting mainly Vietnamese ''provocations.'' The official media reported how peasants on the border were ''overjoyed at and hailed the counterattack,'' and had earlier told border guards about the ''crimes committed by the Vietnamese troops and urged them to fire back in defense.''
Despite the emotional language being used, there is little sign that the population is being prepared for a second border war following a bloody but inconclusive war the two communist neighbors fought in 1979. Press reports have been relatively brief - usually a good indication that the leadership does not regard the affair as a make-or-break one.
The fact that the official Chinese and Vietnamese media, which are unashamedly organs of propaganda, are virtually the sole source of information about the fighting makes it hard to fathom just what is the reason for the clashes. But the current tone of the Chinese media at least does not suggest that a full-scale war is imminent.
Border clashes have taken place often since 1979, but have been mainly small-scale, involving only one or two injuries. The most recent fighting has occurred in at least two separate areas. According to the Chinese media, ''Vietnamese aggressors'' launched over 50 attacks in March alone, killing or wounding ''several'' border guards and civilians.
The party newspaper said: ''The Vietnamese authorities must not be allowed to go on playing such odious and cunning tricks.'' But it left the door open by noting that China and Vietnam had enjoyed a ''traditional, profound friendship.'' One of the main border posts, where the two countries hold occasional prisoner exchanges, is still called ''Friendship Pass,'' in remembrance of happier times when China provided Vietnam with substantial amounts of aid during the war with the United States. But Soviet ties to Hanoi in recent years have kept Peking from renewing the old comaraderie.