Page display method and device, computer device, and storage medium
By constructing a backend computing process and task triggers, the calculation results are automatically pushed to the webpage frontend, solving the problem that traditional webpage display relies on user operation, and achieving more efficient data display and a better user experience.
Patent Information
- Application Number
- CN202110441402.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-23
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2041-04-23
AI Technical Summary
Traditional webpage display methods rely on manual user operation, which makes it impossible to obtain updated target data in a timely manner, thus affecting display efficiency.
By obtaining the data identifiers and task triggering conditions from the webpage front end, the backend calculation process is constructed and task triggers are generated. The calculation process is automatically executed and the calculation results are pushed to the webpage front end, avoiding waiting for user operation.
It improves the real-time performance and display efficiency of web page data, avoids web page display lag and delay, and enhances user experience.
Smart Images

Figure CN113221039B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a page display method, apparatus, computer device, and storage medium. Background Technology
[0002] With the development of computer technology, information is usually displayed through web pages. In the traditional method, users need to manually trigger the web page to request the required target data from the server. The server will then return the corresponding target data to the web page for presentation as a web page.
[0003] In this way, the content displayed on the webpage depends on user actions. If the user does not manually trigger the corresponding action, the target data cannot be obtained in a timely manner, thus affecting the efficiency of displaying the target page. For example, if the target data is updated, but the user does not manually trigger a refresh operation, the updated target data cannot be obtained in a timely manner, and therefore the updated target webpage cannot be displayed in a timely manner. Summary of the Invention
[0004] Therefore, it is necessary to provide a page display method, apparatus, computer equipment, and storage medium that can improve efficiency in response to the above-mentioned technical problems.
[0005] A method for displaying a webpage, the method comprising:
[0006] Obtain the data identifier and corresponding task triggering conditions sent by the webpage frontend;
[0007] Construct a backend computing process corresponding to the data identifier;
[0008] Generate a corresponding task trigger based on the task triggering conditions;
[0009] The task trigger is used to execute the backend calculation process, so as to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process and obtain the calculation result.
[0010] Based on a pre-established network connection with the webpage front-end, the calculation result is sent to the webpage front-end so that the webpage front-end can display the webpage based on the calculation result.
[0011] In one embodiment, constructing a backend computing process corresponding to the data identifier includes:
[0012] Find the data operator and target data corresponding to the data identifier;
[0013] Based on a preset display format, the data operators and the target data are combined to obtain the backend calculation process that matches the preset display format.
[0014] In one embodiment, the method further includes:
[0015] The task trigger, the backend calculation process, and the sending event are combined to form a task;
[0016] The process of triggering the execution of the backend calculation process through the task trigger to perform calculations on the target data corresponding to the data identifier according to the backend calculation process, and to obtain the calculation result, includes:
[0017] If the task triggering condition is met, the task is executed by the corresponding task trigger to perform calculations on the target data corresponding to the data identifier according to the backend calculation process in the task, and the calculation result is stored in the sending event.
[0018] The step of sending the calculation result to the webpage frontend based on a pre-established network connection includes:
[0019] The sending event is triggered based on the network connection, and the calculation result is sent to the webpage front-end.
[0020] In one embodiment, the task is registered in a scheduler; the method further includes:
[0021] If the network connection is lost, then
[0022] A shutdown event is triggered to destroy the scheduler containing the task required by the target webpage; the target webpage is the webpage corresponding to the network connection.
[0023] The target task registered with the scheduler is terminated.
[0024] In one embodiment, the task triggering condition includes an update of the target data corresponding to the data identifier;
[0025] The process of triggering the execution of the backend calculation process through the task trigger to perform calculations on the target data corresponding to the data identifier according to the backend calculation process, and to obtain the calculation result, includes:
[0026] If the target data corresponding to the data identifier is updated, the backend calculation process is triggered by the task trigger to calculate the updated target data and obtain the calculation result.
[0027] In one embodiment, the task triggering condition includes reaching a preset triggering time condition;
[0028] The process of triggering the execution of the backend calculation process through the task trigger to perform calculations on the target data corresponding to the data identifier according to the backend calculation process, and to obtain the calculation result, includes:
[0029] If the preset trigger time condition is met, the backend calculation process is triggered by the task trigger to obtain the target data corresponding to the data identifier and perform calculation processing to obtain the calculation result.
[0030] In one embodiment, the method further includes:
[0031] In response to a network connection request sent by the web page frontend, a network connection is established with the web page frontend;
[0032] The process of obtaining the data identifier sent by the webpage frontend and the corresponding task triggering conditions includes:
[0033] Obtain the list of resource parameters carried in the network connection request;
[0034] The resource parameter list is parsed to obtain data identifiers and corresponding task triggering conditions.
[0035] In one embodiment, the method further includes:
[0036] If the task triggering condition is met again, the backend computing process will be triggered again by the task trigger.
[0037] The updated calculation result obtained by re-executing the backend calculation process is sent to the webpage frontend so that the webpage frontend can update and display the webpage based on the updated calculation result.
[0038] In one embodiment, the webpage of the webpage front-end includes different display areas, and the data identifier corresponds to the webpage display area; sending the calculation result to the webpage front-end so that the webpage front-end displays the webpage based on the calculation result includes:
[0039] The calculation results of each backend calculation process corresponding to the data identifier are sent to the web page frontend so that the calculation results of each backend calculation process can be visualized in the corresponding display area of the web page running on the web page frontend.
[0040] A page display device, the device comprising:
[0041] The acquisition module is used to acquire the data identifiers and corresponding task triggering conditions sent by the web page front-end;
[0042] A construction module is used to construct the backend computing process corresponding to the data identifier;
[0043] The generation module is used to generate corresponding task triggers based on the task triggering conditions;
[0044] The execution module is used to trigger the execution of the backend calculation process through the task trigger, so as to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process and obtain the calculation result;
[0045] The sending module is used to send the calculation result to the web page front-end based on a pre-established network connection with the web page front-end, so that the web page front-end can display the web page based on the calculation result.
[0046] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0047] Obtain the data identifier and corresponding task triggering conditions sent by the webpage frontend;
[0048] Construct a backend computing process corresponding to the data identifier;
[0049] Generate a corresponding task trigger based on the task triggering conditions;
[0050] The task trigger is used to execute the backend calculation process, so as to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process and obtain the calculation result.
[0051] Based on a pre-established network connection with the webpage front-end, the calculation result is sent to the webpage front-end so that the webpage front-end can display the webpage based on the calculation result.
[0052] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0053] Obtain the data identifier and corresponding task triggering conditions sent by the webpage frontend;
[0054] Construct a backend computing process corresponding to the data identifier;
[0055] Generate a corresponding task trigger based on the task triggering conditions;
[0056] The task trigger is used to execute the backend calculation process, so as to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process and obtain the calculation result.
[0057] Based on a pre-established network connection with the webpage front-end, the calculation result is sent to the webpage front-end so that the webpage front-end can display the webpage based on the calculation result.
[0058] The aforementioned page display method, apparatus, computer equipment, and storage medium, after obtaining the data identifier and corresponding task triggering conditions sent by the webpage frontend, generate a corresponding task trigger based on the task triggering conditions and construct a backend calculation process corresponding to the data identifier, thereby obtaining the necessary program to calculate the calculation results required for display by the webpage frontend. By automatically triggering the execution of the backend calculation process through the task trigger, the target data corresponding to the data identifier can be calculated and processed according to the backend calculation process. After the calculation is completed, the calculation results are actively pushed to the webpage frontend based on the network connection. This eliminates the need to wait for the webpage frontend to initiate a triggering operation, enabling the webpage frontend to obtain the required data in a timely manner to display the corresponding webpage, thus effectively improving the real-time performance of webpage data display. Simultaneously, it avoids the time wasted by the webpage frontend waiting to obtain backend calculation results, effectively improving the efficiency of page display. Furthermore, the method of actively pushing calculation result data to the webpage frontend in this invention avoids the system pressure caused by the possibility of simultaneously responding to a large number of data acquisition requests sent by the webpage frontend in existing technologies, preventing abnormal situations such as webpage display lag and delays, resulting in a better user experience. Attached Figure Description
[0059] Figure 1 This is an application environment diagram of a page display method in one embodiment;
[0060] Figure 2 This is a flowchart illustrating a page display method in one embodiment;
[0061] Figure 3 This is a flowchart illustrating the page display steps in one embodiment;
[0062] Figure 4 This is a structural block diagram of a page display device in one embodiment;
[0063] Figure 5 This is a structural block diagram of the page display device in another embodiment;
[0064] Figure 6 This is an internal structural diagram of a computer device in one embodiment;
[0065] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0067] The page display method provided in this application can be applied to, for example... Figure 1 In the application environment shown, the webpage frontend 102 communicates with the backend server 104 via a network connection. The server 104 obtains the data identifier and corresponding task triggering conditions sent by the webpage frontend 102, constructs a backend calculation process corresponding to the data identifier, and generates a corresponding task trigger based on the task triggering conditions. The server 104 triggers the execution of the backend calculation process through the task trigger to perform calculations on the target data corresponding to the data identifier according to the backend calculation process, obtaining the calculation result. Based on the pre-established network connection between the server 104 and the webpage frontend 102, the server 104 sends the calculation result to the webpage frontend 102, enabling the webpage frontend 102 to display the webpage based on the calculation result. The webpage frontend 102 is the client for displaying the webpage; it can be a browser or a data visualization tool. The webpage frontend 102 can run on various terminals such as personal computers, laptops, smartphones, and tablets; no limitation is made here. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0068] In one embodiment, such as Figure 2 As shown, a page display method is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0069] Step 202: Obtain the data identifier sent by the web page front-end and the corresponding task triggering conditions.
[0070] Here, the data identifier is a unique symbol corresponding to the target data. The target data is the unprocessed data stored on the server. It can be understood that after processing the target data, the result is the result rendered and displayed on the webpage front-end. The task trigger condition is the condition that triggers the execution of the task. The calculation result is the result obtained after the back-end calculation process processes the target data.
[0071] Specifically, after configuring the data identifier and corresponding task triggering conditions, the user can trigger a send operation. The web frontend can respond to the user's send operation by sending the data identifier and corresponding task triggering conditions to the server. The server can then retrieve the data identifier and corresponding task triggering conditions sent by the web frontend.
[0072] In one embodiment, a user can configure the data identifier and corresponding task triggering conditions through a configuration page displayed on the webpage front-end, and then trigger a send operation. The webpage front-end can respond to the user's send operation by sending the data identifier and corresponding task triggering conditions to the server. The configuration page is used to configure the data identifier and corresponding task triggering conditions. It is understood that the user can also configure the update frequency of certain content areas of the webpage displayed on the configuration page, such as updating once every 5 minutes or once every hour.
[0073] In one embodiment, a user can configure the data identifier and corresponding task triggering conditions through a configuration page displayed in the browser, and then trigger a send operation. The web page frontend can respond to the user's send operation by sending the data identifier and corresponding task triggering conditions to the server. The server can trigger a receive event to receive the data identifier and corresponding task triggering conditions sent by the web page frontend. The receive event is the operation of receiving data sent by the web page frontend.
[0074] Step 204: Construct the backend computing process corresponding to the data identifier.
[0075] The backend computing process refers to the steps the server takes to process the target data.
[0076] Specifically, after the server obtains the data identifier sent by the webpage frontend, it constructs a backend calculation process corresponding to the data identifier.
[0077] In one embodiment, after the server obtains the data identifier sent by the webpage frontend, it can, based on the data identifier, search the system server for a pre-configured model corresponding to the data identifier as the backend calculation process; or it can search the system server for multiple data operators corresponding to the data identifier and combine them to obtain the backend calculation process; or it can search the system server for a pre-configured model corresponding to the data identifier as the backend calculation process and multiple data operators and combine them to obtain the backend calculation process. Here, a data operator is an operation symbol used to perform calculations on the target data.
[0078] Step 206: Generate the corresponding task trigger based on the task triggering conditions.
[0079] Among them, the task trigger is the program that triggers the execution of the task.
[0080] Specifically, after the server obtains the task triggering conditions corresponding to the data identifier sent by the web page front-end, it generates the corresponding task trigger based on the task triggering conditions.
[0081] In one embodiment, the task triggering condition can be that the task is triggered when a set frequency is reached, or the task is triggered when target data is updated.
[0082] In one embodiment, the server can generate a task trigger that is activated when a set frequency is reached, or it can generate a task trigger that is activated when target data is updated.
[0083] Step 208: The backend calculation process is triggered by the task trigger to perform calculations on the target data corresponding to the data identifier in accordance with the backend calculation process to obtain the calculation result.
[0084] Specifically, the server triggers the execution of the backend computation process through a task trigger. The server executes the backend computation process, performing calculations on the target data corresponding to the data identifier according to each processing step of the computation process, and obtaining the calculation result.
[0085] In one embodiment, the target data corresponding to the data identifier can be calculated and processed by using a pre-defined model, by combining multiple data operators, or by combining a pre-defined model with multiple data operators.
[0086] Step 210: Based on the pre-established network connection with the web page front-end, send the calculation results to the web page front-end so that the web page front-end can display the web page based on the calculation results.
[0087] Specifically, the network connection refers to the WebSocket connection (i.e., network socket connection). WebSocket is a protocol that requires only one handshake to establish a full-duplex communication connection.
[0088] Specifically, after the server completes the backend calculation process and obtains the calculation result, it can send the calculation result to the web page frontend based on a pre-established network connection. Upon receiving the calculation result through the pre-established network connection with the server, the web page frontend renders and displays the result on the corresponding page.
[0089] In one embodiment, after the front-end receives the calculation result based on a pre-established network connection with the server, it can refresh the calculation result to the corresponding area of the page according to the user's configuration of the update frequency for the area containing the content displayed on the webpage front-end. If the update frequency is 0, the calculation result may not be refreshed to the corresponding area of the page.
[0090] In one embodiment, the webpage front-end displays the webpage based on the calculation results, which could be a data dashboard webpage display. Here, the data dashboard webpage is a full-screen webpage displayed by a data visualization tool. A data visualization tool is a tool that uses graphical design to represent data.
[0091] In the above-described page display method, after obtaining the data identifier and corresponding task triggering conditions sent by the webpage frontend, a corresponding task trigger is generated based on the task triggering conditions, and a backend calculation process corresponding to the data identifier is constructed. This yields the necessary program to calculate the calculation results required for display by the webpage frontend. By automatically triggering the execution of the backend calculation process through the task trigger, the target data corresponding to the data identifier can be calculated and processed according to the backend calculation process. After the calculation is completed, the calculation results are proactively pushed to the webpage frontend via a network connection. This eliminates the need to wait for the webpage frontend to initiate a triggering operation, enabling the webpage frontend to promptly obtain the required data for displaying the corresponding webpage. This effectively improves the real-time performance of webpage data display and avoids the time wasted waiting for the webpage frontend to obtain backend calculation results, thus significantly improving page display efficiency. Furthermore, the method of proactively pushing calculation result data to the webpage frontend avoids the system pressure caused by the need to simultaneously respond to a large number of data retrieval requests from the webpage frontend in existing technologies. This prevents abnormal situations such as webpage display lag and delays, resulting in a better user experience.
[0092] In one embodiment, constructing a backend computation process corresponding to a data identifier includes: finding the data operator and target data corresponding to the data identifier; and combining the data operator and target data according to a preset display format to obtain a backend computation process that matches the preset display format.
[0093] Among them, the preset display format is the display format that is set in advance.
[0094] Specifically, after finding the data operator and target data corresponding to the data identifier, the server combines the data operator and target data according to the preset display format to obtain a backend calculation process that matches the preset display format. It can be understood that after the webpage frontend establishes a network connection with the server, various configuration information for the webpage displayed on the frontend, such as the data identifier, the corresponding task triggering conditions, and the preset display format, can be sent to the server individually, together, or bound to the network connection request and sent to the server with it.
[0095] In one embodiment, the preset display format of the content displayed in each of the multiple areas of the page displayed on the front end of the webpage can be one or more of line charts, pie charts, and bar charts.
[0096] For example, if the default display format for the content in one of the multiple areas of a webpage is a pie chart, the server will combine the data operators and target data after finding the data identifier and the target data to obtain a backend calculation process that matches the pie chart.
[0097] Understandably, if the default display format is a line chart or bar chart, the server can combine the data operators and target data after finding the data identifier and the target data to obtain a backend calculation process that matches the line chart or bar chart.
[0098] In one embodiment, the target data and data operators can be stored together on a single server or separately on different servers. For example, the data operators can be stored on a system server, while the target data can be stored on a business server.
[0099] In this embodiment, the server pre-searches for the data operator corresponding to the data identifier and the target data, and combines them to obtain the backend calculation process, so that the target data can be directly calculated through the backend calculation process, thereby improving the efficiency of obtaining the calculation result.
[0100] In one embodiment, the method further includes: assembling a task trigger, a backend computation process, and a sending event into a task; triggering the execution of the backend computation process through the task trigger to perform computation processing on the target data corresponding to the data identifier according to the backend computation process, and obtaining a computation result, including: if the task triggering condition is met, triggering the execution of the task through the corresponding task trigger to perform computation processing on the target data corresponding to the data identifier according to the backend computation process in the task, obtaining a computation result and storing it in the sending event; and sending the computation result to the webpage frontend based on a pre-established network connection with the webpage frontend, including: triggering the sending event to send the computation result to the webpage frontend based on the network connection.
[0101] The send event is the operation of sending the calculation result.
[0102] Specifically, the server can construct a task by combining the backend computation process, the corresponding task triggers, and the sending event after obtaining the backend computation process and generating the corresponding task triggers. If the task triggering conditions are met, the server will execute the task through the corresponding task triggers to perform calculations on the target data corresponding to the data identifier according to the backend computation process in the task, obtain the calculation results, and store them in the sending event. When the backend computation process is completed, the server can send the calculation results to the web page frontend through the network connection by triggering the sending event.
[0103] In one embodiment, the server can also send the calculation results to the web page frontend in multiple installments by triggering the send event multiple times.
[0104] In one embodiment, the web page front-end can receive the calculation results multiple times, and after receiving the calculation results corresponding to the entire task, display the web page based on the calculation results.
[0105] In this embodiment, a task is composed of a task trigger, a backend calculation process, and a sending event. The server can independently trigger and send events for different tasks to return the corresponding calculation results to the web page frontend. This eliminates the need to receive calculation result requests for different tasks from the web page frontend before returning the corresponding calculation results to the web page frontend, thereby improving the efficiency of the web page frontend in obtaining calculation results.
[0106] In one embodiment, the task is registered in the scheduler; the method further includes: if the network connection is lost, triggering a shutdown event to destroy the scheduler where the task required by the target webpage resides; the target webpage is the webpage corresponding to the network connection; and ending the registration of the target task in the scheduler.
[0107] The scheduler is a service that schedules the resources needed for the computation process. A shutdown event is a shutdown operation. Specifically, shutting down the webpage frontend, or shutting down the webpage displayed on the frontend, will disconnect the network connection. The target task is the task corresponding to the target webpage.
[0108] Specifically, the server assembles the task trigger, backend computation process, and sending events into a task and registers it in the scheduler. If the network connection is lost, the server triggers a shutdown event, finds the scheduler registered for the target task required by the target webpage corresponding to the lost network connection, and destroys it, thus ending the registration of the target task in the scheduler.
[0109] In one embodiment, the web page frontend can disconnect the network connection in response to a user's trigger action to close the web page frontend.
[0110] In one embodiment, the server triggers task execution via a corresponding task trigger. A scheduler allocates resources required for the backend computation process, and the server uses these allocated resources to process the target data corresponding to the data identifier according to the backend computation process in the task. The computation result is then stored in a sending event. Once the backend computation process is complete, the server can trigger a sending event to send the computation result to the web page frontend via a network connection.
[0111] In this embodiment, if the network connection is disconnected, the scheduler containing the task required by the target webpage is destroyed, and the target task registered in the scheduler is terminated, which can effectively save the resources occupied by the target task.
[0112] In one embodiment, the task triggering condition includes an update to the target data corresponding to the data identifier; triggering the execution of a backend calculation process through a task trigger to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process to obtain a calculation result, including: if the target data corresponding to the data identifier is updated, triggering the execution of a backend calculation process through a task trigger to perform calculation on the updated target data to obtain a calculation result.
[0113] Specifically, the server can monitor whether the target data stored on the server has been updated. If the target data corresponding to the data identifier has been updated, the server can trigger a backend calculation process through a task trigger to calculate the updated target data, obtain the calculation result, and update the front-end page of the webpage.
[0114] In one embodiment, the server's required functionality can be implemented using Django and Change Data Capture (CDC), and the network connection between the webpage and the server can be implemented using channels. CDC is a lightweight scheduled task framework used to trigger tasks when certain conditions are met, such as monitoring whether target data stored on the server has been updated.
[0115] In this embodiment, when target data is updated, the server can directly trigger the backend calculation process to perform calculations on the updated target data and obtain the calculation results, reducing the waiting time for page data processing and thus improving the efficiency of calculation processing.
[0116] In one embodiment, the task triggering condition includes reaching a preset triggering time condition; triggering the execution of a backend calculation process through a task trigger to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process to obtain the calculation result, including: if the preset triggering time condition is met, triggering the execution of a backend calculation process through a task trigger to obtain the target data corresponding to the data identifier and perform calculation processing to obtain the calculation result.
[0117] Among them, the preset trigger time condition is the trigger time condition set in advance. It can be understood that the preset trigger time condition can be a preset trigger time point or a preset trigger time period.
[0118] Specifically, users can set different preset trigger time conditions for different display areas of the webpage on the front end. The server can determine whether the preset trigger time conditions are met. If the preset trigger time conditions are met, the server can trigger the execution of the backend calculation process through a task trigger, obtain the target data corresponding to the data identifier, perform calculation processing, obtain the calculation result, and display the calculation result in the corresponding display area of the front end webpage.
[0119] In one embodiment, the preset trigger time condition is a preset trigger time point. When the preset trigger time point is reached, the server can trigger the execution of the backend calculation process through a task trigger, obtain the target data corresponding to the data identifier, perform calculation processing, obtain the calculation result, and return the calculation result corresponding to the webpage to the frontend of the webpage to refresh the page.
[0120] Understandably, when the preset trigger time condition is a preset trigger time period, the server can trigger the execution of the backend calculation process through a task trigger when the preset trigger time period arrives. This process retrieves the target data corresponding to the data identifier, performs calculations, obtains the calculation results, and then returns the corresponding calculation results to the webpage frontend to refresh the page.
[0121] In one embodiment, the server's required functionality can be implemented using Django and Apschedule, while the network connection between the webpage and the server can be implemented using channels. Django is an open-source web application framework based on the MVT software design pattern. MVT stands for Model, View, and Template. Apschedule (Advanced Python Scheduler) is a lightweight scheduled task framework used to trigger task execution when certain conditions are met, such as a preset time point or time period. Channels is a framework that replaces the traditional Django server for handling requests. Channels include receive events, send events, and close events.
[0122] In this embodiment, the corresponding display area in the webpage front-end is updated according to the user's pre-set update requirements for the display area of different webpages, which makes it easier for the user to obtain the content of different display areas of the webpage that they need to know.
[0123] In one embodiment, the method further includes: establishing a network connection with the web page frontend in response to a network connection request sent by the web page frontend; obtaining a data identifier and corresponding task triggering conditions sent by the web page frontend, including: obtaining a list of resource parameters carried in the network connection request; parsing the resource parameter list to obtain the data identifier and corresponding task triggering conditions.
[0124] The resource parameter list is a list containing resource parameters. Resource parameters are the basis for calculating the resources needed to produce the calculation results. In other words, to calculate the results that the webpage front-end needs to display, the necessary procedures for calculating those results are obtained based on the resource parameters in the resource parameter list.
[0125] Specifically, the webpage frontend sends a network connection request to the server. The server responds to the network connection request by establishing a network connection with the webpage frontend. The server retrieves and parses the resource parameter list carried in the network connection request, obtaining data identifiers and corresponding task triggering conditions.
[0126] In one embodiment, the web page frontend can send the resource parameter list to the server after establishing a network connection. If the resource parameter list is sent to the server along with the network connection request, and there is an updated resource parameter list, the web page frontend can then send the updated resource parameter list to the server.
[0127] In one embodiment, a user can configure data identifiers, task triggering conditions, and preset display formats on the configuration page of the webpage front-end and save the resulting resource parameter list. Users can further configure the resource parameter list on the webpage front-end to meet their specific needs.
[0128] In this embodiment, the web page front-end can establish a network connection with the web page front-end to send the updated resource parameter list to the server for parsing, and then obtain the corresponding calculation results returned by the server for updating and display.
[0129] In one embodiment, the method further includes: if the task triggering condition is met again, triggering the execution of the backend calculation process again through the task trigger; sending the updated calculation result obtained from the re-execution of the backend calculation process to the web page frontend, so that the web page frontend updates and displays the web page based on the updated calculation result.
[0130] Specifically, if the task triggering conditions are met again, the server will trigger the execution of the backend calculation process again through the task trigger, obtain the updated calculation result, and trigger the sending event to return the updated calculation result obtained from the re-execution of the backend calculation process to the web page frontend, so that the web page frontend can obtain the updated calculation result in a timely manner and thus display the updated web page in a timely manner.
[0131] In one embodiment, the webpage front-end updates and displays the target data dashboard based on the updated calculation results.
[0132] In this embodiment, as long as the task triggering conditions are met, the server will automatically trigger the execution of the backend calculation process through the task trigger to obtain the updated calculation results and push them to the web page frontend. Thus, the calculation results can be displayed on the web page frontend in real time without waiting to receive a request from the web page frontend to obtain the calculation results, saving waiting time and avoiding the situation where there is a delay in the calculation results displayed on the web page frontend.
[0133] In one embodiment, the webpage of the webpage front-end includes different display areas, and the data identifier corresponds to the webpage display area; the step of sending the calculation result to the webpage front-end so that the webpage front-end displays the webpage based on the calculation result includes: sending the calculation results of each back-end calculation process corresponding to the data identifier to the webpage front-end so that the calculation results of each back-end calculation process are visualized in the corresponding display area in the webpage running on the webpage front-end.
[0134] Specifically, based on a pre-established network connection with the web page frontend, the server sends the calculation results of each backend calculation process corresponding to the data identifier to the web page frontend. After receiving the calculation results, the web page frontend visualizes each calculation result in the corresponding display area of the running web page according to the data identifier.
[0135] In one implementation, the webpage running on the front end is a data dashboard webpage. After obtaining the calculation results, the front end can visualize each calculation result in the corresponding display area of the running data dashboard webpage according to the data identifier.
[0136] In one implementation, the web front-end can visualize the various calculation results in the corresponding display area of the running data dashboard webpage using various types of charts, such as pie charts, bar charts, or line charts; there are no limitations here.
[0137] In this embodiment, for web pages that require frequent updates, the server actively pushes the calculation results to the web page front-end for real-time display after completing the calculation process. This avoids the time wasted by the web page front-end waiting to obtain the back-end calculation results, and also avoids the system pressure caused by simultaneously responding to a large number of calculation result retrieval requests sent by the web page front-end during the execution of the calculation process, thereby improving the display efficiency of the data dashboard web page.
[0138] In one embodiment, such as Figure 3 A flowchart illustrating the steps involved in displaying a page is shown.
[0139] like Figure 3As shown, the webpage frontend sends a network connection request carrying a list of resource parameters to the server. After receiving the network connection request via a trigger event, the server establishes a network connection with the webpage frontend. The server parses the data identifiers of the network data from the resource parameter list and constructs a backend computation process corresponding to each data identifier. The server parses the task triggering conditions corresponding to each data identifier from the resource parameter list. For example, if a task is to be executed every 5 minutes, a task trigger is generated based on the task triggering conditions. The server combines the task triggers, the backend computation process, and the sending event into multiple different tasks and registers them with the scheduler.
[0140] If the task triggering conditions are met, such as triggering the task every 5 minutes, the server can use a task trigger to execute the backend computation process, obtain the target data corresponding to the data identifier, perform computation processing, obtain the computation result, and trigger a send event to return the computation result to the web page frontend. The web page frontend listens for the computation result sent by the server via the network connection, receives the computation result, and renders and displays the page. If the task triggering conditions are met again, the server can use a task trigger to execute the backend computation process again, obtain the updated computation result, and trigger a send event to return the updated computation result obtained from the re-execution of the backend computation process to the web page frontend. The web page frontend receives the updated computation result and updates the page display accordingly.
[0141] The server receives a request from the web frontend to close the network connection, triggers a close event, destroys the scheduler, and terminates the target tasks registered with the scheduler.
[0142] In this embodiment, the calculation results are automatically pushed from the backend to the webpage frontend, and the webpage frontend automatically updates the page display according to the calculation results, thereby maintaining the data validity and real-time performance of the data dashboard webpage.
[0143] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps.
[0144] In one embodiment, such as Figure 4As shown, a page display device 400 is provided, including: an acquisition module 402, a construction module 404, a generation module 406, an execution module 408, and a sending module 410, wherein:
[0145] The acquisition module 402 is used to acquire the data identifier sent by the web page front-end and the corresponding task triggering conditions.
[0146] Module 404 is used to construct the backend computation process corresponding to the data identifier.
[0147] The generation module 406 is used to generate corresponding task triggers based on the task triggering conditions.
[0148] The execution module 408 is used to trigger the execution of the backend calculation process through the task trigger, so as to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process and obtain the calculation result.
[0149] The sending module 410 is used to send the calculation results to the web page front-end based on the pre-established network connection between the web page front-end and the web page front-end, so that the web page front-end can display the web page based on the calculation results.
[0150] In one embodiment, the construction module 404 is further configured to find the data operator and target data corresponding to the data identifier; and combine the data operator and target data according to the preset display format to obtain a backend calculation process that matches the preset display format.
[0151] In one embodiment, the apparatus further includes: a composition module 412, configured to compose a task by combining a task trigger, a backend calculation process, and a sending event; an execution module 408, configured to, if the task triggering condition is met, trigger the execution of the task through the corresponding task trigger, so as to perform calculation processing on the target data corresponding to the data identifier according to the backend calculation process in the task, obtain the calculation result, and store it in the sending event; and a sending module 410, configured to, trigger the sending event to send the calculation result to the web page frontend based on the network connection.
[0152] In one embodiment, the task is registered with the scheduler; such as Figure 5 As shown, the device also includes: a component module 412 and a destruction module 414, wherein:
[0153] The destruction module 414 is used to trigger a shutdown event if the network connection is lost, so as to destroy the scheduler where the task required by the target webpage is located; the target webpage is the webpage corresponding to the network connection; and to terminate the target task registered in the scheduler.
[0154] In one embodiment, the task triggering condition includes an update of the target data corresponding to the data identifier; the execution module 408 is further configured to, if the target data corresponding to the data identifier is updated, trigger the execution of the backend calculation process through the task trigger to calculate the updated target data and obtain the calculation result.
[0155] In one embodiment, the task triggering condition includes reaching a preset triggering time condition; the execution module 408 is further configured to, if the preset triggering time condition is met, trigger the execution of the backend calculation process through the task trigger, obtain the target data corresponding to the data identifier and perform calculation processing to obtain the calculation result.
[0156] In one embodiment, the apparatus further includes: establishing a network connection with the web page frontend in response to a network connection request sent by the web page frontend; and obtaining a resource parameter list carried in the network connection request; and parsing the resource parameter list to obtain a data identifier and a corresponding task triggering condition.
[0157] In one embodiment, the execution module 408 is further configured to, if the task triggering condition is met again, trigger the execution of the backend calculation process again through the task trigger; and send the updated calculation result obtained from the re-execution of the backend calculation process to the web page frontend, so that the web page frontend updates and displays the web page based on the updated calculation result.
[0158] In one embodiment, the webpage front-end includes different display areas, and the data identifier corresponds to the webpage display area; the sending module 410 is also used to send the calculation results of each back-end calculation process corresponding to the data identifier to the webpage front-end, so as to visualize the calculation results of each back-end calculation process in the corresponding display area in the webpage running on the webpage front-end.
[0159] Specific limitations regarding the page display device can be found in the limitations of the page display method described above, and will not be repeated here. Each module in the aforementioned page display device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0160] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores page display data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a page display method.
[0161] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a page display method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0162] Those skilled in the art will understand that Figure 6 and Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0163] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0164] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A page display method, characterized in that, The method comprises: in response to a network connection request sent by a webpage front end, establishing a network connection with the webpage front end; obtaining a resource parameter list carried in the network connection request, parsing the resource parameter list to obtain a data identifier, a corresponding task trigger condition and a preset display form; finding a data operator corresponding to the data identifier and target data, and combining the data operator and the target data according to the preset display form to obtain a back-end computing process matched with the preset display form; generating a corresponding task trigger according to the task trigger condition; composing the task trigger, the back-end computing process and a sending event into a task; if the task trigger condition is met, triggering execution of the task through the corresponding task trigger to perform computing processing on the target data corresponding to the data identifier according to the back-end computing process in the task, and obtaining a computing result and storing the computing result in the sending event; triggering the sending event to send the computing result to the webpage front end based on the network connection, so that the webpage front end performs webpage display based on the computing result.
2. The method of claim 1, wherein, The task is registered in a scheduler; the method further comprises: if the network connection is disconnected, then triggering a closing event to destroy the scheduler where the task required by the target webpage is located; the target webpage is a webpage corresponding to the network connection; ending registration of the target task in the scheduler.
3. The method of claim 1, wherein, The task trigger condition comprises updating of the target data corresponding to the data identifier; The method further comprises: if the target data corresponding to the data identifier is updated, triggering execution of the back-end computing process through the task trigger to perform computing on the updated target data and obtain a computing result.
4. The method of claim 1, wherein, The task trigger condition comprises reaching of a preset trigger time condition; The method further comprises: if the preset trigger time condition is met, triggering execution of the back-end computing process through the task trigger to obtain the target data corresponding to the data identifier and perform computing processing to obtain a computing result.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: if the task trigger condition is met again, triggering execution of the back-end computing process again through the task trigger; sending the updated computing result obtained by executing the back-end computing process again to the webpage front end, so that the webpage front end performs webpage update display based on the updated computing result.
6. The method of claim 1, wherein, The webpage of the webpage front end comprises different display areas, and the data identifier corresponds to the webpage display area; The method of sending the computing result to the webpage front end so that the webpage front end performs webpage display based on the computing result comprises: sending the computing result of each back-end computing process corresponding to the data identifier to the webpage front end, so as to visually display the computing result of each back-end computing process in the corresponding display area in the webpage running on the webpage front end.
7. A page presentation device, characterized by The apparatus comprises: a module for establishing a network connection with a webpage front end in response to a network connection request sent by the webpage front end; An acquisition module is configured to acquire a resource parameter list carried in the network connection request, parse the resource parameter list to obtain a data identifier, a corresponding task triggering condition, and a preset display form; A construction module is configured to search for a data operator corresponding to the data identifier and target data, combine the data operator and the target data according to the preset display form, and obtain a back-end computing process matched with the preset display form; A generation module is configured to generate a corresponding task trigger according to the task triggering condition; A composition module is configured to compose the task trigger, the back-end computing process, and a sending event into a task; An execution module is configured to trigger execution of the task through the corresponding task trigger if the task triggering condition is met, perform computing processing on the target data corresponding to the data identifier according to the back-end computing process in the task, obtain a computing result, and store the computing result in the sending event; A sending module is configured to trigger the sending event to send the computing result to the web front end based on the network connection, so that the web front end performs web display based on the computing result.
8. The apparatus of claim 7, wherein, The web of the web front end includes different display areas, and the data identifier corresponds to the web display area; the sending module is further configured to send the computing result of each back-end computing process corresponding to the data identifier to the web front end, so as to visually display the computing result of each back-end computing process in the corresponding display area in the web running on the web front end. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method, front-end client, rear-end server and storage medium
CN110225099A
Method and device for website front-end and back-end communication, computer equipment and storage medium
CN111177624A