A data processing method and related equipment
By automatically adjusting path configuration information in the application to adapt to changes in server business data, the problem of low page iteration efficiency is solved, and efficient display data filling and cost reduction are achieved.
Patent Information
- Application Number
- CN202010092597.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-12
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2040-02-12
AI Technical Summary
In the prior art, application page templates need to be re-edited when server business data changes, resulting in low page iteration efficiency and high development costs.
By obtaining the template configuration data of the target page, a page display template is generated, and the path configuration information is automatically adjusted when the server business data changes, and the display data is obtained and filled without modifying the target application code.
The filling efficiency of the display position corresponding to the target display element in the target page is improved, and the development cost is reduced.
Smart Images

Figure CN111338624B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method and related equipment. Background Art
[0002] Applications are highly interactive software, and every page within an application must display information and interact with it. Timely updates and iterations of application pages are crucial to providing customers with a positive interactive experience and valuable information.
[0003] Currently, to achieve more timely and cost-effective page iterations, applications typically pre-set coarse-grained page templates and assign each template an ID. The page template IDs are then configured on the server to adapt to changes in the application's corresponding page templates and create a new layout. The display data of the target display elements in the page templates is linked to the business data on the server, and each associated field is fixed. Any changes to the business data on the server, such as field or format changes, require re-editing the code to modify the corresponding page templates and then re-releasing the new version of the application. This cumbersome operation significantly impacts the efficiency of filling the corresponding display slots for the target display elements in the page templates. Summary of the Invention
[0004] An embodiment of the present invention provides a data processing method and related equipment, which can ensure the filling efficiency of the display position corresponding to the target display element in the target page when the business data corresponding to the target page in the server changes, without having to re-edit the code to modify the target page.
[0005] In a first aspect, an embodiment of the present invention provides a data processing method, which is applied to a terminal device and includes:
[0006] Acquire template configuration data of a target page, the template configuration data including page configuration information of the target page and path configuration information of a target display element in the target page;
[0007] Generate a page display template corresponding to the target page based on the page configuration information;
[0008] If it is detected that the business data corresponding to the target page in the server has changed, the path configuration information is adjusted based on the changed business data;
[0009] Sending a data request carrying the adjusted path configuration information to the server, to instruct the server to obtain display data corresponding to the target display element from the business data according to the adjusted path configuration information, and return the display data to the terminal device;
[0010] The display data returned by the server is received, and the display data is filled into a preset display position corresponding to the target display element in the page display template.
[0011] In one embodiment, if it is detected that the business data corresponding to the target page in the server has changed, the version information of the target application under the system time is obtained; if it is detected based on the version information that the version number corresponding to the target application is a preset version number, the step of adjusting the path configuration information based on the changed business data is triggered.
[0012] In one embodiment, if the display data returned by the server is not received within a preset time, the historical display data of the target display element closest to the system time is obtained; and the historical display data closest to the system time is filled into the display position corresponding to the target display element in the page display template.
[0013] In one embodiment, the preset display position includes N preset display rows, where N is an integer greater than 0. A specific implementation of filling the preset display position corresponding to the target display element in the page display template with the display data is as follows: if it is detected that the number M of the display data is greater than N, obtaining specified attribute information of the target display element, wherein each piece of the display data is used to fill one of the preset display rows, where M is an integer greater than 0; if it is determined based on the specified attribute information that the category of the target display element is a specified category, generating M display rows based on the display styles of the N preset display rows; replacing the N preset display rows in the preset display position with the M display rows in the page display template, and filling the M display rows with the M pieces of display data, wherein each of the M pieces of display data is used to fill one of the M display rows.
[0014] In one embodiment, after obtaining the specified attribute information of the target display element, if it is determined based on the specified attribute information that the category of the target display element is not the specified category, an alarm message may also be output, where the alarm message is used to indicate that the number M of display data is greater than the preset display rows N.
[0015] In one embodiment, the path configuration information includes a request path and a field path. The request path is used to send the data request to the server through the request path, and the field path is used to instruct the server to obtain the display data corresponding to the target display element from the business data according to the field path.
[0016] In one embodiment, the specific implementation method of adjusting the path configuration information based on the changed business data is: locating the field path from the path configuration information; and adjusting the field path based on the changed business data.
[0017] In a second aspect, an embodiment of the present invention provides a data processing device, which includes a module for executing the method of the first aspect.
[0018] In a third aspect, an embodiment of the present invention provides a terminal device, which includes a processor, a communication interface, an output device and a memory, and the processor, communication interface, output device and memory are interconnected, wherein the memory is used to store a computer program that supports the terminal device to execute the above-mentioned method, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the above-mentioned first aspect.
[0019] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect.
[0020] In an embodiment of the present application, after the terminal device obtains the template configuration data for the target page, it can generate a page display template corresponding to the target page based on the page configuration information. If it is detected that the business data corresponding to the target page in the server has changed, the path configuration information is adjusted based on the changed business data. Furthermore, the terminal device can send a data request carrying the adjusted path configuration information to the server to instruct the server to obtain the display data corresponding to the target display element from the business data based on the adjusted path configuration information, and return the display data to the terminal device. Furthermore, the terminal device receives the display data returned by the server and fills the display data into the preset display position corresponding to the target display element in the page display template. It can be seen that by adopting this method, when the business data on the server side changes, there is no need to modify the code of the target application corresponding to the target page, but the path configuration information of the target application is automatically adjusted, which is not only conducive to reducing development costs, but also conducive to improving the filling efficiency of the display position corresponding to the target display element in the target page. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 is a schematic diagram of business data provided by an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of another type of service data provided by an embodiment of the present invention;
[0024] Figure 3 This is a flow chart of a data processing method provided by an embodiment of the present invention;
[0025] Figure 4a The present invention provides a flowchart of business data addressing;
[0026] Figure 4b This is a schematic diagram of another type of business data provided by the present invention;
[0027] Figure 5 is a flow chart of another data processing method provided by an embodiment of the present invention;
[0028] Figure 6 This is a flow chart of addressing service data using a picture template provided by an embodiment of the present invention;
[0029] Figure 7 is a schematic block diagram of a data processing device provided by an embodiment of the present invention;
[0030] Figure 8 This is a schematic block diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0032] The terminal devices described in the embodiments of the present invention may include smartphones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptop computers, mobile Internet devices (MIDs), or wearable devices. The above terminal devices are merely examples, not exhaustive, and include but are not limited to the above terminal devices. The terminal device may have a target application installed or may access a website corresponding to the target application.
[0033] In order to achieve more timely and cost-effective page iterations for the target application, some highly abstract and independent user interface (UI) templates can be built into the target application. In addition to the UI layout logic, these templates also require some background business data to support content updates, such as the customer's balance, nickname, mood, etc. These all require pre-agreement with the server on which fields will be sent and which fields the target application will use to display on the UI. For example, see Figure 1 , assuming Figure 1 The page display template 10 corresponds to business data 11. When displaying the target display element "This is a nickname," the value after the colon in the "data.name" field must be obtained from the business data. This value after the colon in the "data.name" field serves as the display data for the target display element "This is a nickname." Furthermore, after obtaining the display data, the display data can be populated into the preset display position corresponding to the target display element "This is a nickname," thereby updating the display data corresponding to the target display element "This is a nickname."
[0034] In this case, the code for obtaining the display data corresponding to the target display element "This is a nickname" in the target application will also be fixed. For example, the code will be similar to view1.setText(data.name), and view1 will display the value of the name field. After the target application is released online, if the business data in the server is adjusted, for example, it will be changed to Figure 2 The business data shown.
[0035] In this case, if the target application wants to obtain the display data corresponding to the target display element "This is a nickname," the developer needs to modify the target application's code, for example, to view1.setText(data.base_info.name) and then re-launch the modified target application. This approach requires re-editing the target application's code and re-releasing a new version of the application if the business data on the server changes, such as field or format changes. This is cumbersome and expensive, and it significantly impacts the efficiency of filling the display space corresponding to the target display element in the page template.
[0036] To address the aforementioned issues, in embodiments of the present invention, template configuration data for a target page can be distributed. This distributed template configuration data includes path configuration information for each target display element that may change. After a terminal device obtains the template configuration data for the target page, it can generate a page display template corresponding to the target page based on the page configuration information. If a change is detected in the server's business data corresponding to the target page, the path configuration information can be adjusted based on the changed business data. Furthermore, the terminal device can send a data request carrying the adjusted path configuration information to the server, instructing the server to retrieve display data corresponding to the target display element from the business data based on the adjusted path configuration information and return the display data to the terminal device. Furthermore, the terminal device receives the display data returned by the server and populates the display data into the preset display location corresponding to the target display element in the page display template. This approach allows the target application's code to be automatically adjusted when server-side business data changes, eliminating the need to modify the code. This not only reduces development costs but also improves the efficiency of populating the display location corresponding to the target display element on the target page.
[0037] See also Figure 3 , Figure 3 1 is a flow chart of a data processing method provided by an embodiment of the present invention. The method can be executed by a terminal device. As shown in the figure, the data processing method may include:
[0038] S301: Acquire template configuration data of a target page, where the template configuration data includes page configuration information of the target page and path configuration information of a target display element in the target page.
[0039] The target display element is data that will be updated over time in a pre-set target page, such as balance, user nickname, friend nickname, mood, etc. In one implementation, the target page can be pre-configured to obtain page configuration information of the target page; the target display element is path-configured according to the data format agreed with the server side to obtain path configuration information of the target display element in the target page. The page configuration information represents the attribute information of each display element in the target page, and the attribute information can be, for example, the display element identifier (such as id), category view type (such as picture, text, etc.), content, display element style, sub-display element, etc.; the path configuration information includes the field path and request path for obtaining the display data corresponding to the target display element.
[0040] In one embodiment, the terminal device may include a first terminal device and a second terminal device, wherein the second terminal device has a target application corresponding to the target page installed or can access the application corresponding to the target page. The first terminal device may configure the target page and, after the configuration is complete, send the configured template configuration data corresponding to the target page to the second terminal device, which then executes steps S301 to S305.
[0041] In one embodiment, the terminal device may be configured with or have access to a template configuration platform and a target application. The terminal device may configure the target page on the template configuration platform, and after the configuration is complete, the terminal device may send the template configuration data corresponding to the configured target page to the target application, thereby triggering the target application to execute steps S301 to S305.
[0042] S302: Generate a page display template corresponding to the target page based on the page configuration information. In one embodiment, the terminal device can generate a page display template corresponding to the target page based on the attribute information of each display element in the target page included in the page configuration information, that is, restore the target page in the display interface.
[0043] S303: If it is detected that the business data corresponding to the target page in the server has changed, the path configuration information is adjusted based on the changed business data.
[0044] In one embodiment, after the business data corresponding to the target page in the server changes, the server may send a business data change indication to the terminal device. Upon detecting the change indication, the terminal device may determine that the business data corresponding to the target page has changed and adjust the path configuration information based on the indication of the change indication. The change indication indicates the changed target data in the business data.
[0045] In one embodiment, after the business data corresponding to the target page on the server changes, the developer can view the changed business data and manually adjust the path configuration information based on the change in the business data. In this case, when the terminal device detects the user's modification operation on the path configuration information, it can determine that the business data corresponding to the target page on the server has changed, and adjust its own path configuration information based on the operation information corresponding to the modification operation.
[0046] In one embodiment, the path configuration information includes a request path and a field path. The request path is used to send a data request to the server via the request path. That is, the request path can be the interface for data exchange between the terminal device and the server. The field path is used to instruct the server to obtain the display data corresponding to the target display element from the business data based on the field path.
[0047] In one embodiment, the terminal device can locate the field path from the path configuration information and adjust the field path based on the changed business data. Figure 4a , including the target page 40, the path configuration information 41 corresponding to the target page, the business data 42 corresponding to the target page in the server, and the "This is a nickname" in the target page as the target display element. In this case, after the terminal device requests the template configuration data of the target page, when generating the page display template corresponding to the target page, it will extract the field path of the target display element from the path configuration information, such as Figure 4a In the textPath:data.name section, when the page display template requests the actual business data, the preset display location corresponding to the target display element "This is a nickname" will search the business data based on data.name, first find the data node, and then search for the name field in the data node. Once the value is found, the value corresponding to the name field will be filled into the preset display location corresponding to the target display element "This is a nickname".
[0048] Furthermore, when the business data format changes, such as Figure 4a The field path date.name (i.e. target data) of business data 42 is modified to Figure 4b In this case, the terminal device can modify the field path textPath:data.name to textPath:data.nick in the path configuration information based on the change of the target data date.name, thereby completing the adjustment of the path configuration information without re-editing the code of the application corresponding to the target page and releasing a new application version.
[0049] S304: Sending a data request carrying the adjusted path configuration information to the server to instruct the server to obtain display data corresponding to the target display element from the business data according to the adjusted path configuration information, and return the display data to the terminal device.
[0050] S305: Receive the display data returned by the server, and fill the display data into the preset display position corresponding to the target display element in the page display template.
[0051] In one embodiment, the terminal device can locate the service data pre-stored by the server according to the request path in the path configuration information (for example, calling a certain interface), and then obtain the display data corresponding to the target display element from the service data based on the field path in the path configuration information. Figure 4a 40 in the business data such as Figure 4bAs shown, the target display element on the target page is "This is a nickname," and the field path corresponding to this target display element is adjusted to: textPath:data.nick. In this case, the terminal device can locate the pre-stored business data on the server based on the request path in the path configuration information (for example, by calling a specific API). It then retrieves the display data corresponding to the target display element from the business data based on the field path textPath:data.nick, and populates the display data into the preset display position corresponding to "This is a nickname" in the page display template.
[0052] In one embodiment, the terminal device may send a data request carrying the adjusted field path to the server via the request path in the path configuration information. After receiving the data request, the server may obtain the display data corresponding to the target display element from the business data based on the adjusted field path carried in the data request, and return the display data to the terminal device.
[0053] In an embodiment of the present invention, after the terminal device obtains the template configuration data for the target page, it can generate a page display template corresponding to the target page based on the page configuration information. If it is detected that the business data corresponding to the target page in the server has changed, the path configuration information is adjusted based on the changed business data. Furthermore, the terminal device can send a data request carrying the adjusted path configuration information to the server to instruct the server to obtain the display data corresponding to the target display element from the business data based on the adjusted path configuration information, and return the display data to the terminal device. Furthermore, the terminal device receives the display data returned by the server and fills the display data into the preset display position corresponding to the target display element in the page display template. It can be seen that by adopting this method, when the business data on the server side changes, there is no need to modify the code of the target application corresponding to the target page, but the path configuration information of the target application is automatically adjusted, which is not only conducive to reducing development costs, but also conducive to improving the filling efficiency of the display position corresponding to the target display element in the target page.
[0054] See also Figure 5 , Figure 5 FIG1 is a schematic diagram of another data processing method provided by an embodiment of the present invention. The method is applied to a terminal device and can be executed by the terminal device. As shown in the figure, the data processing method may include:
[0055] S501: Acquire template configuration data of a target page, where the template configuration data includes page configuration information of the target page and path configuration information of a target display element in the target page.
[0056] S502: Generate a page display template corresponding to the target page based on the page configuration information. The specific implementation of steps S501 to S502 can refer to the description of steps S301 to S302 in the above embodiment, which will not be repeated here.
[0057] S503: If it is detected that the business data corresponding to the target page in the server has changed, the version information of the target application under the system time is obtained. If it is detected based on the version information that the version number corresponding to the target application is the preset version number, the path configuration information is adjusted based on the changed business data.
[0058] The preset version number is set by the developer and can be adjusted based on actual needs. In this way, the path configuration information can be adjusted only in the specified version without affecting the original path configuration information in the old version.
[0059] In one embodiment, if a change is detected in the business data corresponding to the target page in the server, the step of adjusting the path configuration information based on the changed business data can be triggered when an update is detected in the version of the application corresponding to the target page.
[0060] S504: Sending a data request carrying the adjusted path configuration information to the server to instruct the server to obtain display data corresponding to the target display element from the business data according to the adjusted path configuration information, and return the display data to the terminal device.
[0061] S505: Receive the display data returned by the server and fill the display data into the preset display position corresponding to the target display element in the page display template. The specific implementation of steps S504 to S505 can refer to the relevant description of steps S304 to S305 in the above embodiment and will not be repeated here.
[0062] In one embodiment, after a terminal device sends a data request containing path configuration information to a server, if it does not receive display data from the server within a preset time, it retrieves the historical display data of the target display element closest to the system time and populates the display position corresponding to the target display element in the page display template with the historical display data closest to the system time. This approach allows the target display element's historical display data closest to the system time to be used even if a display data request fails, preventing the target page from having no content to display due to data retrieval failures, which could negatively impact the user experience.
[0063] In one embodiment, the preset display position includes N preset display rows, where N is an integer greater than 0. In one embodiment, a specific implementation method for a terminal device to fill the preset display position corresponding to a target display element in a page display template with display data may be as follows: if it is detected that the number M of display data items is greater than N, then designated attribute information of the target display element is obtained, where each display data item is used to fill one preset display row, where M is an integer greater than 0. Furthermore, if the category of the target display element is determined to be a designated category based on the designated attribute information, then M display rows are generated based on the display styles of the N preset display rows, and the N preset display rows in the preset display position are replaced by the M display rows in the page display template, thereby filling the M display rows with the M pieces of display data, where each of the M pieces of display data is used to fill one of the M display rows.
[0064] The specified attribute information is the category attribute view type of the target display element. The specified category is for scenarios such as address lists and order lists, where each row has the same template style but the number of actual data items varies.
[0065] In one embodiment, for example, assuming the target display element is an address book list, the display location corresponding to the address book list includes three (i.e., N is 10) preset display rows, and the display style of each row is: name text on top, phone number text on the bottom. In this case, if the server returns 10 (i.e., M is 10) pieces of display data, and these 10 pieces of display data exceed the number of preset display rows, the terminal device can generate 10 display rows based on the display styles of the above three preset display rows, and use the newly generated 10 display rows to replace the pre-set three display rows in the page display template, and then fill the 10 newly generated display rows with the 10 pieces of display data, with each piece of display data being used to fill one of the 10 display rows, and each piece of display data representing the communication information of a user.
[0066] In one embodiment, after the terminal device obtains the specified attribute information of the target display element, if it is determined based on the specified attribute information that the category of the target display element is not the specified category, an alarm message is output, where the alarm message is used to indicate that the number M of display data is greater than the preset display rows N.
[0067] Alternatively, in another embodiment, after the terminal device obtains the specified attribute information of the target display element, if it is determined based on the specified attribute information that the category of the target display element is not the specified category, in addition to outputting an alarm message, the current page display template may not be updated, so that the preset display corresponding to the target display element is still to display the most recent historical display data.
[0068] In one embodiment, since the format of the business data required by the page display template is usually an array, for example, assuming that the page display template corresponding to the target page is a picture template, including image 1, image 2 and image 3, the basic principle for this type of path addressing is as follows: Figure 6 As shown, it includes: page display template 60, page display template 61 and business data 62. Among them, the styles of the three pictures in page display template 60 are different, that is, the picture templates cannot be reused. In view of this situation, when configuring the template for the page display template, the business data field path of each row of picture templates can be configured as a specific array index, such as imgs[0].url, imgs[1].url, imgs[2].url on the left side of Figure 6, which correspond to "url": "aaa.jpg", "url": "bbb.jpg" and "url": "ccc.jpg" in business data 62 respectively.
[0069] The three pictures in the page display template 60 are copied from the same style, that is, three picture dimension templates, which can be reused. In this case, when configuring the template for the page display template, the business data field path of each row of picture template can be configured as Figure 6 In the imgs[].url on the right, when the terminal device needs to obtain the display data corresponding to each image, it can read the [] in the path, match the imgs[] in the business data, and then take out all the elements in the array in turn, automatically mark them as subscripts, and fill the URL under each element into each row of the image template.
[0070] In an embodiment of the present invention, after the terminal device obtains the template configuration data for the target page, it can generate a page display template corresponding to the target page based on the page configuration information. If it is detected that the business data corresponding to the target page in the server has changed, the version information of the target application under the system time is obtained. If it is detected based on the version information that the version number corresponding to the target application is a preset version number, the path configuration information is adjusted based on the changed business data. Furthermore, the terminal device can send a data request carrying the adjusted path configuration information to the server to instruct the server to obtain the display data corresponding to the target display element from the business data based on the adjusted path configuration information, and return the display data to the terminal device. Furthermore, the terminal device receives the display data returned by the server and fills the display data into the preset display position corresponding to the target display element in the page display template. In this way, the path configuration information can be adjusted only under the specified version without affecting the original path configuration information under the old version.
[0071] The embodiment of the present invention also provides a data processing device. The device includes a device for executing the above Figure 3or Figure 5 The module of the method is configured in the terminal device. Figure 7 , is a schematic block diagram of a data processing device provided by an embodiment of the present invention. The data processing device of this embodiment includes:
[0072] An acquisition module 70 is configured to acquire template configuration data of a target page, wherein the template configuration data includes page configuration information of the target page and path configuration information of a target display element in the target page;
[0073] Processing module 71 is configured to generate a page display template corresponding to the target page based on the page configuration information, and adjust the path configuration information based on the changed business data if it is detected that the business data corresponding to the target page in the server has changed;
[0074] a communication module 72 configured to send a data request carrying the adjusted path configuration information to the server, instructing the server to obtain display data corresponding to the target display element from the business data according to the adjusted path configuration information, and return the display data to the terminal device;
[0075] The communication module 72 is further configured to receive the display data returned by the server;
[0076] The processing module 71 is further configured to fill the display data into a preset display position corresponding to the target display element in the page display template.
[0077] In one embodiment, the processing module 71 is also used to obtain the version information of the target application under the system time if it is detected that the business data corresponding to the target page in the server has changed; if it is detected based on the version information that the version number corresponding to the target application is a preset version number, the path configuration information is adjusted based on the changed business data.
[0078] In one embodiment, the acquisition module 70 is further used to obtain the historical display data of the target display element closest to the system time if the display data returned by the server is not received within a preset time; and fill the historical display data closest to the system time into the display position corresponding to the target display element in the page display template.
[0079] In one embodiment, the preset display position includes N preset display rows, where N is an integer greater than 0. The processing module 71 is specifically configured to, if it is detected that the number M of the display data is greater than N, obtain specified attribute information of the target display element, wherein each piece of the display data is used to fill one of the preset display rows, and M is an integer greater than 0; if it is determined based on the specified attribute information that the category of the target display element is a specified category, generate M display rows based on the display styles of the N preset display rows; replace the N preset display rows in the preset display position with the M display rows in the page display template, and fill the M display rows with the M pieces of display data, wherein each of the M pieces of display data is used to fill one of the M display rows.
[0080] In one embodiment, the processing module 71 is further configured to output an alarm message if it is determined based on the specified attribute information that the category of the target display element is not the specified category, wherein the alarm message is configured to indicate that the number M of display data is greater than the preset display rows N.
[0081] In one embodiment, the path configuration information includes a request path and a field path. The request path is used to send the data request to the server through the request path, and the field path is used to instruct the server to obtain the display data corresponding to the target display element from the business data according to the field path.
[0082] In one embodiment, the processing module 71 is specifically configured to locate the field path from the path configuration information; and adjust the field path based on the changed business data.
[0083] It should be noted that the functions of the functional modules of the data processing device described in the embodiment of the present invention can be based on Figure 3 or Figure 5 The specific implementation of the method in the method embodiment can be referred to Figure 3 or Figure 5 The relevant description of the method embodiment will not be repeated here.
[0084] See also Figure 8 , is a schematic diagram of the structure of a terminal device according to an embodiment of the present invention. The terminal device according to the embodiment of the present invention includes a power supply module and other structures, and includes a processor 801, a memory 802, a communication interface 803, and an output device 804. The processor 801, memory 802, communication interface 803, and output device 804 can exchange data, and the processor 801 implements the corresponding data processing functions.
[0085] The memory 802 may include volatile memory, such as random-access memory (RAM); non-volatile memory, such as flash memory, solid-state drive (SSD); or a combination of the aforementioned types of memory. Output device 804 may include a display (such as an LCD), speakers, and the like.
[0086] The processor 801 may be a central processing unit (CPU). In one embodiment, the processor 801 may also be a graphics processing unit (GPU). The processor 801 may also be a combination of a CPU and a GPU. In the terminal device, multiple CPUs and GPUs may be included as needed to perform corresponding image processing. In one embodiment, the memory 802 is used to store program instructions. The processor 801 may call the program instructions to implement the various methods involved in the above-mentioned embodiments of the present invention.
[0087] In a first possible implementation, the processor 801 of the terminal device calls the program instructions stored in the memory 802 to obtain template configuration data of the target page, where the template configuration data includes page configuration information of the target page and path configuration information of the target display element in the target page; generates a page display template corresponding to the target page based on the page configuration information; if it is detected that the business data corresponding to the target page in the server has changed, adjusts the path configuration information based on the changed business data; sends a data request carrying the adjusted path configuration information to the server through the communication interface 803 to instruct the server to obtain the display data corresponding to the target display element from the business data based on the adjusted path configuration information, and returns the display data to the terminal device, receives the display data returned by the server, and fills the display data into the preset display position corresponding to the target display element in the page display template.
[0088] In one embodiment, the processor 801 is also used to obtain the version information of the target application under the system time if it is detected that the business data corresponding to the target page in the server has changed; if it is detected based on the version information that the version number corresponding to the target application is a preset version number, the path configuration information is adjusted based on the changed business data.
[0089] In one embodiment, the processor 801 is further configured to obtain historical display data of the target display element closest to the system time if the display data returned by the server is not received within a preset time; and fill the display position corresponding to the target display element in the page display template with the historical display data closest to the system time.
[0090] In one embodiment, the preset display position includes N preset display rows, where N is an integer greater than 0. The processor 801 is specifically configured to, if it is detected that the number M of display data is greater than N, obtain specified attribute information of the target display element, wherein each piece of the display data is used to fill one of the preset display rows, and M is an integer greater than 0; if it is determined based on the specified attribute information that the category of the target display element is a specified category, generate M display rows based on the display styles of the N preset display rows; replace the N preset display rows in the preset display position with the M display rows in the page display template, and fill the M display rows with the M pieces of display data, wherein each of the M pieces of display data is used to fill one of the M display rows.
[0091] In one embodiment, the processor 801 is further used to output an alarm message through the output device 804 if it is determined based on the specified attribute information that the category of the target display element is not the specified category, and the alarm message is used to indicate that the number M of the display data is greater than the preset display row N.
[0092] In one embodiment, the path configuration information includes a request path and a field path. The request path is used to send the data request to the server through the request path, and the field path is used to instruct the server to obtain the display data corresponding to the target display element from the business data according to the field path.
[0093] In one embodiment, the processor 801 is specifically configured to locate the field path from the path configuration information; and adjust the field path based on the changed business data.
[0094] In a specific implementation, the processor 801, memory 802, communication interface 803 and output device 804 described in the embodiment of the present invention can execute the embodiment of the present invention. Figure 3 or Figure 5 The implementation described in the method embodiment can also execute the implementation of the data processing device described in the embodiment of the present invention, which will not be described in detail here.
[0095] In another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, implement the following: obtaining template configuration data of a target page, the template configuration data including page configuration information of the target page and path configuration information of a target display element in the target page; generating a page display template corresponding to the target page based on the page configuration information; if a change is detected in business data corresponding to the target page in a server, adjusting the path configuration information based on the changed business data; sending a data request carrying the adjusted path configuration information to the server to instruct the server to obtain display data corresponding to the target display element from the business data based on the adjusted path configuration information, and returning the display data to the terminal device; receiving the display data returned by the server, and filling the display data into a preset display position corresponding to the target display element in the page display template.
[0096] The computer-readable storage medium may be an internal storage unit of the terminal device described in any of the aforementioned embodiments, such as a hard disk or memory of the terminal device. The computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the terminal device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the terminal device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0097] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0098] The above disclosure is only part of the embodiments of the present invention, which certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that implementing all or part of the processes of the above embodiments and making equivalent changes in accordance with the claims of the present invention still fall within the scope of the invention.
Claims
1. A data processing method, characterized in that: The method is applied to a terminal device, and the method includes: Acquire template configuration data of a target page, the template configuration data including page configuration information of the target page and path configuration information of a target display element in the target page; Generate a page display template corresponding to the target page based on the page configuration information; If a change is detected in the business data corresponding to the target page in the server, the path configuration information is adjusted based on the changed business data; the path configuration information includes a request path and a field path, the request path indicating an interface for data interaction between the terminal device and the server, the request path being used to send a data request to the server via the request path, and the field path being used to instruct the server to obtain the display data corresponding to the target display element from the business data according to the field path; Sending a data request carrying the adjusted path configuration information to the server, to instruct the server to obtain display data corresponding to the target display element from the business data according to the adjusted path configuration information, and return the display data to the terminal device; receiving the display data returned by the server, and filling the display data into the preset display position corresponding to the target display element in the page display template; The preset display position includes N preset display rows, where N is an integer greater than 0. Filling the display data into the preset display position corresponding to the target display element in the page display template includes: If it is detected that the number M of the display data is greater than N, obtaining the specified attribute information of the target display element, wherein each piece of the display data is used to fill one of the preset display rows, and M is an integer greater than 0; If it is determined based on the specified attribute information that the category of the target display element is a specified category, then M display rows are generated based on the display styles of the N preset display rows; In the page display template, the N preset display rows in the preset display position are replaced by the M display rows, and the M pieces of display data are filled into the M display rows; each of the M pieces of display data is used to fill one of the M display rows; If it is determined based on the specified attribute information that the category of the target display element is not the specified category, an alarm message is output and the current page display template is not updated, so that the preset display position corresponding to the target display element displays the most recent historical display data, and the alarm message is used to indicate that the number M of the display data is greater than the preset display rows N.
2. The method according to claim 1, characterized in that The method further comprises: If it is detected that the business data corresponding to the target page in the server has changed, the version information of the target application under the system time is obtained; If it is detected based on the version information that the version number corresponding to the target application is a preset version number, the step of adjusting the path configuration information based on the changed business data is triggered.
3. The method according to claim 1 or 2, characterized in that After sending the data request carrying the adjusted path configuration information to the server, the method further includes: If the display data returned by the server is not received within a preset time, obtaining the historical display data of the target display element closest to the system time; In the page display template, the historical display data closest to the system time is filled into the display position corresponding to the target display element.
4. The method according to claim 1, wherein The adjusting the path configuration information based on the changed service data includes: Locating the field path from the path configuration information; The field path is adjusted based on the changed business data.
5. A data processing device, characterized in that: The device is configured in a terminal device, and includes: An acquisition module, configured to acquire template configuration data of a target page, wherein the template configuration data includes page configuration information of the target page and path configuration information of a target display element in the target page; a processing module, configured to generate a page display template corresponding to the target page based on the page configuration information, and, if a change is detected in the business data corresponding to the target page in the server, adjust the path configuration information based on the changed business data; the path configuration information includes a request path and a field path, the request path indicating an interface for data exchange between a terminal device and a server, the request path being used to send a data request to the server via the request path, and the field path being used to instruct the server to obtain display data corresponding to the target display element from the business data according to the field path; a communication module, configured to send a data request carrying the adjusted path configuration information to the server, to instruct the server to obtain display data corresponding to the target display element from the business data according to the adjusted path configuration information, and return the display data to the terminal device; The communication module is further configured to receive the display data returned by the server; The processing module is further configured to fill the display data into a preset display position corresponding to the target display element in the page display template; The preset display position includes N preset display rows, where N is an integer greater than 0. The processing module fills the display data into the preset display position corresponding to the target display element in the page display template, specifically for: If it is detected that the number M of the display data is greater than N, obtaining the specified attribute information of the target display element, wherein each piece of the display data is used to fill one of the preset display rows, and M is an integer greater than 0; If it is determined based on the specified attribute information that the category of the target display element is a specified category, then M display rows are generated based on the display styles of the N preset display rows; In the page display template, the N preset display rows in the preset display position are replaced by the M display rows, and the M pieces of display data are filled into the M display rows; each of the M pieces of display data is used to fill one of the M display rows; If it is determined based on the specified attribute information that the category of the target display element is not the specified category, an alarm message is output and the current page display template is not updated, so that the preset display position corresponding to the target display element displays the most recent historical display data, and the alarm message is used to indicate that the number M of the display data is greater than the preset display rows N.
6. A terminal device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Page display method and page display device
CN104391725A
Dynamic configuration method, device, computer device and storage medium for general purpose pages
CN109358919A