Method, device and electronic device for constructing securities relationship map
By constructing a multi-dimensional securities relationship map, using the factor data and vectorized processing of securities, the problems of insufficient richness and connectivity of the existing securities relationship map are solved, and better investment decision-making and risk prevention are achieved.
Patent Information
- Application Number
- CN202211045889.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-08-30
AI Technical Summary
The richness and connectivity of the existing securities relationship map are not ideal and cannot effectively assist investors in investment decision-making and risk prevention.
By obtaining factor data under multiple specified categories of securities, a securities vector is constructed, and the designated relationship data is determined based on the securities vector, thereby building a multi-dimensional securities relationship map and using a community mining algorithm to divide securities clusters.
It improves the richness and connectivity of the securities relationship map, dynamically reflects the relationship between securities, and provides better reference for investment decision-making and risk prevention.
Smart Images

Figure CN115357729B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph technology, and in particular to a method, device and electronic device for constructing a securities relationship graph. Background Art
[0002] At present, by constructing a securities relationship map, we can assist in analyzing how prices of securities are affected, the risk transmission process, and the setting of constraints on investment portfolios.
[0003] However, in related technologies, the securities relationship map constructed based on the industry to which the securities belong cannot represent the correlation between stocks in different industries. The securities relationship map constructed by connecting securities mentioned at the same time in news or public opinion involves too few securities. The securities relationship map constructed based on the upstream and downstream supply chain relationships of the companies where the securities are located can only represent the correlation between securities of companies in the same supply chain, etc.
[0004] It can be seen that the richness and connectivity of the securities relationship graph constructed by relevant technologies are not ideal, resulting in the constructed securities relationship graph not being conducive to providing reference for investors' investment decisions and risk prevention. Therefore, how to improve the richness and connectivity of the securities relationship graph and thus better construct the securities relationship graph is an urgent problem to be solved. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a method, device, and electronic device for constructing a securities relationship map, thereby improving the richness and connectivity of the securities relationship map, thereby better constructing the securities relationship map. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for constructing a securities relationship map, the method comprising:
[0007] Obtaining securities data for each of the multiple securities for which a securities relationship map is to be constructed; wherein the securities data includes financial statements of the issuer of the securities, technical indicator data of the securities, and / or intraday trading data of the securities;
[0008] For each of the securities, factor data under a plurality of designated categories of the security is determined from the security data of the security, and a security vector under each designated category of the security is determined based on the factor data under each designated category of the security; wherein each designated category is a category used to describe the security, and the factor data under each designated category is the description data of the security under the designated category;
[0009] For each designated category, based on the security vectors of the respective securities in the designated category, determining designated relationship data between the respective securities in the designated category; wherein the designated relationship data is data used to characterize the association relationship;
[0010] With each security as a graph vertex, based on the specified relationship data between each security under each specified category, a securities relationship graph is constructed with each specified category as a graph dimension.
[0011] Optionally, the factor data includes at least one factor value;
[0012] The step of determining the security vector for each designated category of the security based on the factor data for each designated category of the security comprises:
[0013] For each designated category, each factor value contained in the factor data of the security in the designated category is used as a vector dimension to generate a security vector for the security in the designated category.
[0014] Optionally, for each designated category, determining designated relationship data between securities in the designated category based on the security vectors of the securities in the designated category includes:
[0015] For each designated category, the vector similarity of the securities vectors of every two securities in the designated category is calculated to obtain designated relationship data between every two securities in the designated category.
[0016] Optionally, the method of constructing a securities relationship graph with each designated category as a graph dimension based on designated relationship data between each security under each designated category and each security as a graph vertex includes:
[0017] For each designated category, based on the vector similarity of the security vectors of each two securities in the designated category, the associated securities corresponding to each security in the designated category are determined; wherein the associated securities corresponding to each security are: securities whose vector similarity with the security is greater than a predetermined threshold, or a specified number of securities corresponding to the security, sorted by vector similarity.
[0018] Using each security as a graph vertex and the connecting line corresponding to each specified category as the graph edge of the specified category, a securities relationship graph is generated with each specified category as a graph dimension.
[0019] The connection line corresponding to each designated category is a connection line between the graph vertex of each security under the designated category and the graph vertex of the corresponding associated security.
[0020] Optionally, the method for determining the designated quantity corresponding to each security includes:
[0021] For each specified category, calculate the M information entropies of the securities relationship graph of the specified category as a graph dimension when the number of related securities corresponding to each security in the specified category is 1 to M respectively; where M is the total number of securities;
[0022] Select the minimum point with the smallest value from the obtained information entropy as the target information entropy;
[0023] The number of associated securities corresponding to the target information entropy is determined as the designated number corresponding to each security in the designated category.
[0024] Optionally, for the plurality of securities for which the securities relationship map is to be constructed, obtaining securities data of each of the securities includes:
[0025] Whenever a predetermined construction cycle is entered, the securities data of each of the multiple securities for which the securities relationship map is to be constructed is obtained within the current construction cycle; wherein the duration of the construction cycle is determined based on the duration of the update cycle of the securities data.
[0026] Optionally, the method further includes:
[0027] By using a community mining algorithm and the designated relationship data of each security under each graph dimension in the securities relationship graph, each security is divided into different clusters from different graph dimensions.
[0028] In a second aspect, an embodiment of the present invention provides a device for constructing a securities relationship map, the device comprising:
[0029] an acquisition module, configured to acquire, for each of the plurality of securities for which a securities relationship map is to be constructed, securities data; wherein the securities data includes financial statements of the issuer of the securities, technical indicator data of the securities, and intraday trading data of the securities;
[0030] a vector determination module configured to determine, for each of the securities, factor data under a plurality of designated categories of the security from the security data of the security, and determine, based on the factor data under each designated category of the security, a security vector under each designated category of the security; wherein each designated category is a category used to describe the security, and the factor data under each designated category is the description data of the security under the designated category;
[0031] a relationship determination module configured to determine, for each designated category, designated relationship data between the securities in the designated category based on the security vectors of the securities in the designated category; wherein the designated relationship data is data used to represent the association relationship;
[0032] The construction module is used to use each security as a graph vertex and, based on the specified relationship data between each security under each specified category, to construct a securities relationship graph with each specified category as a graph dimension.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0034] Memory for storing computer programs;
[0035] The processor is configured to implement the steps of the method for constructing the above-mentioned securities relationship map when executing the program stored in the memory.
[0036] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for constructing the above-mentioned securities relationship map are implemented.
[0037] Beneficial effects of the embodiments of the present invention:
[0038] The method for constructing a securities relationship graph provided by an embodiment of the present invention obtains securities data of each security for multiple securities for which a securities relationship graph is to be constructed; for each of the securities, determines factor data of the security under multiple specified categories from the securities data of the security, and determines a securities vector under each specified category of the security based on the factor data under each specified category of the security; wherein each specified category is a category for describing securities, and the factor data under each specified category is securities description data under the specified category; for each specified category, determines specified relationship data between each security under the specified category based on the securities vectors under the specified category of each security; wherein the specified relationship data is data for characterizing an association relationship; with each security as a graph vertex, and based on the specified relationship data between each security under each specified category, constructs a securities relationship graph with each specified category as a graph dimension. In this solution, factor data for multiple securities under multiple specified categories is determined based on acquired securities data, and a securities relationship graph is constructed from multiple dimensions, increasing the richness of the graph. Furthermore, each security is vectorized using factor data to obtain a security vector. Based on these vectors, the specified relationship data between each security within each category is determined. This determined relationship data is then used to construct a securities relationship graph, improving the connectivity between the securities. Therefore, this solution allows for a better construction of a securities relationship graph.
[0039] Of course, it is not necessary to achieve all of the advantages described above simultaneously in order to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0041] Figure 1 A flowchart of a method for constructing a securities relationship map provided by an embodiment of the present invention;
[0042] Figure 2 Another flow chart of a method for constructing a securities relationship map provided by an embodiment of the present invention;
[0043] Figure 3 Another flow chart of a method for constructing a securities relationship map provided by an embodiment of the present invention;
[0044] Figure 4A schematic diagram of the structure of a program module for implementing the securities relationship mapping method provided in an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of the structure of a device for constructing a securities relationship map provided by an embodiment of the present invention;
[0046] Figure 6 This is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of the present invention.
[0048] Graphs can essentially reveal the relationships between vertices, such as protein interaction maps and chemical formula maps. However, there are currently few graphs that can reflect the relationships between different securities, such as stocks, funds, bonds, etc. If we can construct a graph that reflects the relationships between different securities and display it through visualization technology, it can be used to assist investors in investment decisions and risk prevention.
[0049] There are currently three main approaches to constructing securities relationship graphs. First, a securities relationship graph based on the industry to which the securities belong connects securities within the same industry, but not securities in different industries. Second, a securities relationship graph based on news or public opinion data connects securities mentioned simultaneously in news or public opinion. Third, a securities relationship graph based on the upstream and downstream supply chain relationships of the companies in which the securities are located connects securities with supply chain relationships. However, all three approaches have significant drawbacks.
[0050] First, the securities relationship map constructed based on the industry to which the securities belong cannot reflect the correlation between stocks in different industries, and the industry in which the securities are located is updated very rarely. Once the industry is determined, the industry will basically not be changed unless the company's main business changes. Therefore, the constructed securities relationship map is relatively fixed and cannot dynamically reflect the relationship between different securities; second, the securities relationship map constructed based on news or public opinion data only appears in the news or public opinion, and the securities involved are all hot securities, which are relatively small in number. In addition, crawler technology is needed to crawl news data from different sources, which has potential legal compliance issues, and natural language understanding technology is needed to extract securities names or securities codes, which has a high technical threshold; third, based on securities The securities relationship map constructed based on the upstream and downstream supply chain relationships of a company is difficult to obtain the supply chain relationship of each listed company, and each supply chain relationship is a tree diagram. In the best case, the constructed securities relationship map is only a tree diagram, with the number of edges and the number of vertices being of the same order of magnitude. Moreover, not all companies in the supply chain are listed companies, and not all issue securities. Securities under different supply chains cannot form a tree diagram, such as medical industry securities and animal husbandry securities. Therefore, the connectivity of the constructed securities relationship map is low. In addition, the company's supply chain is relatively stable and the frequency of change is low. Therefore, the securities relationship map constructed based on the upstream and downstream supply chain relationships of the company where the securities are located cannot dynamically reflect the relationship between securities.
[0051] As can be seen, the securities relationship maps constructed using these technologies all have low connectivity, making them unsuitable for analyzing the community structure of securities. Furthermore, the dimension of these securities relationship maps is 1, making it impossible to construct a more meaningful, multi-dimensional securities relationship map. Therefore, these securities relationship maps constructed using these technologies are not conducive to providing a reference for investors' investment decisions and risk prevention.
[0052] To address the above issues, improve the richness and connectivity of the securities relationship map, and thus better construct the securities relationship map, embodiments of the present invention provide a method, apparatus, and electronic device for constructing a securities relationship map. The method can be applied to electronic devices, such as computers and servers. The method includes:
[0053] Obtaining securities data for each of the multiple securities for which a securities relationship graph is to be constructed; wherein the securities data includes financial statements of the issuer of the securities, technical indicator data of the securities, and intraday trading data of the securities;
[0054] For each security, factor data under multiple designated categories of the security are determined from the security data of the security, and a security vector under each designated category of the security is determined based on the factor data under each designated category of the security; wherein each designated category is a category used to describe the security, and the factor data under each designated category is the description data of the security under the designated category;
[0055] For each designated category, based on the security vectors of each security in the designated category, determining designated relationship data between each security in the designated category; wherein the designated relationship data is data used to represent the association relationship;
[0056] With each security as a graph vertex, based on the specified relationship data between each security under each specified category, a securities relationship graph is constructed with each specified category as a graph dimension.
[0057] In this solution, factor data for multiple securities under multiple specified categories is determined based on acquired securities data, and a securities relationship graph is constructed from multiple dimensions, increasing the richness of the graph. Furthermore, each security is vectorized using factor data to obtain a security vector. Based on these vectors, the specified relationship data between each security within each category is determined. This determined relationship data is then used to construct a securities relationship graph, improving the connectivity between the securities. Therefore, this solution allows for a better construction of a securities relationship graph.
[0058] The following describes a method for constructing a securities relationship map provided by an embodiment of the present invention in conjunction with the accompanying drawings. Figure 1 As shown, the method may include the following steps:
[0059] S101, for multiple securities for which a securities relationship map is to be constructed, obtaining securities data for each security; wherein the securities data includes financial statements of the issuer of the security, technical indicator data of the security, and / or intraday trading data of the security;
[0060] Among them, securities can be stocks, funds, bonds, etc. The multiple securities for which the securities relationship map is to be constructed can be any number of securities in the market. The issuer of a security is generally a listed company, whose financial statements are publicly released. Technical indicator data refers to a data set of all securities prices calculated through mathematical formulas. Intraday trading data is data representing intraday trading. Intraday trading refers to a trading method with a short holding period and no overnight positions. Both technical indicator data and intraday trading data are publicly available on the internet. Therefore, the financial statements of the issuer of the securities, the technical indicator data of the securities, and the intraday trading data of the securities can all be obtained on the internet. In other words, for the multiple securities for which the securities relationship map is to be constructed, the securities data of each security can be directly obtained from the internet. The obtained securities data can be at least one of the above.
[0061] S102, for each security, determining factor data under multiple designated categories of the security from the security data of the security, and determining a security vector under each designated category of the security based on the factor data under each designated category of the security; wherein each designated category is a category used to describe the security, and the factor data under each designated category is the description data of the security under the designated category;
[0062] The aforementioned designated categories may be pre-defined based on experience and needs, and the factor data to be obtained for each designated category may also be specified. The factor data may be data specified in the securities data, or data obtained by performing specific calculations on the specified data in the securities data. When establishing a securities relationship map, for each designated category, the specified data may be obtained from the securities data as the factor data for that designated category. Alternatively, the specified data may be obtained from the securities data and then subjected to specific calculations to obtain the data obtained as the factor data for that designated category.
[0063] Taking the securities data as an example, the technical indicator data of the securities, the designated category can be set to the following categories:
[0064] Momentum, reversal, and technical composite categories. The factor data under the momentum category may include: long-term momentum, 6-month momentum, Williams indicator, etc.; the factor data under the reversal category may include: 1-month stock price reversal, 3-month stock price reversal, 6-month stock price reversal, etc.; the factor data under the technical composite category may include: price-volume divergence, price linear regression coefficient, trading volume variance, highest price length, highest point distance, stock price relative strength, etc.
[0065] For each security, the factor data under each specified category of the security can be vectorized to obtain the security vector under each specified category of the security.
[0066] In one implementation, the factor data includes at least one factor value;
[0067] For example, when the securities data is the financial statements of the issuer of the securities, the designated category can be set to the following categories:
[0068] a. Size category: The factor data under this category may include at least one of the following: total assets, working capital, financial expenses, free cash flow to equity, depreciation and amortization, total operating income, net working capital, and operating costs;
[0069] b. Profitability: The factor data in this category may include at least one of the following: return on equity before tax, return on net assets, return on total assets, net profit margin, gross profit margin, total profit margin, operating profit margin, and operating profit percentage;
[0070] c. Capital structure: The factor data in this category may include at least one of the following: debt-to-asset ratio, fixed asset ratio, equity-to-debt ratio, current asset ratio, total debt ratio, shareholder equity ratio, operating capital ratio, and retained earnings ratio;
[0071] d. Valuation: The factor data in this category may include at least one of the following: price-to-earnings ratio, price-to-book ratio, price-to-cash flow ratio, price-to-sales ratio, book-to-market ratio, net asset value per share, non-GAAP price-to-earnings ratio, and sales ratio;
[0072] e. Quality category: The factor data in this category may include at least one of the following: total asset cash recovery rate, accounts receivable and payable ratio, net profit volatility, interest coverage ratio, sales period expense ratio, retained earnings ratio, net profit volatility, and sales cash ratio;
[0073] f. Growth category: The factor data under this category may include at least one of the following: quarterly year-on-year growth rate of return on equity, quarterly year-on-year growth rate of net profit, operating profit growth rate, main business income growth rate, total asset growth rate, total profit growth rate, shareholders' equity growth rate, and net asset per share growth rate;
[0074] g. Operational category: the factor data under this category may include at least one of the following: accounts receivable turnover, fixed asset turnover, current asset turnover, inventory turnover, accounts payable turnover, shareholders' equity turnover, and total asset turnover;
[0075] h. Shareholder-related category: The factor data in this category can contain at least one of the following factors: executive shareholding ratio, employee stock ownership plan ratio, institutional shareholding change, shareholder number change rate, outstanding share ratio, institutional shareholding ratio of total share capital, largest shareholder shareholding ratio, and management shareholding ratio;
[0076] i. Debt-paying ability category: the factor data under this category may include at least one of the following factors: current ratio, quick ratio, cash ratio, cash flow ratio, long-term debt-to-equity ratio, cash flow to debt ratio, excess quick ratio, and long-term debt to operating income ratio.
[0077] When the securities data is technical indicator data of securities, the designated category can be set to the following categories:
[0078] a. Momentum: The factor data in this category can include at least one of the following: Long-Term Momentum, 6-Month Momentum, Williams Index, Seasonal, Stochastic, Commodity Channel Index (CCI), Momentum (MOM), and Moving Average Convergence / Divergence (MACD);
[0079] b. Reversal category: the factor data in this category can contain at least one of the following factor values: 1-month stock price reversal, 3-month stock price reversal, 6-month stock price reversal, 30-day price change, 90-day price change, and 180-day price change;
[0080] c. Technical composite category: the factor data under this category may contain at least one of the following factor values: price-volume divergence, volume ratio (a technical indicator for measuring buying and selling power), price linear regression coefficient, volume variance, highest price length, highest point distance, and stock price relative strength.
[0081] When the securities data is intraday trading data of securities, the specified category can be set to the high-frequency category. The factor values contained in the factor data under this category can be: high-frequency volatility, high-frequency idiosyncratic volatility, high-frequency specificity, high-frequency systematic volatility, high-frequency return variance, high-frequency return skewness and high-frequency return peak.
[0082] The factor values mentioned above can all be obtained from securities data, or by performing specific operations based on data obtained from the securities data. Such specific operations may be existing in the prior art and are not part of the inventive concept of the present invention and are not described in detail here. The above-mentioned designated categories and factor data are merely exemplary and are not limited to the designated categories and factor data in the embodiments of the present invention.
[0083] Determining the security vector for each designated category of the security based on the factor data for each designated category of the security may include:
[0084] For each designated category, each factor value contained in the factor data of the security in the designated category is used as a vector dimension to generate a security vector for the security in the designated category.
[0085] For example, assuming the designated category is size, and based on the financial statements of a security's issuer, the factor data for the size category contains the following factor values: total assets = A, working capital = B, financial expenses = C, etc. The resulting security vector for this security under the size category is [A, B, C, ...]. Alternatively, the factor values contained in the factor data for this designated category can be normalized, and the security vector for the security can be generated based on the normalized factor values.
[0086] In this implementation, for each specified category, each factor value contained in the factor data of the security in the specified category is used as a vector dimension to generate a security vector for the security in the specified category. The security vector makes it easier to reflect the correlation between the securities.
[0087] S103, for each designated category, determining designated relationship data between the securities in the designated category based on the security vectors of the securities in the designated category; wherein the designated relationship data is data used to represent the association relationship;
[0088] The above-mentioned designated relationship data may be the vector similarity between the security vectors of every two securities. In this case, for each designated category, based on the security vectors of each security in the designated category, determining the designated relationship data between the securities in the designated category may include:
[0089] For each designated category, the vector similarity of the securities vectors of every two securities in the designated category is calculated to obtain designated relationship data between every two securities in the designated category.
[0090] The vector similarity may be calculated by calculating normalized cosine similarity or Pearson correlation coefficient.
[0091] For example, when the specified category is the scale category, under the specified category, the security vector of security 1 is [A1, B1, C1...], and the security vector of security 2 is [A2, B2, C2...], then the vector similarity of the security vectors of security 1 and security 2 can be calculated as the specified relationship data between security 1 and security 2.
[0092] In this implementation, for each specified category, by calculating the vector similarity of the securities vectors of every two securities under the specified category, the specified relationship data between every two securities under the specified category is obtained. Furthermore, a securities relationship map can be constructed based on the specified relationship data.
[0093] S104 , using each security as a graph vertex and based on the designated relationship data between the securities under each designated category, constructing a securities relationship graph with each designated category as a graph dimension.
[0094] It can be understood that a graph is composed of graph vertices and graph edges consisting of graph vertices connected in pairs. In this embodiment, each security can be used as a graph vertex, and for each two securities, whether the graph vertices of the two securities are connected is determined based on the specified relationship data between the two securities.
[0095] In one implementation, the above-mentioned construction of a securities relationship graph with each designated category as a graph dimension, using each security as a graph vertex and based on designated relationship data between the securities under each designated category, may include steps A1-A2:
[0096] Step A1: For each designated category, based on the vector similarity of the security vectors of each two securities in the designated category, determine the associated securities corresponding to each security in the designated category; wherein the associated securities corresponding to each security are: securities whose vector similarity with the security is greater than a predetermined threshold, or a specified number of securities corresponding to the security, sorted by vector similarity.
[0097] In this implementation, a predetermined threshold may be set first, which may be set based on experience and needs. Then, for each security in each specified category, securities whose vector similarity with the security vector of the security is greater than the predetermined threshold are determined as associated securities.
[0098] Alternatively, a specified number may be pre-set, which can also be determined based on experience and needs. Then, for each security in each specified category, the specified number of securities with the greatest or least vector similarity to the security vector of that security is determined as associated securities. In this implementation, determining the specified number of securities with the greatest vector similarity to the security vector of that security as associated securities can relatively better reflect the association between the securities.
[0099] In the specific implementation process, for each specified category, an original securities relationship graph with the specified category as a graph dimension can be generated. The vertices in the original securities relationship graph are fully connected, that is, each security is connected to each other. At the same time, the vector similarity between the securities vectors of each two securities is used as the weight of the graph edge of the two securities. Then, for each graph vertex, a specified number of graph edges with the largest or smallest weight are retained to obtain a securities relationship graph with the specified category as a graph dimension.
[0100] Step A2: Use each security as a graph vertex and the connecting line corresponding to each specified category as the graph edge of the specified category to generate a securities relationship graph with each specified category as a graph dimension; wherein the connecting line corresponding to each specified category is the connecting line between the graph vertex of each security under the specified category and the graph vertex of the corresponding associated securities.
[0101] In this implementation, for each security in a specified category, the graph vertices of that security are connected to the graph vertices of the corresponding associated securities in the securities relationship graph, thereby obtaining connecting lines between the graph vertices of that security and the graph vertices of the corresponding associated securities. For each specified category, each connecting line is used as a graph edge, thereby obtaining a securities relationship graph with the specified category as a graph dimension. Ultimately, a multi-dimensional securities relationship graph is obtained, with each specified category as a graph dimension.
[0102] A multi-dimensional securities relationship graph can be a collection of securities relationship graphs of each graph dimension, that is, the securities relationship graph of each graph dimension can be regarded as an independent graph, or it can be a graph containing multiple types of graph edges. That is to say, in a multi-dimensional securities relationship graph, there may be multiple graph edges between every two securities, and each graph edge is used to represent a different specified category.
[0103] After the securities relationship map is generated, the securities relationship map can be stored in a graph database to realize the storage of the securities relationship map. The client's terminal device can also obtain the securities relationship map from the graph database and visualize the securities relationship map in the terminal device.
[0104] In this embodiment, for multiple securities, factor data for multiple specified categories is determined for each security based on the acquired security data, and a securities relationship graph is constructed from multiple dimensions, thereby increasing the richness of the securities relationship graph. Furthermore, each security is vectorized using the factor data to obtain a security vector. Based on the obtained security vector, the specified relationship data between each security within each category is determined. The determined specified relationship data is then used to construct a securities relationship graph, thereby improving the connectivity between the securities. Therefore, this solution enables a better construction of a securities relationship graph.
[0105] Alternatively, in another embodiment of the present invention, Figure 2 As shown, the method for determining the designated quantity corresponding to each security may include steps S201 to S203:
[0106] S201, for each designated category, calculate M information entropies of a securities relationship graph of the designated category as a graph dimension when the number of associated securities corresponding to each security in the designated category is 1 to M respectively; where M is the total number of securities;
[0107] That is, assuming that the number of associated securities corresponding to each security under the specified category is 1, 2, 3...M, calculate the information entropy of the securities relationship map of the specified category as a graph dimension in each case, wherein the information entropy can be used to measure the uncertainty of the securities relationship map of the specified category as a graph dimension, that is, the reliability of the securities relationship map of the specified category as a graph dimension. For example, if the number of associated securities corresponding to each security under the specified category is n, then the information entropy of the securities relationship map of the specified category as a graph dimension can be calculated when the number of associated securities corresponding to each security under the specified category is n.
[0108] Assuming that the securities are security 1, security 2, security 3...security M, the information entropy can be calculated according to the following formula:
[0109]
[0110] Where H(n) is the information entropy of the securities relationship graph with the specified category as a graph dimension when the number of related securities corresponding to each security under the specified category is n, and the value of n ranges from 1 to M; M is the total number of securities; When the number of associated securities of security m is n, the sum of the vector similarities of the security vectors of the n associated securities. The n associated securities may be the n securities with the greatest vector similarity to the security vector of security m, and the value range of m is 1 to M.
[0111] S202, selecting the minimum point with the smallest value from each of the obtained information entropies as the target information entropy;
[0112] It can be understood that selecting the smallest minimum point can ensure that the uncertainty of the securities relationship map of the specified category as a map dimension is as small as possible while excluding meaningless minimum points.
[0113] S203: Determine the number of associated securities corresponding to the target information entropy as the designated number corresponding to each security in the designated category.
[0114] It can be understood that for each specified category, the specified quantity corresponding to each security under the specified category can be determined by calculating the information entropy, so that the uncertainty of the securities relationship map of multiple dimensions finally generated is lower.
[0115] In this embodiment, for each specified category, the number of associated securities corresponding to each security within the specified category is calculated, ranging from 1 to M. This specifies the M information entropies of the securities relationship graph for that specified category as a graph dimension. The minimum point with the smallest value among the obtained information entropies is selected as the target information entropy. The number of associated securities corresponding to the target information entropy is then determined as the specified number for each security within the specified category. This solution, by calculating information entropy to determine the specified number, can enhance the reliability of the constructed securities relationship graph.
[0116] Optionally, in another embodiment of the present invention, the obtaining of securities data of each of the multiple securities for which the securities relationship graph is to be constructed may include:
[0117] Whenever a predetermined construction cycle is entered, the securities data of each security in the current construction cycle is obtained for multiple securities for which the securities relationship map is to be constructed; wherein the duration of the construction cycle is determined based on the duration of the update cycle of the securities data.
[0118] In this embodiment, the securities relationship map can be updated periodically. That is, for multiple securities for which the securities relationship map is to be constructed, the securities data of each security within the current construction cycle is periodically obtained, and the subsequent process of constructing the securities relationship map is executed. The above construction cycle can be consistent with the update cycle of the securities data, such as one quarter, one month, one day, one hour, etc., which is all possible. Different designated categories can also have different construction cycles. For example, if the factor data under the designated category is derived from the financial statements of the issuer of the securities, the construction cycle can be one quarter; if the factor data under the designated category is derived from the technical indicator data of the securities, the construction cycle can be one day; if the factor data under the designated category is derived from the intraday trading data of the securities, the construction cycle can be one hour.
[0119] In this embodiment, factor data for multiple securities under multiple specified categories is determined for each security based on the acquired security data, and a securities relationship graph is constructed from multiple dimensions, thereby increasing the richness of the securities relationship graph. Furthermore, each security is vectorized using the factor data to obtain a security vector, and a securities relationship graph is constructed based on the obtained security vectors, thereby improving the connectivity between the securities. Therefore, this solution enables a better construction of the securities relationship graph. Furthermore, by obtaining the securities data for each security within the current construction cycle for the multiple securities for which the securities relationship graph is to be constructed each time a predetermined construction cycle begins, the securities relationship graph can be dynamically updated, thereby dynamically reflecting the relationships between different securities.
[0120] Optionally, in another embodiment of the present invention, the method further includes:
[0121] By using the community mining algorithm and the specified relationship data of each security under each graph dimension in the securities relationship graph, each security is divided into different clusters from different graph dimensions.
[0122] Community mining involves dividing entities into different types, or clusters, to maximize the number of graph edges within a cluster and minimize the number of graph edges between clusters. Community mining algorithms can include UEOC (Ensemble Network Overlapping Community Mining Algorithm) and FNCA (Fast Community Mining Algorithm), and are not specifically limited in this embodiment.
[0123] In actual application, the community mining algorithm can be used to process the securities relationship graph under each graph dimension. Since the community mining algorithm generally uses the weights of each graph edge, when the specified relationship data is the vector similarity of the securities vectors of every two securities under each graph dimension, the vector similarity of the securities vectors of every two securities can be used as the weight of the graph edge with the two securities as graph vertices. Furthermore, by bringing the weights of each graph edge under each graph dimension into the calculation process of the above-mentioned community mining algorithm, the calculation result of dividing each security under the graph dimension into different clusters can be obtained.
[0124] In this embodiment, by utilizing a community mining algorithm and the designated relationship data of each security under each graph dimension in the securities relationship graph, each security is divided into different clusters from different graph dimensions, which can more intuitively reflect the correlation between different securities, thereby better providing a reference for investors' investment decisions and risk prevention.
[0125] For ease of understanding, the method for constructing a securities relationship map provided by an embodiment of the present invention is further introduced below with reference to the accompanying drawings.
[0126] like Figure 3 As shown, there are N designated categories, designated category 1, designated category 2... designated category N. For designated category 1, multi-factor vector data of designated category 1 can be constructed first, that is, the securities vectors of each security under designated category 1; the vector similarity between the securities vectors of every two securities is calculated based on the securities vectors of each security; the vector similarity between the securities vectors of every two securities is used as the weight of the graph edge of the two securities, thereby constructing a fully connected original securities relationship graph; the number of graph edges n is determined according to the minimum value of information entropy, and the n graph edges with the largest weights are retained for each security to obtain the securities relationship graph of designated category 1, that is, the securities relationship graph with designated category 1 as a graph dimension.
[0127] The construction method for the relationship graphs of securities in other designated categories is the same. Once the relationship graphs for each designated category are constructed, they are superimposed to generate a multi-dimensional securities relationship graph. The graph can then be stored and visualized, meaning the graph is stored in a graph database and displayed on the client. Simultaneously, community mining and analysis is performed between securities. This involves using a community mining algorithm to classify the designated relationship data for each security within each graph dimension into different clusters based on the graph dimensions.
[0128] In one implementation, the computer program for implementing the method provided by the embodiment of the present invention can be divided into Figure 4 Multiple functional modules shown:
[0129] The securities multi-factor data calculation module is used to obtain the securities data of each security for multiple securities whose securities relationship map is to be constructed, and to obtain and calculate the factor data of each security under multiple specified categories from the securities data, and generate the securities vector of each security under each specified category;
[0130] The securities similarity calculation module is used to calculate the vector similarity of the securities vectors of every two securities in each specified category;
[0131] The fully connected securities graph building module is used to build and store a fully connected securities relationship graph between all securities in each specified category, where the weight of the graph edge is the vector similarity between the securities vectors of the two securities on the graph edge;
[0132] A security edge number determination module is used to calculate the specified number of graph edges for each security under each specified category, and retain the specified number of graph edges for each security under each specified category;
[0133] A securities multi-dimensional relationship map superposition and generation module, used to combine the securities relationship map of each specified category into a multi-dimensional securities relationship map;
[0134] The securities relationship graph storage and visualization module is used to store the constructed securities relationship graph in the graph database and use the advantages of the graph database in display to visualize the multi-dimensional relationship between different securities;
[0135] The securities relationship graph community mining and analysis module is used to use the community mining algorithm and the specified relationship data of each security under each graph dimension in the securities relationship graph to divide each security into different clusters from different graph dimensions and analyze the securities relationships within each cluster and between different clusters.
[0136] In this embodiment, factor data for multiple specified categories is determined for each security based on the acquired securities data, and a securities relationship graph is constructed from multiple dimensions, thereby increasing the richness of the graph. Furthermore, each security is vectorized using the factor data to obtain a security vector, and a securities relationship graph is constructed based on the obtained security vectors, thereby improving the connectivity between the securities. Therefore, this solution allows for a better construction of the securities relationship graph.
[0137] The embodiment of the present invention also provides a device for constructing a securities relationship map, such as Figure 5 As shown, the device includes:
[0138] An acquisition module 510 is configured to acquire securities data for each of the multiple securities for which a securities relationship graph is to be constructed; wherein the securities data includes financial statements of the issuer of the securities, technical indicator data of the securities, and / or intraday trading data of the securities;
[0139] The vector determination module 520 is configured to determine, for each security, factor data for the security under multiple designated categories from the security data of the security, and determine a security vector for each designated category of the security based on the factor data for each designated category of the security; wherein each designated category is a category used to describe the security, and the factor data for each designated category is the description data of the security under the designated category;
[0140] The relationship determination module 530 is configured to determine, for each designated category, designated relationship data between the securities in the designated category based on the security vectors of the securities in the designated category; wherein the designated relationship data is data used to represent the association relationship;
[0141] The construction module 540 is used to use each security as a graph vertex and, based on the specified relationship data between each security under each specified category, to construct a securities relationship graph with each specified category as a graph dimension.
[0142] Optionally, the factor data includes at least one factor value;
[0143] The vector determination module is specifically used to:
[0144] For each designated category, each factor value contained in the factor data of the security in the designated category is used as a vector dimension to generate a security vector for the security in the designated category.
[0145] Optionally, the relationship determination module is specifically configured to:
[0146] For each designated category, the vector similarity of the securities vectors of every two securities in the designated category is calculated to obtain designated relationship data between every two securities in the designated category.
[0147] Optionally, the building block includes:
[0148] The associated securities determination submodule is configured to determine, for each designated category, the associated securities corresponding to each security in the designated category based on the vector similarity of the security vectors of each two securities in the designated category; wherein the associated securities corresponding to each security are: securities whose vector similarity with the security is greater than a predetermined threshold, or a specified number of securities corresponding to the security, sorted by vector similarity, and ranked by vector similarity;
[0149] The generation submodule is used to generate a securities relationship graph with each specified category as a graph dimension, using each security as a graph vertex and the connecting line corresponding to each specified category as the graph edge of the specified category; wherein the connecting line corresponding to each specified category is the connecting line between the graph vertex of each security under the specified category and the graph vertex of the corresponding associated securities.
[0150] Optionally, the device further comprises:
[0151] A calculation module is used to calculate, for each specified category, M information entropies of a securities relationship graph with the specified category as a graph dimension, when the number of associated securities corresponding to each security in the specified category ranges from 1 to M; where M is the total number of securities;
[0152] A selection module is used to select the minimum value point with the smallest value from each information entropy obtained as the target information entropy;
[0153] The quantity determination module is used to determine the number of associated securities corresponding to the target information entropy as the designated quantity corresponding to each security in the designated category.
[0154] Optionally, the acquisition module is specifically configured to:
[0155] Whenever a predetermined construction cycle is entered, the securities data of each of the multiple securities for which the securities relationship map is to be constructed is obtained within the current construction cycle; wherein the duration of the construction cycle is determined based on the duration of the update cycle of the securities data.
[0156] Optionally, the device further comprises:
[0157] The partitioning module is used to utilize a community mining algorithm and the designated relationship data of each security under each graph dimension in the securities relationship graph to partition each security into different clusters from different graph dimensions.
[0158] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0159] Memory 603, used for storing computer programs;
[0160] The processor 601 is configured to implement the above-mentioned method for constructing the securities relationship map when executing the program stored in the memory 603 .
[0161] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0162] The communication interface is used for communication between the above electronic device and other devices.
[0163] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0164] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0165] In another embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the method for constructing the securities relationship map are implemented.
[0166] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for constructing a securities relationship map in the above embodiment.
[0167] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0168] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0169] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0170] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A method for constructing a securities relationship map, characterized in that: The method comprises: Obtaining securities data for each of the multiple securities for which a securities relationship map is to be constructed; wherein the securities data includes financial statements of the issuer of the securities, technical indicator data of the securities, and / or intraday trading data of the securities; For each of the securities, factor data under multiple specified categories of the security are determined from the security data of the security, and a security vector under each specified category of the security is determined based on the factor data under each specified category of the security; wherein each specified category is a category used to describe the security, and the factor data under each specified category is the security description data under the specified category; and the factor data under each specified category is obtained by calculation using the specified data obtained from the security data; For each designated category, based on the security vectors of each security in the designated category, determining designated relationship data between the securities in the designated category; wherein the designated relationship data is vector similarity of the security vectors; For each specified category, based on the vector similarity of the security vectors of each two securities in the specified category, determine the associated securities corresponding to each security in the specified category; the associated securities corresponding to each security are: a specified number of securities that are ranked higher in order of vector similarity and that correspond to the security; Using each security as a graph vertex and the connecting line corresponding to each specified category as the graph edge of the specified category, a securities relationship graph is generated with each specified category as a graph dimension. The connecting line corresponding to each specified category is the connecting line between the graph vertex of each security under the specified category and the graph vertex of the corresponding related security. The designated quantity for each security is determined by: For each specified category, calculate the M information entropies of the securities relationship graph of the specified category as a graph dimension when the number of related securities corresponding to each security in the specified category is 1 to M respectively; where M is the total number of securities; Select the minimum point with the smallest value from the obtained information entropy as the target information entropy; The number of associated securities corresponding to the target information entropy is determined as the designated number corresponding to each security in the designated category.
2. The method according to claim 1, characterized in that The factor data includes at least one factor value; The step of determining the security vector for each designated category of the security based on the factor data for each designated category of the security comprises: For each designated category, each factor value contained in the factor data of the security in the designated category is used as a vector dimension to generate a security vector for the security in the designated category.
3. The method according to claim 1 or 2, characterized in that The step of determining, for each designated category, designated relationship data between the securities in the designated category based on the security vectors of the securities in the designated category, includes: For each designated category, the vector similarity of the securities vectors of every two securities in the designated category is calculated to obtain designated relationship data between every two securities in the designated category.
4. The method according to claim 1, wherein The step of obtaining the securities data of each of the multiple securities for which the securities relationship map is to be constructed includes: Whenever a predetermined construction cycle is entered, the securities data of each of the multiple securities for which the securities relationship map is to be constructed is obtained within the current construction cycle; wherein the duration of the construction cycle is determined based on the duration of the update cycle of the securities data.
5. The method according to claim 1, wherein The method further comprises: By using a community mining algorithm and the designated relationship data of each security under each graph dimension in the securities relationship graph, each security is divided into different clusters from different graph dimensions.
6. A device for constructing a securities relationship map, characterized in that: The device comprises: an acquisition module, configured to acquire, for each of the plurality of securities for which a securities relationship map is to be constructed, securities data; wherein the securities data includes financial statements of the issuer of the securities, technical indicator data of the securities, and intraday trading data of the securities; a vector determination module configured to determine, for each of the securities, factor data under multiple designated categories of the security from the security data of the security, and determine, based on the factor data under each designated category of the security, a security vector under each designated category of the security; wherein each designated category is a category used to describe the security, and the factor data under each designated category is data describing the security under the designated category; and the factor data under each designated category is calculated using the designated data obtained from the security data; a relationship determination module configured to determine, for each designated category, designated relationship data between the securities in the designated category based on the security vectors of the securities in the designated category; wherein the designated relationship data is vector similarity between the security vectors; A construction module is configured to determine, for each specified category, the associated securities corresponding to each security in the specified category based on the vector similarity of the security vectors of each two securities in the specified category; the associated securities corresponding to each security are: a specified number of securities that are ranked higher in order of vector similarity and that correspond to the security; Using each security as a graph vertex and the connecting line corresponding to each specified category as the graph edge of the specified category, a securities relationship graph is generated with each specified category as a graph dimension. The connecting line corresponding to each specified category is the connecting line between the graph vertex of each security under the specified category and the graph vertex of the corresponding related security. The designated quantity for each security is determined by: For each specified category, calculate the M information entropies of the securities relationship graph of the specified category as a graph dimension when the number of related securities corresponding to each security in the specified category is 1 to M respectively; where M is the total number of securities; Select the minimum point with the smallest value from the obtained information entropy as the target information entropy; The number of associated securities corresponding to the target information entropy is determined as the designated number corresponding to each security in the designated category.
7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Stock market data analysis method based on key stock set identification
CN103236013A