Vietnam is moving thousands of troops up to meet an invading Chinese army in what analysts here consider to be the beginning of a crucial phase in the five-day-old border war.

Chinese troops backed by tanks and artillery continued to move gradually deeper into Vietnam, with Hanoi officials reporting battles going on near Cao Bang, about 18 miles from the Chinese border. Chinese aircraft appeared to continue bombing and strafing runs ahead of the slowly advancing troops, although there were no reports yet of major air skirmishes with Vietnamese jets.

Analysts said today they are uncertain whether the massive reinforcements for Vietnam's badly battered border militia are Vietnamese Army regulars or just more militia. Their numbers suggest an upsurge in fighting that could make it difficult for China to withdraw soon, as it has indicated it would do.

A correspondent for the Japanese newspaper Asahi Shimbun reported one main Vietnamese road leading to the border jammed with vehicles carrying troops, weapons, ammunition and fuel. He said both sides seemed to be preparing for a major battle in the northeast area around Lang Son city, 12 miles inside Vietnam and controlling a major rail line to Hanoi.

Vietnamese trucks pulling 105-mm artillery guns moved north toward the border as refugees poured south. Antiaircraft batteries were set up in Lang Son by a remnant of militia and security men in the city and 130-mm artillery south of the town fired toward China. Antiaircraft units were set up on the roofs of buildings in the capital of Hanoi, about 90 miles away, but foreign correspondents said the atmosphere there was calm.

Hanoi Radio reported 2,000 Chinese troops killed or wounded yesterday, bringing the four-day total of casualities Hanoi says its troops have inflicted to 7,000. Canadian and French correspondents in Peking said Chinese officials reported 10,000 Vietnamese casualties, and 2,000 to 3,000 Chinese dead or wounded, in the first two days of the war.

Western analysts here, while acknowledging heavy fighting in some areas particularly in the last two days, consider such figures inflated.

"This whole war is being conducted for political and not military purposes," one analyst said. "So it's important for the Chinese to convince everybody they are punishing the Vietnamese, and the Vietnamese want to prove they are punishing the Chinese."

One analyst said the movement of thousands of fresh Vietnamese troops to the front gives the Chinese a choice of declaring a victory and leaving now, or staying to inflict more casualties. "But the longer they stay the less likely is the chance they can leave claiming they have won." he said.

Foreigners with unusual access to Chinese officials in Peking were told today that the Chinese troops might have to stay longer than they wished in order to fight the Vietnamese reinforcements so that their eventual withdrawal would not look like a retreat.

Every day the Chinese remain in Vietnam puts more pressure on the Soviet Union to prove its own commitment to Hanoi with some form of action, such as a raid on China's northern border. American policymakers feel such action could severely complicate U.S. relations with both China and the Soviet Union.

Chinese officials have told some resident foreigners in Peking that they are preparing the Chinese people "for the worst" anyway. There have been reports of evacuations of Chinese civilians from Soviet border areas, in contrast to reports of Chinese civilians in the Vietnamese border area continuing to farm and even moving back to villages they had abandoned earlier.

Foreigners in Peking said they had been told that Chinese people were being warned they might be entering a "difficult period" and that they should not expect "victories everywhere." The foreigners were told there were plans for their evacuation in a real emergency and Peking University students had been put on alert in case they were needed to help the war effort.

Chinese here close to the Peking government continued to say the invasion would be limited in scope and time. But in somewhat tougher language, some pro-Peking sources said China was looking for some withdrawal of Vietnamese troops from Cambodia before it withdrew from Vietnam.

While acknowledging great difficulty in compiling accurate information on the border fighting, analysts here estimated that 60,000 Chinese troops were involved in the first assaults over the border, with another 40,000 coming in recently as reinforcements and 100,000 more waiting just behind the border.

The analysts said the Chinese invasion commander, said to be Politburo member Gen. Hsu Shih-Yu, had additional forces available in the Kwangsi and Yunnan regions. "I think they have over-insured, so that if the Vietnamese moved up a great body of regular troops they could quickly send in more reinforcements," one analyst said.

Analysts are uncertain how many Vietnamese militia and border guards were on hand to take the brunt of the first Chinese assault, but there are about 50,000 regular Vietnamese Army troops in the Hanoi-Haiphong area. Some analysts think these have now begun to move to the border.

About 160,000 Vietnamese troops remain in the south, either along the border of, or inside, Cambodia fighting pro-Peking insurgents who have resisted the Vietnamese invasion of that country.

Analysts said the Vietnamese appear to be short on transport aircraft and thus have enormous logistical problems moving significant numbers of the southern troops up to the Chinese border. Also, analysts in Bangkok say the pro-Peking Khmer Rouge insurgents are putting heavy pressure near Siem Reap, Sisophon, Pursat and the city of Battambang.

The Chinese invasion of Vietnam appears to have been triggered in part by Vietnam's success in toppling a pro-Peking government in Cambodia early in January. Peking is thought to hope the invasion will draw Vietnamese troops out of Cambodia and help the morale of the Khmer Rouge.

Two Vietnamese divisions, or 20,000 troops, also remain in Laos, whose government is under strong Hanoi influence. Some military sources here said they had received reports that the Chinese were attempting to arm Meo tribesmen, a mountain-dwelling group that had previously fought the Communists in Laos with U.S. support. The Chinese action would create difficulties for the Vietnamese in Laos.

The Japanese Defense Agency said today a Soviet cruiser accompanied by a missile destroyer headed into the East China Sea, perhaps to join nine other Soviet ships cruising off the Vietnamese coast.Some reports from Bangkok military sources said three divisions, or 30,000, Chinese troops were massing for an assault long the Gulf of Tonkin coast into Vietnam.

[Senior Japanese military officers said that troops in Mongolia, a close Soviet ally bordering the northern Chinese province of Inner Mongolia, are being mobilized, Reuter reported Thursday. The officers added they did not know whether the forces were Soviet or Mongolian troops. Earlier in the week an unconfirmed report from Moscow said the Soviet army was placed on a national alert.]

Chinese troops were reported to have captured the provincial town of Lao Cai, controlling a vital rail line in the northwest. In the northeast, the Vietnamese reported heavy fighting through last night near Dong Dang. A Vietnamese commander said the Chinese in the area appeared to be regrouping for fresh assaults.

At Lang Son city, also in the northeast, Vietnamese officials were quoted as saying only 12,000 to 13,000 people remained in a city whose usual population is 46,000.