In an attempt to deflect congressional opposition to President Carter's China policy, Sens. Edward M. Kennedy (D-Mass.) and Alan Cranston (D-Calif.) said yesterday they will sponsor a resolution reaffirming U.S. concern for the security of Taiwan.

The proposed resolution by the two influential Senate liberals states that the United States would consider an armed attack against Taiwan "a danger to the stability and peace of Asia."

If adopted by Congress, the resolution would require the president to inform Congress promptly of any threats to Taiwan, but it does not require Congress or the president to take any precise action in response to such information.

In addition, the resolution affirms that the United States will continue to supply Taiwan with defensive weapons after the termination of the mutual defense treaty between the two countries. This was intended to underscore public pledges already made by the Carter administration on that point.

At a press conference yesterday, Kennedy said the resolution is intended as reassurance to Taiwan and its supporters that the United States has a continued strong commitment to that island country's "future peace, prosperity and welfare."

Although both Kennedy and Cranston said their resolution should be "judged on its own merits," it clearly is meant as a counter to efforts by congressional conservatives to block Carter's decision to recognize Peking as the government of China and sever official relations with Taiwan.

Opponents of the president's policy are planning a number of legislative moves to thwart cancellation of the Taiwan defense pact or to impose restrictions on the policy that would be unacceptable to Peking.

In contrast, the Kennedy-Cranston resolution is designed to give members of Congress a chance to demonstrate their concern about Taiwan's future independence without at the same time voting for legislation that might undo the administration's agreement with Peking on future relations.

The two senators acknowledged that they had consulted the administration before drawing up the resolution. But they denied that they were offering it on behalf of the president, and said they had not asked for the administration's blessing or support.

They said the resolution is being circulated among other senators in an effort to obtain the necessary support for passage, but added that they did not yet have any gauge of its potential support. In addition, they said, Rep. Lester L. Wolff (D-N.Y.), chairman of the House subcommittee on Asian affairs, has agreed to sponsor the resolution in the House.

While insisting that the United States must show it can "normalize relations with China at the same time that we act with responsibility on Taiwan," the two senators also backed the administration's insistence that future U.S. relations with Taiwan must be on an unofficial, nongovernmental basis.