A Trade Indicator Visualization System and Method Based on Domestic Trade Commodity Data
By using Sankey diagrams and nonlinear mapping techniques, the problem of dynamically displaying commodity flow and industrial chain relationships in the visualization of trade indicators has been solved, achieving clear quantification and visualization of commodity trade indicators and improving the display effect of trade circulation paths.
Patent Information
- Application Number
- CN202510585802.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-05-08
AI Technical Summary
Existing methods for visualizing trade indicators are insufficient to dynamically display the flow of goods and the relationships within the industrial chain, resulting in the obscuring of key trends and an inability to effectively reflect and quantify trade indicators and visualization effects.
Using Sankey diagrams as the core visualization tool, we construct an initial Sankey diagram, calculate the intensity of trade along the path, the degree of trade penetration, and comprehensive trade indicators, and use a nonlinear mapping method with line width to process the flow of different sides, thus achieving a clear display of commodity circulation paths.
It breaks through the limitations of traditional single-dimensional analysis, significantly optimizes the display of complex relationships in the trade chain, and can quantify the market performance and coverage of commodities in the circulation process, thereby improving the accuracy and visualization of trade indicators.
Smart Images

Figure CN120494871B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of trade data processing technology, specifically to a trade indicator visualization system and method based on domestic trade commodity data. Background Technology
[0002] With the continuous expansion of China's economy and the ongoing upgrading of its domestic demand market, the complexity, dynamism, and correlation of domestic trade data have significantly increased. To leverage big data, artificial intelligence, and other technologies to statistically analyze commodity trade data based on the characteristics of market and regional development reflected in the trade process, is a crucial technical means to improve the digitalization of commodity trade and meet the demands of modern economic governance for real-time monitoring, multi-dimensional correlation analysis, and visualized decision-making.
[0003] However, in existing technologies, the visualization of trade indicators for domestic trade commodities mostly adopts basic forms such as two-dimensional line charts and bar charts. These forms are difficult to dynamically display the flow of goods and the relationship between the industrial chain, which leads to the obscuring of key trends and thus cannot effectively reflect and quantify the trade indicators of goods and the corresponding visualization effects. Summary of the Invention
[0004] This invention provides a trade indicator visualization system and method based on domestic trade commodity data to solve existing problems.
[0005] The present invention provides a trade indicator visualization system and method based on domestic trade commodity data, which adopts the following technical solution:
[0006] One embodiment of the present invention provides a method for visualizing trade indicators based on domestic trade commodity data, the method comprising the following steps:
[0007] Obtain trade and logistics data for several products and several competitors of each product;
[0008] An initial Sankey diagram is constructed using trade and logistics data for all commodities. The circulation efficiency of any commodity along a trade path in the initial Sankey diagram is used as the path trade intensity of the commodity on that trade path. The trade penetration of the commodity is calculated by combining the path trade intensity of the commodity on all corresponding trade paths and the relative number of regions to which the commodity is sold. The trade index of the commodity is calculated by using the relative trade penetration of any commodity with all competitors and the distribution characteristics of the commodity's trade data in all sales regions.
[0009] Based on the relative sizes of the line widths of all edges in the same column of the initial Sankey diagram, the line width coefficient of each edge in the initial Sankey diagram is calculated. The line width coefficient and trade indicators are then used to adjust the line width of each edge in the initial Sankey diagram to obtain the trade Sankey diagram.
[0010] Visualize the Sankey diagram of trade and trade indicators for each commodity.
[0011] Furthermore, the specific methods for constructing the initial Sankey diagram using trade and logistics data of all commodities include:
[0012] Construct a Sankey diagram with a horizontal distribution from left to right, and use the product category as the node in the first column of the Sankey diagram; divide the regions into sales tiers according to their size, with larger regions having higher sales tiers and being farther from the retail market; and use the sales volume of a product in a corresponding region as the flow of the edges between nodes in different columns.
[0013] Furthermore, the specific method for obtaining the path trade intensity of any commodity on the trade path generated during the trade process through the initial Sankey diagram is as follows:
[0014] Obtain several trade routes for any commodity;
[0015] For any commodity on any trade path, calculate the path trade intensity of the commodity on the trade path based on the flow, price, and delivery speed corresponding to the edges included in the trade path.
[0016] Furthermore, the specific method for obtaining the path trade intensity is as follows:
[0017] The product of flow and price of a commodity on any edge of the trade path is obtained and denoted as the contribution factor of that edge. The sum of the contribution factors of all edges of the commodity on the trade path is denoted as the total contribution factor of the trade path. The ratio of the distance between two regional nodes corresponding to each edge on the trade path to the delivery time is denoted as the delivery speed of that edge. The average delivery speed of all edges on the trade path is denoted as the average delivery speed of the trade path. Based on the average delivery speed of the commodity on the trade path and the total contribution factor, the path trade intensity of the commodity on the trade path is obtained. The path trade intensity is positively correlated with both the average delivery speed and the total contribution factor.
[0018] Furthermore, the specific method for calculating the trade penetration of a commodity by combining the path trade intensity of the commodity on all corresponding trade routes and the relative quantity of the commodity sold to various regions includes:
[0019] The ratio of the number of regions to which a commodity is sold to to the total number of regions in the initial Sankey diagram is denoted as the relative number of regions to which the commodity is sold. The information entropy of the path trade intensity of all trade paths of the commodity is obtained and denoted as the path trade intensity entropy of the commodity. Based on the relative number of regions to which the commodity is sold and the path trade intensity entropy, the degree of trade penetration of the commodity is obtained. The degree of trade penetration is positively correlated with both the relative number of regions to which the commodity is sold and the path trade intensity entropy.
[0020] Furthermore, the specific method for calculating the trade index of a commodity by utilizing the relative trade penetration of any commodity with all competing commodities, and the distribution characteristics of trade data of the commodity in all sales regions, includes:
[0021] The difference between the trade penetration level of a commodity and the maximum trade penetration level among all its competitors is denoted as the first difference. The ratio of the first difference to the mean trade penetration level of the commodity and all its competitors is denoted as the relative trade penetration rate of the commodity. The average and standard deviation of the commodity's output, sales volume, and inventory level in all sales regions are obtained respectively. Output, sales volume, and inventory level are denoted as performance factors of the commodity. The ratio of the average and standard deviation of the commodity under any performance factor is denoted as the performance factor of the commodity under the stated performance factor. The range of the performance factor of the commodity under all performance factors is denoted as the trade performance balance of the commodity. Based on the relative trade penetration rate and trade performance balance of the commodity, trade indicators of the commodity are obtained. The trade indicators are positively correlated with the relative trade penetration rate and negatively correlated with the trade performance balance.
[0022] Furthermore, the specific method for calculating the line width coefficient of each edge in the initial Sankey graph based on the relative size of the line widths of all edges in the same column of the initial Sankey graph includes:
[0023] Linearly normalize the line widths of all edges in the same column and add them to the preset adjustment parameters to obtain the line width coefficient of each edge in the initial Sankey diagram.
[0024] Furthermore, the method for adjusting the line width of each edge in the initial Sankey diagram using line width coefficients and trade indicators to obtain a trade Sankey diagram includes the following specific methods:
[0025] For any edge in the initial Sankey graph, an adjustment coefficient is obtained based on the edge's line width coefficient and trade index. The line width of the edge in the initial Sankey graph is adjusted using the adjustment coefficient to obtain the adjusted line width of the edge.
[0026] Furthermore, the specific method for obtaining the adjustment coefficient of the edge is as follows:
[0027] For any edge, the trade index of the commodity corresponding to the edge is used as the input of the logarithmic function to obtain the logarithmic factor of the edge. The product of the logarithmic factor and the line width coefficient of the edge is obtained and added to the preset first parameter to obtain the adjustment coefficient of the edge.
[0028] A trade indicator visualization system based on domestic trade commodity data includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the trade indicator visualization method based on domestic trade commodity data.
[0029] The beneficial effects of the technical solution of this invention are as follows: By integrating trade data (such as transaction volume and tariffs), logistics data (such as transportation costs and timeliness), and competitor relationship data, a dynamic analysis model covering the entire trade chain is constructed, breaking through the limitations of traditional single-dimensional analysis; by introducing Sankey diagrams as the core visualization tool, the circulation path of goods, the flow of each node, and the sales level are clearly presented, which is significantly better than the limitations of traditional bar charts and line charts in displaying the complex relationships of the trade chain. On this basis, by defining path trade intensity, trade penetration degree, and comprehensive trade indicators, the market performance and coverage of goods in the circulation process are effectively quantified. At the same time, by using trade indicators to process the flow of different sides through nonlinear mapping of line width at the visualization level, even weak but important circulation paths can be clearly displayed in the chart, improving the visualization effect after accurate quantification of the trade indicators of goods. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a flowchart illustrating the steps of a trade indicator visualization method based on domestic trade commodity data according to the present invention.
[0032] Figure 2 An example diagram of an initial Sankey diagram provided for one embodiment of the present invention. Detailed Implementation
[0033] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a trade indicator visualization system and method based on domestic trade commodity data proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0035] The following description, in conjunction with the accompanying drawings, details the specific scheme of a trade indicator visualization system and method based on domestic trade commodity data provided by this invention.
[0036] Please see Figure 1 The diagram illustrates a flowchart of a method for visualizing trade indicators based on domestic trade commodity data, according to an embodiment of the present invention. The method includes the following steps:
[0037] Step S001: Obtain trade data and logistics data corresponding to several products and several competitors of each product.
[0038] It should be noted that when goods circulate domestically, they are usually produced and then distributed through distributors and consumers. Therefore, in the process of domestic trade, a large amount of trade data is generated by a large number of goods, which are distributed through multiple layers of distributors until the goods reach the end user.
[0039] Specifically, in order to implement the trade indicator visualization method based on domestic trade commodity data proposed in this embodiment, it is first necessary to collect trade data generated when commodities circulate domestically. The specific process is as follows:
[0040] Step S101, Data Collection: 1) Obtain trade data for several commodities and their corresponding competitors in the market for a period of time (preset as 1 year), including: price data, regional production data, regional sales data, regional inventory data, etc.
[0041] It should be noted that the price data of the product refers to the price of the product within a preset time period; the regional production data of the product refers to the production volume of the product in several regions; the regional sales data of the product refers to the sales volume of the product in several regions; and the regional inventory data of the product refers to the inventory volume of the product in several regions.
[0042] 2) Obtain logistics data for several types of goods during the trade and circulation process. The logistics data includes the delivery time of the goods, the sales area, and the distance between the areas.
[0043] Step S102, Data Cleaning and Standardization:
[0044] 1) Use interpolation or historical averages of product categories to fill in missing production and sales data to handle missing values.
[0045] 2) Convert production units (tons, pieces) and price units (yuan / kilogram, yuan / piece) into standard units of measurement.
[0046] Thus, trade data for several commodities have been obtained through the above methods.
[0047] Step S002: Construct an initial Sankey diagram using trade and logistics data for all commodities. The circulation efficiency of any commodity along a trade path in the initial Sankey diagram is used as the path trade intensity of the commodity on that trade path. Combine the path trade intensity of the commodity on all corresponding trade paths with the relative quantity of the commodity sold to different regions to calculate the trade penetration of the commodity. Calculate the trade index of the commodity using the relative trade penetration of any commodity with all competing products and the distribution characteristics of the commodity's trade data across all sales regions.
[0048] It should be noted that for the same type of goods, domestic trade is often influenced by geography and culture, resulting in regional market stratification. Furthermore, the circulation of goods involves a multi-level chain of "manufacturer - provincial agent - city distributor - retailer." Therefore, to visualize commodity trade and its indicators, this embodiment of the invention chooses to use visualization charts (i.e., Sankey diagrams, such as...) Figure 2 The diagram shown is a Sankey diagram. A Sankey diagram consists of edges, flows, and nodes. Edges represent flowing data, flows represent specific values of flowing data, and nodes represent different categories. The width of the edges is proportional to the flow (the wider the edge, the larger the value). This method constructs the domestic trade structure of goods and quantifies the trade indicators of goods based on this trade structure.
[0049] The specific process includes: Step S201, constructing an initial Sankey diagram based on the sales volume and destination regions of all goods in the trade circulation process.
[0050] In the process of commodity trade and circulation, for any type of commodity, there may usually be multiple production and warehousing areas. When the commodity is traded through multi-level sales, there will be commodity packages sent from multiple storage points and then transferred to the warehouses of agents and distributors at various levels. Therefore, the embodiments of the present invention combine this law of commodity trade and circulation with Sankey diagrams to construct an initial Sankey diagram for each commodity in the process of trade and circulation.
[0051] The specific process includes: First, construct an initial Sankey diagram according to the horizontal distribution direction from left to right, and take the product as the node in the first column of the initial Sankey diagram, and denote it as the product node.
[0052] Then, the sales regions of the products are used as region nodes. The region nodes of the products are divided into levels according to the size of the sales regions. The higher the level of the region node corresponding to the sales region, the farther away from the retail market. The initial Sankey diagram is obtained in the order of the levels. Each of the region columns contains several region nodes that correspond to a region.
[0053] Finally, edges are formed between regional nodes in different columns of the initial Sankey diagram based on the logistics data of the goods, and the sales volume of the goods in the corresponding sales regions is used as the flow of the corresponding edges.
[0054] like Figure 2 The diagram shown is an example of an initial Sankey diagram provided by an embodiment of the present invention. The nodes in the first column are: jeans, sweatshirts, short-sleeved shirts, and hoodies, all of which are product nodes. The other columns are regional columns, each containing multiple regional nodes. In terms of sales region hierarchy, Sichuan, Hubei, Shanxi, and Shaanxi are at the highest level, while Weiyang District, Wuchang District, and Jinjiang District are at the lowest level, corresponding to the retail market. It can be seen that the highest-level Sichuan, Hubei, Shanxi, and Shaanxi are furthest from the retail market. In addition, in the initial Sankey diagram, the edge between a product node and the highest-level regional node represents the production and inventory of the product in different regions, while the edge between other regional nodes represents the sales volume from one region to another. Furthermore, when obtaining the trade path in the initial Sankey diagram and using the trade path for analysis, and needing to use the sales volume of the edge, since the edge between a product node and the highest-level regional node represents the production and inventory of the product in different regions, the edge between the product node and the highest-level regional node does not participate in the corresponding feature calculation.
[0055] Step S202: Calculate the trade index of any commodity by utilizing the path characteristics formed by any commodity in the initial Sankey diagram.
[0056] In this embodiment of the invention, considering that commodity circulation has obvious hierarchical flow (such as from the place of production to the provincial agent, and then to the retail terminal), this embodiment of the invention chooses graph structure (Sankey diagram) modeling as the most suitable way to express multi-level trade circulation relationships. It can clearly reflect the flow relationship and numerical distribution between nodes. At the same time, since different commodities perform differently in the market, it is actually reflected in the strength and breadth of the flow path in their Sankey diagram. Analyzing the flow path can obtain comprehensive trade channel data, thereby effectively quantifying the trade indicators of commodities to reflect the performance of commodities in domestic trade.
[0057] First, in the initial Sankey graph, the Depth-First Search (DFS) algorithm is used to obtain several paths from the commodity nodes to the region nodes in the last column, which are then used as trade paths.
[0058] Each trade route represents a specific trade circulation route for a type of commodity within a certain period of time.
[0059] Then, based on the trade routes in the initial Sankey diagram, the trade indicators of goods are calculated. The specific process includes:
[0060] 1) For any commodity and any trade path, calculate the path trade intensity of the commodity on the trade path based on the flow, price and delivery speed corresponding to the edges included in the trade path.
[0061] The method for obtaining the path trade intensity includes: obtaining the product of the flow and price of the commodity on any edge of the trade path, denoted as the contribution factor of the edge; denoting the sum of the contribution factors of all edges of the commodity on the trade path as the total contribution factor of the trade path; denoting the ratio of the distance between two regional nodes corresponding to each edge of the trade path to the delivery time as the delivery speed of the edge; obtaining the average value of the delivery speed of all edges of the trade path as the average delivery speed of the trade path; and obtaining the path trade intensity of the commodity on the trade path based on the average delivery speed of the commodity on the trade path and the total contribution factor. The path trade intensity is positively correlated with both the average delivery speed and the total contribution factor.
[0062] As one embodiment, the specific method for calculating the intensity of the trade route is as follows:
[0063]
[0064] Where γ represents the path trade intensity of the goods along the trade path; A represents the number of edges along the trade path; l a This represents the flow of the commodity at the a-th edge along the trade path; m aThis represents the price of the commodity when it is sold along the a-th edge of the trade route; This represents the average delivery speed of the commodity along the trade route; e represents the natural constant.
[0065] It should be noted that route trade intensity, by combining the sales volume, sales price, and delivery time of a commodity, describes the circulation efficiency of the commodity per unit time along a corresponding trade route during its sale. Here, l a ×m a Edges with higher flow and higher price contribute more to the overall benefit of the path. It has a negative impact on overall efficiency. The higher the value, the lower the average delivery speed of goods along that trade route, meaning lower commodity circulation efficiency. Therefore, route trade intensity can reflect the efficiency level of a commodity at different transport speeds along a corresponding trade route.
[0066] 2) For any commodity, calculate the trade penetration of the commodity by combining the path trade intensity of the commodity on all corresponding trade routes and the relative quantity of the commodity sold to the regions.
[0067] The method for obtaining the trade penetration level of the commodity includes: recording the ratio of the number of regions to which the commodity is sold to to the total number of regions in the initial Sankey diagram as the relative number of regions to which the commodity is sold; obtaining the information entropy of the path trade intensity of all trade paths of the commodity as the path trade intensity entropy of the commodity; and obtaining the trade penetration level of the commodity based on the relative number of regions to which the commodity is sold and the path trade intensity entropy, wherein the trade penetration level is positively correlated with both the relative number of regions to which the commodity is sold and the path trade intensity entropy.
[0068] As one embodiment, the specific method for calculating the degree of trade penetration is as follows:
[0069]
[0070] Where ρ represents the degree of trade penetration of the commodity; n represents the number of regions to which the commodity is sold; N represents the total number of regions; γ q The q-th trade path intensity represents the trade intensity of the commodity on the q-th trade path; Q represents the number of trade paths for the commodity; ln() represents the logarithmic function with the natural constant as the base.
[0071] It should be noted that the trade penetration of a commodity describes the breadth of its distribution across different regions in trade. A higher trade penetration indicates a wider distribution of the commodity domestically, signifying a greater degree of market penetration. The path trade intensity entropy is also relevant. By calculating information entropy to reflect the uniformity of trade intensity across all trade paths, the more uniform the distribution of trade intensity across all trade paths, the better the overall circulation efficiency of the commodity and the better its penetration effect on the sales market. This reflects the coverage of goods along trade routes. The wider the coverage, the higher the penetration of goods in the sales market, that is, the wider the sales area.
[0072] 3) Calculate the trade index of the commodity by using the relative trade penetration of any commodity with all competing commodities, and the distribution characteristics of the commodity's trade data in all sales regions.
[0073] For any commodity, the specific method for obtaining the commodity's trade indicators includes: recording the difference between the commodity's trade penetration level and the maximum trade penetration level among all competing products as the first difference; recording the ratio of the first difference to the mean of the commodity's and all competing products' trade penetration levels as the commodity's relative trade penetration rate; obtaining the average and standard deviation of the commodity's output, sales volume, and inventory in all sales regions; recording output, sales volume, and inventory as the commodity's performance factors; obtaining the ratio of the average and standard deviation of the commodity under any performance factor as the commodity's performance factor under the performance factor; obtaining the range of the commodity's performance factors under all performance factors as the commodity's trade performance balance; and obtaining the commodity's trade indicators based on the commodity's relative trade penetration rate and trade performance balance, wherein the trade indicators are positively correlated with the relative trade penetration rate and negatively correlated with the trade performance balance.
[0074] As one embodiment, the specific calculation method for the trade indicator is as follows:
[0075]
[0076] Where k∈{production, sales, inventory}, τ represents the trade indicators of the commodity; ρ represents the degree of trade penetration of the commodity; ρ' max This indicates the highest level of trade penetration among all competing products of a commodity. μ represents the mean of the trade penetration of the product and all competing products. k σ represents the average performance rate of a product across all regions where it is sold; k The standard deviation of the product's performance across all regions where it is sold is represented; sigmoid{} represents the sigmoid normalization function; exp[] represents the exponential function with the natural constant as the base; and r() represents the range function.
[0077] The performance rate is the percentage of a product's production (or sales volume, inventory) in the region where it is sold, relative to the production of that product and all its competitors.
[0078] It should be noted that trade indicators reflect the trade performance of goods in domestic trade circulation. A higher trade indicator value indicates better trade performance and popularity among most consumers, while a lower value indicates poorer trade performance. The relative trade penetration rate of a commodity, ρ-ρ' max This reflects the difference in trade penetration of a product relative to all its competitors. The greater the trade penetration of a product relative to its competitors, the better its market penetration effect, and the larger the corresponding difference. This is relative to the overall (i.e., the average trade penetration of the product and all its competitors). The higher the level of ); This represents the k-th performance factor of a product, describing the magnitude of its quantity distribution relative to competitors in terms of output, sales volume, and inventory. For example, in a certain region, the larger the output of a product compared to the output of all its competitors, the larger its corresponding proportion, i.e., the larger its performance rate, and thus the higher its relative output. Similarly, the larger the proportion of sales volume and inventory, the higher the corresponding relative sales volume and relative inventory. Furthermore, the larger the average and the smaller the standard deviation of a product's performance rate, the greater its trade advantage over competitors in terms of quantity under the corresponding factors (i.e., output, sales volume, and inventory), and the larger the corresponding performance factor. However, it's not always better to have a higher trade advantage relative to competitors for each element's performance factor. Instead, it's crucial to maintain a certain balance between production, sales, and inventory to avoid excessive differences. Therefore, through… The more balanced the trade performance of a commodity, that is, the smaller the range, the better. The larger the value, the higher the trade index of the commodity, and the better the trade performance of the commodity.
[0079] Thus, the trade indicators of the commodity are obtained through the above methods.
[0080] Step S003: Based on the relative size of the line widths of all edges in the same column of the initial Sankey diagram, calculate the line width coefficient of each edge in the initial Sankey diagram. Adjust the line width of each edge in the initial Sankey diagram using the line width coefficient and trade indicators to obtain the trade Sankey diagram.
[0081] It should be noted that when visualizing traded goods using the initial Sankey diagram, since the sales volume of traded goods varies in different regions, the sales volume in one region may be too small compared to the sales volume in other regions. This would result in the line width displayed in the Sankey diagram being too small, affecting the subsequent visualization of trade indicators of goods using the Sankey diagram. Therefore, it is necessary to perform line width mapping on the corresponding edges in the initial Sankey diagram that have too small a line width due to too small a sales volume in order to optimize the visualization effect of the initial Sankey diagram.
[0082] Specifically, in step S301, based on the relative size of the line widths of all edges in the same column in the initial Sankey graph, the line width coefficient of each edge in the initial Sankey graph is calculated.
[0083] The method for obtaining the line width coefficient of the edge is as follows: the line width of all edges in the same column is linearly normalized and added to a preset adjustment parameter to obtain the line width coefficient of each edge in the initial Sankey diagram.
[0084] As one embodiment, the specific calculation method for the line width coefficient of each edge in the initial Sankey graph is as follows:
[0085]
[0086] Where ω represents the edge width coefficient; e0 represents the edge width in the initial Sankey graph; e l,0 This indicates the line width of the l-th edge in the same column as the given edge; L indicates the number of edges in the same column as the given edge; and a indicates a preset adjustment parameter.
[0087] It should be noted that the adjustment parameters in this embodiment of the invention are used to manually adjust the subsequent visualization effect, and the adjustment parameter a is preset to 2 based on experience. The adjustment parameters can be adjusted according to the actual situation, and this embodiment of the invention does not make specific limitations.
[0088] It should be noted that a coefficient ω is calculated based on the relative position of each edge in the initial Sankey diagram and the corresponding line width. This coefficient adjusts the line width of each edge, ensuring that smaller trade flows are displayed more appropriately within the same column and preventing visual information loss due to excessively narrow line widths. By adjusting ω, it is ensured that edges within the same column do not lose their visibility due to excessive differences in line width. Furthermore, the added constant term 'a' controls the adjustment range of the line width, thereby optimizing the visual display according to actual needs.
[0089] Step S302: Combining the trade indicators of the goods and the line width coefficient of each edge in the initial Sankey graph, a nonlinear mapping is performed on the line width corresponding to the edge in the initial Sankey graph to obtain the trade Sankey graph.
[0090] First, for any edge in the initial Sankey graph, the line width of the edge in the initial Sankey graph is nonlinearly adjusted using trade indices and line width coefficients to obtain the adjusted line width of the edge.
[0091] The process of obtaining the adjusted line width of the edge includes: for any edge, taking the trade index of the commodity corresponding to the edge as the input of the logarithmic function to obtain the logarithmic factor of the edge, obtaining the product of the logarithmic factor and the line width coefficient of the edge, and adding it to the preset first parameter to obtain the adjustment coefficient of the edge.
[0092] As one embodiment, the specific calculation method for the adjusted line width of the edge is as follows:
[0093] e′=e0×[1+ω×ln(τ+1)]
[0094] Where e' represents the adjusted line width of the edge; e0 represents the line width of the edge in the initial Sankey graph; ω represents the line width coefficient of the edge; τ represents the trade index of the commodity corresponding to the edge; and ln() represents the logarithmic function with the natural constant as the base.
[0095] Then, the trade Sankey diagram with the line widths of each side adjusted is obtained.
[0096] It should be noted that by obtaining the adjustment coefficient 1+ω×ln(τ+1), a non-linear mapping of the edge width is achieved (using the logarithmic function) to adjust the edge width of the corresponding edge in the initial Sankey diagram. This can effectively adjust those goods with small sales volume but still important, so that they can get a more reasonable visual display in the Sankey diagram. In this way, the edge width has a non-linear relationship with the trade index, which can prevent goods with too small sales volume from completely losing their recognizability in the diagram. The logarithmic function is particularly suitable when there are large differences in trade volume, because it can effectively compress or expand values of different scales and maintain visual balance.
[0097] Thus, the Sankey diagram of trade was obtained through the above method.
[0098] Step S004: Visualize the Sankey diagram of trade and the trade indicators for each commodity.
[0099] Specifically, firstly, a Sankey diagram of trade is constructed using the adjusted line widths of the edges calculated above, where nodes represent goods and regions; node colors can map different dimensions (such as region, price range, etc.).
[0100] Then, use multi-layered separation areas to display structure, traffic, and metric dimensions; when the mouse hovers over a node or path, display: product category, sales volume, inventory, path trade intensity, and trade penetration.
[0101] Finally, the trade index for each commodity in the Sankey trade diagram is displayed next to it.
[0102] In addition, users can select specific products or time periods to dynamically refresh the Sankey diagram, and the chart is updated in real time, with indicators recalculated and displayed visually in sync.
[0103] By processing and analyzing the initial Sankey diagram, and combining path trade intensity and trade penetration to quantify commodity trade indicators, a comprehensive view of the circulation efficiency and market coverage of commodity trade can be achieved. The optimized Sankey diagram provides decision-makers with intuitive information on trade flows and indicators, thus offering effective support for modern economic governance and market resource optimization.
[0104] By following the steps above, the trade indicators for domestic goods can be visualized.
[0105] A trade indicator visualization system based on domestic trade commodity data includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the trade indicator visualization method based on domestic trade commodity data described in steps S001 to S004.
[0106] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0107] The memory can be volatile or non-volatile, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
[0108] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.
[0109] This embodiment *** (the beneficial effects are described once).
[0110] It should be noted that the exp(-x) model used in this embodiment is only used to represent negative correlation and constrain the output of the model to be within the (0,1) interval. In specific implementation, it can be replaced by other models with the same purpose. This embodiment only uses the exp(-x) model as an example for description and does not make specific limitations on it, where x refers to the input of the model.
[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for visualizing trade indicators based on domestic trade commodity data, characterized in that, The method comprises the following steps: Obtaining trade data and logistics data corresponding to a plurality of commodities and a plurality of competitive products of each commodity respectively; Constructing an initial Sankey diagram using the trade data and the logistics data of all the commodities, taking the circulation benefit corresponding to a trade path generated by any commodity in the trade flow process in the initial Sankey diagram as the path trade intensity of the commodity on the trade path, combining the path trade intensity of the commodity on all corresponding trade paths and the relative quantity of the commodity in the sales area to calculate the trade penetration degree of the commodity, and calculating the trade index of the commodity using the relative trade penetration degrees of any commodity and all competitive products and the distribution characteristics of the trade data of the commodity in all sales areas; Calculating a line width coefficient of each edge in the initial Sankey diagram based on the relative sizes of the line widths corresponding to all edges under the same column in the initial Sankey diagram, adjusting the line width of each edge in the initial Sankey diagram using the line width coefficient and the trade index, and obtaining a trade Sankey diagram; Visualizing the trade Sankey diagram and the trade index of each commodity; The method for obtaining the trade penetration degree of the commodity is that a ratio of the number of the sales area of the commodity to the number of all areas in the initial Sankey diagram is taken as the relative quantity of the sales area of the commodity, the information entropy of the path trade intensity of all trade paths of the commodity is taken as the path trade intensity entropy of the commodity, and the trade penetration degree of the commodity is obtained according to the relative quantity of the sales area of the commodity and the path trade intensity entropy, wherein the trade penetration degree is positively correlated with the relative quantity of the sales area and the path trade intensity entropy; The method for adjusting the line width of each edge in the initial Sankey diagram using the line width coefficient and the trade index to obtain the trade Sankey diagram is that for any edge in the initial Sankey diagram, an adjustment coefficient of the edge is obtained according to the line width coefficient and the trade index of the edge, the line width corresponding to the edge in the initial Sankey diagram is adjusted using the adjustment coefficient, and the adjusted line width of the edge is obtained. The method for obtaining the adjustment coefficient is that for any edge, the trade index of the commodity corresponding to the edge is taken as the input of a logarithmic function to obtain a logarithmic factor of the edge, the product of the logarithmic factor and the line width coefficient of the edge is obtained, a first preset parameter is added, and the adjustment coefficient of the edge is obtained.
2. The method of visualizing trade indicators based on domestic trade commodity data according to claim 1, wherein, The specific method for constructing the initial Sankey diagram using the trade data and the logistics data of all the commodities comprises the following steps: The Sankey diagram is constructed according to the horizontal distribution direction from left to right, the category of the commodity is taken as the node in the first column of the Sankey diagram, the areas are divided into sales levels according to the sizes of the areas, the larger the area, the higher the sales level and the farther the distance from the retail market end, and the sales volume of the commodity in the corresponding area is taken as the flow of the edge corresponding to the nodes between different columns.
3. The method of claim 2, wherein, The specific method for taking the circulation benefit corresponding to the trade path generated by any commodity in the trade flow process in the initial Sankey diagram as the path trade intensity of the commodity on the trade path comprises the following steps: Obtaining a plurality of trade paths of any commodity; For any commodity and any trade path, the path trade intensity of the commodity on the trade path is calculated according to the flow, price and delivery speed corresponding to the edges included in the trade path.
4. The method of claim 3, wherein, The specific method for obtaining the path trade intensity is as follows: The product of the flow and the price of any edge in the trade path of the commodity is obtained, which is recorded as the contribution factor of the edge, and the cumulative value of the contribution factors of all edges in the trade path of the commodity is recorded as the total contribution factor of the trade path; the ratio of the distance between the two regional nodes corresponding to each edge in the trade path to the delivery time is recorded as the delivery speed of the edge, the average value of the delivery speeds of all edges in the trade path is recorded as the average delivery speed of the trade path, and the path trade intensity of the commodity on the trade path is obtained based on the average delivery speed and the total contribution factor of the commodity on the trade path, and the path trade intensity is positively correlated with the average delivery speed and the total contribution factor.
5. The method of visualizing trade indicators based on domestic trade commodity data according to claim 1, wherein, The specific method for calculating the trade index of the commodity based on the relative trade penetration degree of the commodity and all competitors and the distribution characteristics of the trade data of the commodity in all sales regions is as follows: The difference between the trade penetration degree of the commodity and the maximum trade penetration degree among all competitors of the commodity is recorded as a first difference, and the ratio of the first difference to the average of the trade penetration degrees of the commodity and all competitors is recorded as the trade relative penetration rate of the commodity; the average value and the standard deviation of the yield, the sales volume and the inventory of the commodity in all sales regions are obtained respectively, and the yield, the sales volume and the inventory are recorded as the performance factors of the commodity, the ratio of the average value to the standard deviation of the commodity under any performance factor is obtained and recorded as the performance factor of the commodity under the performance factor, and the range of the performance factors of the commodity under all performance factors is obtained and recorded as the trade performance balance degree of the commodity; the trade index of the commodity is obtained according to the trade relative penetration rate and the trade performance balance degree of the commodity, and the trade index is positively correlated with the trade relative penetration rate and negatively correlated with the trade performance balance degree.
6. The method of visualizing trade indicators based on domestic trade commodity data according to claim 1, wherein, The specific method for calculating the line width coefficient of each edge in the initial Sankey diagram based on the relative size of the line width of all edges under the same column in the initial Sankey diagram is as follows: The line widths of all edges under the same column are linearly normalized and added to a preset adjustment parameter to obtain the line width coefficient of each edge in the initial Sankey diagram. 7.A trade indicator visualization system based on domestic trade commodity data, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the trade index visualization method based on domestic trade commodity data according to any one of claims 1-6.
Citation Information
Patent Citations
Interaction processing method and device based on mulberry-based graph and medium
CN118568313A
Market analysis visualization method for import commodity supervision
CN119180668A