With the widespread application of software across various domains, software vulnerabilities have shown a continuous upward trend, so that deep learning-based methods for vulnerability detection have gained wide application. However, the existing graph representation learning methods often neglect the influence of edges in the graph on vulnerability detection, and have the representation of edge weights too coarse. To address this issue, a software vulnerability detection method based on edge weight — EWVD (Edge Weight for Vulnerability Detection) was proposed. Firstly, comments, custom variable names, and function names in the source code were cleaned and represented abstractly. Secondly, Sent2Vec was selected to perform embedding representation after comparative analysis. Thirdly, edge weights were calculated comprehensively using three metrics: connection structure, the importance of neighboring nodes, and Jaccard similarity, so as to identify the information transmission capability between nodes. Finally, by leveraging edge weights, perception capability of the model was enhanced for potential relationships between vulnerable statements, thereby determining the importance of edges in the graph. Compared with the best-performing baseline method VulCNN among seven vulnerability detection baseline methods, EWVD achieves an increase of 1.06 percentage points in Accuracy and a decrease of 1.11 percentage points in False Positive Rate (FPR). It can be seen that EWVD refines the representation of edge weights and improves the overall performance of vulnerability detection.