A graphical layout method, system, device and storage medium
Patent Information
- Application Number
- CN202410947589.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2044-07-15
AI Technical Summary
而这些方式,在渲染方面表现优秀,但布局算法的性能和跨平台兼容性较差,导致页面交互阻塞,在跨平台场景中需要额外的适配工作,且布局算法在不同设备上的表现也可能存在差异,需要针对性优化
[0039]根据本申请实施例的第四方面,提供了一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现上述第一方面所述的方法。
Smart Images

Figure CN121350309B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically to a graphical layout method, system, device, and storage medium. Background Technology
[0002] In the field of information science, graph-based visualization analysis is widely used, especially in the analysis of complex networks such as social networks.
[0003] Existing technologies employ various front-end graph visualization engines, primarily utilizing front-end technologies for graph model layout algorithm calculation and rendering. While these methods excel in rendering, their layout algorithm performance and cross-platform compatibility are poor, leading to page interaction blockage. Additional adaptation work is required in cross-platform scenarios, and the performance of layout algorithms may vary across different devices, necessitating targeted optimization. Summary of the Invention
[0004] The main objective of this invention is to provide a graphical layout method, system, device, and storage medium that offloads computationally intensive graphical layout tasks to the server, thereby reducing the computational burden on terminal devices, especially those with limited resources. The server customizes the graphical layout based on the terminal device's parameters, and a unified algorithm ensures layout consistency across different devices and scenarios.
[0005] To achieve the above objectives, the embodiments of this application provide the following technical solutions:
[0006] According to a first aspect of the embodiments of this application, a graphical layout method is provided, the method comprising:
[0007] The server receives a graphic layout request sent by the terminal device, the graphic layout request carrying business configuration parameters and graphic adjustment parameters;
[0008] Determine the target business structure data based on the aforementioned business configuration parameters;
[0009] The deployment coordinates of the graphic are calculated based on the target business structure data and the graphic calibration parameters;
[0010] The deployment coordinates of the graphic are sent to the terminal device so that the terminal device can render the graphic using the deployment coordinates and obtain the graphic layout result.
[0011] Optionally, before determining the target service structure data based on the service configuration parameters, the method includes:
[0012] Determine whether there are deployment coordinates in the business database that correspond to the business configuration parameters and the graphics calibration parameters;
[0013] If so, obtain the deployment coordinates and return them to the terminal device.
[0014] Optionally, determining whether there are deployment coordinates in the business database corresponding to the business configuration parameters and the graphics calibration parameters includes:
[0015] The cache key is calculated using a hash function based on the business configuration parameters and the graphics tuning parameters.
[0016] The deployment coordinates corresponding to the cache key are retrieved from the cached mapping relationship in the business database, where the mapping relationship is the correspondence between cache keys and deployment coordinates.
[0017] Optionally, the business configuration parameters include configuration parameters for each node of the graph, and the calculation of the deployment coordinates of the graph based on the target business structure data and the graph calibration parameters includes:
[0018] The social network model is invoked to calculate the clustering coefficients and node attribute values among the nodes in the business configuration parameters, which are used as the target business structure data.
[0019] The graph algorithm engine is invoked to calculate the deployment coordinates of the graph based on the clustering coefficients between the nodes, the node attribute values, and the graph tuning parameters. The deployment coordinates of the graph represent the position of each node in the target business structure data within the graph layout.
[0020] Optionally, the step of calling the graphics algorithm engine to calculate the deployment coordinates of the graphics based on the clustering coefficients between the nodes, the node attribute values, and the graphics tuning parameters includes:
[0021] Determine the coordinates to be adjusted for each node in the graph;
[0022] Calculate the similarity and connection strength between each node based on the node attribute values and the coordinates to be adjusted in the graph.
[0023] Calculate the repulsive and attractive forces between nodes based on the similarity and clustering coefficients between them;
[0024] If the repulsive and attractive forces between the nodes meet the preset conditions, the coordinates to be adjusted of the nodes are determined as the deployment coordinates;
[0025] If the repulsive and attractive forces between the nodes do not meet the preset conditions, adjust the repulsive and attractive forces between the nodes according to the graphic adjustment parameters;
[0026] The coordinates of each node are updated based on the adjusted repulsive and attractive forces between the nodes to obtain new coordinates to be adjusted. The steps of calculating the similarity and connection strength between each node based on the node attribute values of each node in the graph and the coordinates to be adjusted are repeated.
[0027] Optionally, after the server receives the graphic layout request sent by the terminal device, the method further includes:
[0028] Extract the identity identifier of the terminal device from the graphical layout request;
[0029] Verify the access token signing permissions, expiration time, and whether the identity identifier is associated with the requested resource;
[0030] If the verification result is successful, extract the business configuration parameters and the graphics calibration parameters.
[0031] Optionally, after calculating the deployment coordinates of the graphic based on the target business structure data and the graphic calibration parameters, the method further includes:
[0032] The mapping relationship between the deployment coordinates of the graphic, the graphic calibration parameters, and the business configuration parameters is stored in the business database.
[0033] According to a second aspect of the embodiments of this application, a graphical layout system is provided, the system comprising:
[0034] The data receiving module is used for the server to receive a graphic layout request sent by the terminal device. The graphic layout request carries business configuration parameters and graphic adjustment parameters.
[0035] The business structure data analysis module is used to determine the target business structure data based on the business configuration parameters.
[0036] The layout coordinate calculation module is used to calculate the deployment coordinates of the graphic based on the target business structure data and the graphic adjustment parameters;
[0037] The data sending module is used to send the deployment coordinates of the graphic layout to the terminal device, so that the terminal device can render the graphic using the deployment coordinates and obtain the graphic layout result.
[0038] According to a third aspect of the present application, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.
[0039] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided having computer-readable instructions stored thereon, the computer-readable instructions being executable by a processor to implement the method described in the first aspect above.
[0040] In summary, this application provides a graphical layout method, system, device, and storage medium. The method involves a server receiving a graphical layout request from a terminal device, the request carrying business configuration parameters and graphical calibration parameters. Target business structure data is determined based on the business configuration parameters. Deployment coordinates of the graphical representation are calculated based on the target business structure data and the graphical calibration parameters. These deployment coordinates are then sent to the terminal device, enabling the terminal device to render the graphical layout using these coordinates. By processing the computationally intensive graphical layout task on the server side, the computational burden on the terminal device can be reduced, especially on resource-constrained devices. Furthermore, the server-side customization of the graphical layout based on the terminal device's parameters ensures layout consistency across different devices and scenarios through a unified algorithm. Attached Figure Description
[0041] 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 the structures shown in these drawings without creative effort.
[0042] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0043] Figure 1 This is a schematic flowchart of a graphic layout method provided in an embodiment of this application;
[0044] Figure 2 This is a general flowchart of the graphic layout method provided in the embodiments of this application;
[0045] Figure 3 A detailed flowchart of reading user service data provided in this application embodiment;
[0046] Figure 4 A block diagram of a graphical layout system provided in this application embodiment;
[0047] Figure 5 This paper shows a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0048] Figure 6 A schematic diagram of a computer-readable storage medium provided in an embodiment of this application is shown.
[0049] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0051] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0052] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0053] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0054] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0055] Figure 1 This application illustrates a graphical layout method provided by an embodiment of the present application, the method comprising:
[0056] Step 101: The server receives a graphic layout request sent by the terminal device, the graphic layout request carrying service configuration parameters and graphic adjustment parameters;
[0057] Step 102: Determine the target service structure data based on the service configuration parameters;
[0058] Step 103: Calculate the deployment coordinates of the graphic based on the target business structure data and the graphic calibration parameters;
[0059] Step 104: Send the deployment coordinates of the graphic to the terminal device so that the terminal device can render the graphic using the deployment coordinates and obtain the graphic layout result.
[0060] The terminal device sends a graphic layout request to the server. This request includes at least two key parameters: business configuration parameters and graphic adjustment parameters. The business configuration parameters define the business logic or functional requirements of the user interface, while the graphic adjustment parameters relate to visual attributes such as the style, size, and color of the graphics. Upon receiving the request, the server determines the target business structure data based on the business configuration parameters. This involves parsing the request, querying the database, or calling other services to obtain necessary data. Further, the server uses the target business structure data and the graphic adjustment parameters to calculate the deployment coordinates of the graphics. The server then sends the calculated deployment coordinates back to the terminal device. The terminal device renders the graphics based on these coordinates, and the end user sees the customized graphic layout result based on the request.
[0061] In one possible implementation, after the server receives the graphic layout request sent by the terminal device in step 101, the method further includes:
[0062] Extract the terminal device's identity identifier from the graphic layout request; verify the access token signing permissions, expiration time, and whether the identity identifier is associated with the requested resource; if the verification result is successful, extract the service configuration parameters and the graphic tuning parameters.
[0063] After receiving the graphics layout request from the terminal device, the server also provides crucial security and verification steps. First, the server extracts the terminal device's identity identifier from the request and verifies the access token associated with that identifier. Specifically, this may include: checking whether the token was issued by an authorized signer, ensuring the token is valid, verifying whether the token is associated with the requested resource, and ensuring the requester has the right to access the requested resource. If the access token verification passes, the server will extract business configuration parameters and graphics calibration parameters. These parameters will be used for subsequent graphics layout calculations.
[0064] By verifying access tokens, the server can ensure that only authorized terminal devices can request the graphical layout, thus preventing unauthorized access and potential security risks. This also ensures the legitimacy of the request and the proper allocation of resources.
[0065] In one possible implementation, before step 102 determines the target service structure data based on the service configuration parameters, the method includes:
[0066] Determine whether there are deployment coordinates in the business database that correspond to the business configuration parameters and the graphics calibration parameters; if so, obtain the deployment coordinates and return them to the terminal device.
[0067] In one possible implementation, determining whether there are deployment coordinates in the business database corresponding to the business configuration parameters and the graphics calibration parameters includes:
[0068] The cache key is calculated using a hash function based on the business configuration parameters and the graphics calibration parameters; the deployment coordinates corresponding to the cache key are retrieved from the cached mapping relationship in the business database, where the mapping relationship is the correspondence between the cache key and the deployment coordinates.
[0069] Before determining the target business structure data, the server needs to check the cache before querying the database to improve efficiency and reduce computing resource consumption, ensuring that pre-calculated deployment coordinates corresponding to these parameters exist. Once the deployment coordinates are retrieved from the cache, the server returns them to the terminal device. This allows the terminal device to use these coordinates to render graphics without requiring the server to recalculate them.
[0070] Specifically, the server calculates a unique cache key using a hash function based on the received business configuration parameters and graphics calibration parameters. A hash function transforms the input into a fixed-length output, typically used for fast lookups and data indexing. The calculated cache key is then used to retrieve data from the cached mapping relationships in the business database. This mapping relationship corresponds to the cache key and deployment coordinates. If the corresponding deployment coordinates are found, the server directly retrieves them.
[0071] By caching calculated deployment coordinates, redundant calculations can be avoided, thereby improving response speed and system efficiency. This reduces the demand for computing resources because the same combination of parameters will retrieve results directly from the cache instead of being recalculated each time.
[0072] In one possible implementation, the service configuration parameters include configuration parameters for each node of the graph. In step 103, calculating the deployment coordinates of the graph based on the target service structure data and the graph calibration parameters includes:
[0073] The social network model is invoked to calculate the clustering coefficients and node attribute values among the nodes in the business configuration parameters, which are used as the target business structure data. The graph algorithm engine is invoked to calculate the deployment coordinates of the graph based on the clustering coefficients, node attribute values, and graph tuning parameters. The deployment coordinates of the graph represent the position of each node in the target business structure data in the graph layout.
[0074] In one possible implementation, the step of calling the graphics algorithm engine to calculate the deployment coordinates of the graphics based on the clustering coefficients between the nodes, the node attribute values, and the graphics tuning parameters includes:
[0075] The process involves: determining the coordinates to be adjusted for each node in the graph; calculating the similarity (or distance) and connection strength (e.g., edge weight) between each node based on its node attribute values (e.g., importance or centrality) and the coordinates to be adjusted; calculating the repulsive and attractive forces between nodes based on their similarity and clustering coefficients; determining the coordinates to be adjusted for each node as the deployment coordinates if the repulsive and attractive forces meet preset conditions; adjusting the repulsive and attractive forces between nodes based on graph adjustment parameters (e.g., layout compactness, node spacing); updating the coordinates of each node based on the adjusted repulsive and attractive forces to obtain new coordinates to be adjusted, and repeating the steps of calculating the similarity and connection strength between each node based on its node attribute values and the coordinates to be adjusted.
[0076] The preset conditions are set by the user based on specific business logic or display requirements. For example, the system can be considered stable when the repulsive and attractive forces between nodes reach a certain equilibrium, meaning there are no longer significant changes. Alternatively, the preset condition can be to stop iteration when the number of iterations reaches a certain upper limit to avoid excessive computation time.
[0077] The server first invokes a social network model to calculate the clustering coefficients and node attribute values among the nodes in the business configuration parameters. This data will serve as the target business structure data for subsequent graph layout calculations. Further, the server invokes a graph algorithm engine to calculate the graph's deployment coordinates based on the clustering coefficients, node attribute values, and graph tuning parameters. These deployment coordinates will characterize the position of each node in the target business structure data within the graph layout.
[0078] There are many methods for graphics algorithm engines to calculate the deployment coordinates of graphics, and this application describes one of them in detail in its embodiments.
[0079] The graphics algorithm engine first determines the initial coordinates to be adjusted for each node in the graph. Then, based on the node attribute values and the coordinates to be adjusted, it calculates the similarity and connection strength between each node. Similarity may be based on the similarity of node attributes, while connection strength may be based on the strength of links or the frequency of interactions between nodes. Based on the similarity and clustering coefficient, it calculates the repulsive and attractive forces between nodes. Repulsive forces are typically used to prevent nodes from becoming too crowded, while attractive forces are used to attract similar or related nodes together. Further, it determines whether the repulsive and attractive forces meet preset conditions; if the calculated results satisfy the preset conditions (e.g., reaching a balanced state or meeting specific layout requirements), the current coordinates to be adjusted are determined as the final deployment coordinates. If the preset conditions are not met, the repulsive and attractive forces are adjusted according to the graphics calibration parameters to optimize the layout effect.
[0080] The coordinates of each node are updated based on the adjusted repulsive and attractive forces to obtain new coordinates to be adjusted. Using these new coordinates, the steps of calculating similarity and connection strength are repeated until preset conditions are met or the algorithm's iteration limit is reached. The algorithm can dynamically adjust the layout based on node attributes and relationships to adapt to different business needs and user preferences.
[0081] In graphics algorithms, randomness may be introduced to make the generated graphics smoother and more aesthetically pleasing. However, this randomness can lead to differences in the graphics generated each time, which can introduce uncertainty in applications requiring precise decision-making. To address the inconsistency issue caused by algorithmic randomness, this application introduces a caching mechanism. With unchanged data parameters, the graphics results are stored in a database. When the same data parameters are requested again for graphics generation, the result can be retrieved directly from the database without recalculation. This caching mechanism avoids slight coordinate deviations in each generated graphic due to algorithmic randomness, ensuring consistency of graphics results under the same business data.
[0082] In one possible implementation, after step 103, where the deployment coordinates of the graphic are calculated based on the target business structure data and the graphic calibration parameters, the method further includes:
[0083] The mapping relationship between the deployment coordinates of the graphic, the graphic calibration parameters, and the business configuration parameters is stored in the business database.
[0084] By storing these mapping relationships, when the server receives the same business configuration parameters and graphics calibration parameters in the future, it can directly retrieve the corresponding deployment coordinates from the database without recalculating, thereby improving response speed and efficiency.
[0085] The graphic layout method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0086] The graphic layout method provided in this application deploys the algorithm directly on the backend, uniformly handling layout calculation services for different frontend devices, platforms, and browsers, thus eliminating compatibility issues. Users call the service via API, passing in extraction parameters for business data and graphic adjustment parameters. The server retrieves the corresponding business data based on the provided parameters. Using the retrieved business data and graphic condition parameters, the algorithm executes, calculating the relationships between nodes based on the information in the business data and determining their coordinate positions on the graphic.
[0087] Figure 2 The overall flow of the graphical layout method provided in the embodiments of this application is shown, and the applicable system includes the front-end presentation layer and business services.
[0088] The front-end presentation layer is used to display the user interface and the parts that interact with the user. Performance differences between different devices require the front-end presentation layer to adapt to these differences, ensuring the user interface runs smoothly on various devices. This includes devices with varying performance levels, PC browsers, mobile devices, and low-end devices. Low-end devices specifically refer to devices with less powerful hardware, such as those with single-core versus multi-core CPUs. The business service refers to the back-end server, responsible for handling business logic, providing data, and functionality. The server reads business data from databases or other storage to support the front-end presentation layer. The overall process of the graphical layout method includes the following steps:
[0089] Step 1: Responding to a graphical layout request sent by the user from the terminal device, the graphical layout request carries service configuration parameters and graphical adjustment parameters;
[0090] Step 2: The server uses the access token to verify the user's identity. If the verification result is successful, the business configuration parameters and the graphics calibration parameters are extracted.
[0091] Step 3: Determine if there are deployment coordinates in the business database that correspond to the business configuration parameters and the graphics calibration parameters; if so, proceed to step 4; if not, proceed to step 5.
[0092] Step 4: Obtain the deployment coordinates and return them to the terminal device.
[0093] Step 5: If there is no cached layout data, determine the target business structure data based on the business configuration parameters, and calculate the deployment coordinates of the graphic based on the target business structure data and the graphic calibration parameters. The server will use WebAssembly (WASM) code to calculate the layout.
[0094] Step 6: The server returns the calculated or cached layout data to the terminal device, so that the terminal device can render the graphics using the deployment coordinates and obtain the graphic layout result.
[0095] After step 6, the method further includes storing the mapping relationship between the deployment coordinates of the graphic, the graphic calibration parameters, and the business configuration parameters in the business database.
[0096] In step 2, a cache key is calculated using a hash function based on the business configuration parameters and the graphics calibration parameters; the deployment coordinates corresponding to the cache key are retrieved from the cached mapping relationship in the business database, where the mapping relationship is the correspondence between cache keys and deployment coordinates.
[0097] In this graphical layout method, the user first sends a request from the terminal device carrying business configuration parameters and graphical calibration parameters. The server verifies the user's identity using an accessToken, and extracts the relevant parameters upon successful verification. Next, the server checks the business database to see if deployment coordinates corresponding to these parameters exist. If they exist, the server directly retrieves and returns these coordinates; otherwise, the server uses WebAssembly code to calculate the new deployment coordinates. After calculation, the server returns the layout data to the terminal device for graphical rendering. Furthermore, the server stores the mapping relationship between deployment coordinates and business configuration and graphical calibration parameters in the database to optimize future request processing. During authentication, the server also uses a hash function to generate a cache key based on the business configuration and graphical calibration parameters and searches the database for possible cached deployment coordinates.
[0098] This application uses Rust and other programming languages suitable for CPU-intensive tasks (such as Go and C++) to write code that can be compiled into WebAssembly (Wasm). After Rust is compiled into Wasm, it can leverage Rust's high-performance characteristics while running at near-native speed in a web environment. Directly deploying Rust requires consideration of compilers, library dependencies, and runtime environments on different platforms; using Wasm as an intermediate format hides these complexities and simplifies the deployment process. As part of the web standard, Wasm can leverage existing web technologies such as JavaScript, HTML5, and CSS, as well as other web APIs, to provide rich functionality and a better user experience. By compiling Rust into Wasm, high-performance, secure, cross-platform, and easy-to-deploy web applications and services can be created.
[0099] Figure 3 The specific process for reading user business data is shown, including:
[0100] Step 1: The user initiates a request through the interface, which includes graphConfig (graph configuration) and dataFilter (data filtering conditions).
[0101] Step 2: Using graphConfig and dataFilter as input, generate a cache key using the hash function hash(graphConfig, dataFilter).
[0102] Step 3: Use the generated cacheKey to search the database for corresponding cached data. If cached data is found, the process ends. If no cached data is found, proceed to Step 4.
[0103] Step 4: Use dataFilter as the filtering condition to obtain raw data from the big data source.
[0104] Step 5: Use the genericFruchtermanLayout algorithm to perform graphical layout calculations on the acquired data and return the calculation results.
[0105] Step 6: Store the calculation results in the database so that they can be quickly retrieved on the next request.
[0106] A highly efficient caching mechanism is implemented by generating cache keys using a hash function and retrieving and storing layout data in the database. This ensures consistency in rendering results for the same data each time, reduces redundant calculations, and improves performance. The caching mechanism guarantees that the social network graph layout seen by the user is consistent every time the data remains unchanged, while also supporting rapid updates and recalculations of real-time data.
[0107] The backend service call process involves authentication, data acquisition, and algorithm processing, with the ultimate goal of calculating and returning the rendering position of the graphics so that the frontend can render the graphics accordingly. AccessToken is used to ensure the security of the service call, while the graphics algorithm engine is responsible for the specific calculation tasks. The following is a summary of the entire process:
[0108] Step 1: The user first needs to obtain an accessToken, which is used to verify identity and access rights.
[0109] Step 2: The user uses the obtained accessToken to initiate a request through the general service interface.
[0110] Step 3: General Service Processing: After receiving the request, the server begins processing it. API Service / getLayoutNode: The request is routed to the API service at the / getLayoutNode path, which performs the following steps:
[0111] Step 3-1: Obtain the extraction address of cloud business data and the user's identity identifier.
[0112] Step 3-2: Based on the data extraction parameters provided by the user, call the data extraction address to obtain the required business data.
[0113] Step 3-3: Initialize the graphics algorithm engine to prepare for the calculation of the graphics layout.
[0114] Steps 3-4: Pass the acquired business data and graphics calibration parameters to the graphics algorithm engine. The engine calculates the final rendering position of the graphics based on these inputs.
[0115] Steps 3-5: After the calculation is complete, the service returns the result of the graphics rendering position to the caller.
[0116] Compared with visualization technologies in the front-end presentation layer, this solution places computationally intensive layout calculation tasks on the server side, avoiding front-end rendering stuttering or calculation failures caused by differences in device performance.
[0117] In summary, this application provides a graphical layout method. A server receives a graphical layout request from a terminal device, the request carrying business configuration parameters and graphical calibration parameters. Target business structure data is determined based on the business configuration parameters. Deployment coordinates of the graphical representation are calculated based on the target business structure data and the graphical calibration parameters. The deployment coordinates are then sent to the terminal device, enabling the terminal device to render the graphical representation and obtain a graphical layout result. By processing the computationally intensive graphical layout task on the server side, the computational burden on the terminal device can be reduced, especially on resource-constrained devices. Customizing the graphical layout based on the terminal device's parameters via the server, and ensuring layout consistency across different devices and scenarios through a unified algorithm, this method achieves the desired results.
[0118] Based on the same technical concept, embodiments of this application also provide a graphical layout system, such as... Figure 4 As shown, the system includes:
[0119] Data receiving module 401 is used for receiving a graphic layout request sent by a terminal device on the server side. The graphic layout request carries business configuration parameters and graphic adjustment parameters.
[0120] The business structure data analysis module 402 is used to determine the target business structure data based on the business configuration parameters.
[0121] The layout coordinate calculation module 403 is used to calculate the deployment coordinates of the graphic based on the target business structure data and the graphic adjustment parameters;
[0122] Data sending module 404 is used to send the deployment coordinates of the graphic layout to the terminal device, so that the terminal device can render the graphic using the deployment coordinates and obtain the graphic layout result.
[0123] This application also provides an electronic device corresponding to the method provided in the foregoing embodiments. Please refer to... Figure 5 The diagram illustrates an electronic device provided by some embodiments of this application. The electronic device 20 may include: a processor 200, a memory 201, a bus 202, and a communication interface 203, wherein the processor 200, the communication interface 203, and the memory 201 are connected via the bus 202; the memory 201 stores a computer program that can run on the processor 200, and when the processor 200 runs the computer program, it executes the method provided by any of the foregoing embodiments of this application.
[0124] The memory 201 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one physical port (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0125] Bus 202 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 201 is used to store programs. After receiving an execution instruction, the processor 200 executes the program. The method disclosed in any of the foregoing embodiments of this application can be applied to the processor 200, or implemented by the processor 200.
[0126] The processor 200 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 200 or by instructions in software form. The processor 200 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 201. The processor 200 reads the information in memory 201 and, in conjunction with its hardware, completes the steps of the above method.
[0127] The electronic devices and methods provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods they employ, operate, or implement.
[0128] This application also provides a computer-readable storage medium corresponding to the method provided in the foregoing embodiments. Please refer to... Figure 6The computer-readable storage medium shown is an optical disc 30, on which a computer program (i.e., a program product) is stored, which, when run by a processor, executes the methods provided in any of the foregoing embodiments.
[0129] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0130] The computer-readable storage medium provided in the above embodiments of this application and the method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0131] It should be noted that:
[0132] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used in conjunction with the teachings herein. The required structure for constructing such devices is apparent from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0133] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0134] Similarly, it should be understood that, in order to simplify this application and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0135] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0136] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0137] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the virtual machine creation apparatus according to embodiments of this application. This application can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0138] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0139] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0140] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made under the concept of the present invention using the contents of the present invention specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A graphic layout method, characterized in that, The method includes: The server receives a graphic layout request sent by the terminal device, the graphic layout request carrying business configuration parameters and graphic adjustment parameters; Determine the target business structure data based on the aforementioned business configuration parameters; The deployment coordinates of the graphic are calculated based on the target business structure data and the graphic calibration parameters; The deployment coordinates of the graphic are sent to the terminal device so that the terminal device can render the graphic using the deployment coordinates and obtain the graphic layout result; The business configuration parameters include the configuration parameters of each node in the graph. The calculation of the deployment coordinates of the graph based on the target business structure data and the graph calibration parameters includes: The social network model is invoked to calculate the clustering coefficients and node attribute values among the nodes in the business configuration parameters, which are used as the target business structure data. Determine the coordinates to be adjusted for each node in the graph; Calculate the similarity and connection strength between each node based on the node attribute values and the coordinates to be adjusted in the graph. Calculate the repulsive and attractive forces between nodes based on the similarity and clustering coefficients between them; If the repulsive and attractive forces between the nodes meet the preset conditions, the coordinates to be adjusted of the nodes are determined as the deployment coordinates. The deployment coordinates of the graph represent the position of each node in the target business structure data in the graph layout. If the repulsive and attractive forces between the nodes do not meet the preset conditions, adjust the repulsive and attractive forces between the nodes according to the graphic adjustment parameters; The coordinates of each node are updated based on the adjusted repulsive and attractive forces between the nodes to obtain new coordinates to be adjusted. The steps of calculating the similarity and connection strength between each node based on the node attribute values of each node in the graph and the coordinates to be adjusted are repeated.
2. The method as described in claim 1, characterized in that, Before determining the target business structure data based on the business configuration parameters, the method includes: Determine whether there are deployment coordinates in the business database that correspond to the business configuration parameters and the graphics calibration parameters; If so, obtain the deployment coordinates and return them to the terminal device.
3. The method as described in claim 2, characterized in that, Determining whether there are deployment coordinates in the business database corresponding to the business configuration parameters and the graphics calibration parameters includes: The cache key is calculated using a hash function based on the business configuration parameters and the graphics tuning parameters. The deployment coordinates corresponding to the cache key are retrieved from the cached mapping relationship in the business database, where the mapping relationship is the correspondence between cache keys and deployment coordinates.
4. The method as described in claim 1, characterized in that, After the server receives the graphic layout request sent by the terminal device, the method further includes: Extract the identity identifier of the terminal device from the graphical layout request; Verify the access token signing permissions, expiration time, and whether the identity identifier is associated with the requested resource; If the verification result is successful, extract the business configuration parameters and the graphics calibration parameters.
5. The method as described in claim 1, characterized in that, After calculating the deployment coordinates of the graphic based on the target business structure data and the graphic calibration parameters, the method further includes: The mapping relationship between the deployment coordinates of the graphic, the graphic calibration parameters, and the business configuration parameters is stored in the business database.
6. A graphical layout system, characterized in that, The system includes: The data receiving module is used for the server to receive a graphic layout request sent by the terminal device. The graphic layout request carries business configuration parameters and graphic adjustment parameters. The business structure data analysis module is used to determine the target business structure data based on the business configuration parameters. The layout coordinate calculation module is used to calculate the deployment coordinates of the graphic based on the target business structure data and the graphic adjustment parameters; The data sending module is used to send the deployment coordinates of the graphic layout to the terminal device, so that the terminal device can render the graphic using the deployment coordinates and obtain the graphic layout result; The business configuration parameters include the configuration parameters of each node in the graph. The layout coordinate calculation module is specifically used for: The social network model is invoked to calculate the clustering coefficients and node attribute values among the nodes in the business configuration parameters, which are used as the target business structure data. Determine the coordinates to be adjusted for each node in the graph; Calculate the similarity and connection strength between each node based on the node attribute values and the coordinates to be adjusted in the graph. Calculate the repulsive and attractive forces between nodes based on the similarity and clustering coefficients between them; If the repulsive and attractive forces between the nodes meet the preset conditions, the coordinates to be adjusted of the nodes are determined as the deployment coordinates. The deployment coordinates of the graph represent the position of each node in the target business structure data in the graph layout. If the repulsive and attractive forces between the nodes do not meet the preset conditions, adjust the repulsive and attractive forces between the nodes according to the graphic adjustment parameters; The coordinates of each node are updated based on the adjusted repulsive and attractive forces between the nodes to obtain new coordinates to be adjusted. The steps of calculating the similarity and connection strength between each node based on the node attribute values of each node in the graph and the coordinates to be adjusted are repeated.
7. An electronic device, 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 implement the method as claimed in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that can be executed by a processor to implement the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Image layout implementation method and system, terminal equipment and storage medium
CN111061921A
Image rendering method and device of cloud game, electronic equipment and storage medium
CN114904274A
