CN113656719A - Data rendering method, system, electronic device and storage medium - Google Patents

Data rendering method, system, electronic device and storage medium Download PDF

Info

Publication number
CN113656719A
CN113656719A CN202110960822.4A CN202110960822A CN113656719A CN 113656719 A CN113656719 A CN 113656719A CN 202110960822 A CN202110960822 A CN 202110960822A CN 113656719 A CN113656719 A CN 113656719A
Authority
CN
China
Prior art keywords
data
rule
data rendering
target
target page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110960822.4A
Other languages
Chinese (zh)
Other versions
CN113656719B (en
Inventor
赵延飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202110960822.4A priority Critical patent/CN113656719B/en
Publication of CN113656719A publication Critical patent/CN113656719A/en
Application granted granted Critical
Publication of CN113656719B publication Critical patent/CN113656719B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure provides a data rendering method, a system, an electronic device and a storage medium, the method includes receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request; calling a first rule engine containing a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine; and transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.

Description

Data rendering method, system, electronic device and storage medium
Technical Field
The present disclosure relates to the field of network communication technologies, and in particular, to a data rendering method, system, electronic device, and storage medium.
Background
The data rendering is a process of acquiring webpage resources according to the URL address of the internet webpage and finally outputting a visualization result. The data rendering is mainly divided into two modes of client-side rendering and server-side rendering.
The realization process of the server-side rendering is as follows: the client requests an address URL, the server receives the request, acquires corresponding data from a database or other places according to the request information, renders the data into an HTML page by using a template engine, and finally returns the HTML page to the client.
The realization mode of the server-side rendering needs to embed the HTML codes of the client side into the codes of the server side, so that the rendering speed can be improved to a certain extent, but the codes of the client side and the codes of the server side are mixed together, so that debugging and automatic testing are inconvenient, the construction ecology of the client side cannot be fully used, the development efficiency is low, and the project is difficult to manage and maintain.
Disclosure of Invention
To solve the problems in the prior art, the present disclosure provides a data rendering method, system, electronic device, and storage medium.
A first aspect of the present disclosure provides a data rendering method, including:
receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request;
calling a first rule engine containing a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.
According to a data rendering method provided by the present disclosure, the invoking a first rule engine including a first data rendering rule expression, so that the first rule engine obtains target data according to the first data rendering rule expression, includes:
invoking a first rules engine comprising a first data rendering rule expression, such that the first rules engine performs the following operations in accordance with the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data;
the first parameter is obtained based on a client; the second parameter is a parameter set at the server side.
According to a data rendering method provided by the present disclosure, before the invoking a first rule engine including a first data rendering rule expression according to the identification information of the target page and the first binding relationship, the method further includes:
determining a first data rendering rule according to a service scene of a target page;
setting the first data rendering rule expression according to the first data rendering rule;
defining a variable for the first data rendering regular expression, the variable corresponding to the first parameter and/or the second parameter;
determining a first rule engine according to the defined first data rendering rule expression.
According to a data rendering method provided by the present disclosure, after the determining the first rule engine, the method further comprises:
and binding the identification information of the target page with the first rule engine to obtain a first binding relationship.
According to a data rendering method provided by the present disclosure,
the method comprises the steps of calling a first rule engine containing a first data rendering rule expression so that the first rule engine executes the following operations according to the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data, wherein the acquiring comprises the following steps:
calling a first rule engine comprising a first data rendering rule expression so that the first rule engine gives a first parameter and/or a second parameter to a variable in the first data rendering rule expression, and further acquiring candidate data from a data interface; and performing logic processing on the candidate data according to the logic relation described by the first data rendering rule expression to obtain target data.
According to a data rendering method provided by the present disclosure, the first rule engine including a first data rendering rule expression is called, so that the first rule engine performs the following operations according to the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data, wherein the acquiring comprises the following steps:
calling a first rule engine comprising a first data rendering rule expression so that the first rule engine classifies a plurality of first data rendering rule expressions with the same variable into one class, executing an operation of giving a first parameter and/or a second parameter to the variable in the first data rendering rule expression once for the plurality of first data rendering rule expressions of the same class, further acquiring candidate data from a data interface, and then respectively acquiring target data according to the plurality of first data rendering rule expressions of the same class based on the candidate data.
According to the data rendering method provided by the disclosure, the first data rendering rule expression is described by using an SpEL expression language.
The second aspect of the present disclosure further provides a data rendering method, applied to a client, where the method includes:
generating a data acquisition request of a target page; the data acquisition request comprises identification information of a target page;
sending a data acquisition request of the target page to a server side, so that the server side calls a first rule engine comprising a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enabling the first rule engine to acquire target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and receiving target data, and then generating and displaying a target page according to the target data.
A third aspect of the present disclosure provides a data rendering system, including a server and a client; wherein,
the server side is configured to execute the steps of the data rendering method according to the first aspect of the disclosure;
the client is configured to perform the steps of the data rendering method according to the second aspect of the present disclosure.
The present disclosure also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the data rendering method according to the first aspect of the present disclosure when executing the program; or implementing the steps of the data rendering method according to the second aspect of the disclosure.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the data rendering method according to the first aspect of the present disclosure; or implementing the steps of the data rendering method according to the second aspect of the disclosure.
According to the data rendering method, the data rendering system, the electronic device and the storage medium, the corresponding rule engine is called at the server side through the data acquisition request of the target page, the rule engine obtains target data from the data interface according to the corresponding data rendering rule expression and parameters, and then the target page is generated and displayed at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is one of the flow diagrams of a data rendering method provided by the present disclosure;
fig. 2 is a second schematic flowchart of a data rendering method provided in the present disclosure;
FIG. 3 is a schematic diagram of a server-side architecture in a data rendering system provided by the present disclosure;
FIG. 4 is a schematic structural diagram of a client in a data rendering system provided by the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device provided by the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
The data rendering method, system, electronic device and storage medium of the embodiments of the present disclosure are described below with reference to fig. 1 to 5.
Fig. 1 is a flowchart of a data rendering method provided by the present disclosure, and as shown in fig. 1, the data rendering method provided by the present disclosure is applied to a server side, and the method includes:
step 101, receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request.
In this embodiment, the internet page to be generated is referred to as a target page. As is known to those skilled in the art, a data retrieval request is typically sent by a client (e.g., a browser) via an address URL when generating a target page. The data acquisition request describes how to acquire data required for generating the target page.
Specifically, the data acquisition request may include identification information of the target page. The identification information of the target page is the marking information for distinguishing the target page from other pages, and the identification information of the target page may be a unique number and/or letter symbol, or may be a storage address of the target page data, which is not specifically limited in this disclosure.
Optionally, the data obtaining request may further include a first parameter according to a requirement of a service scenario corresponding to the target page. The first parameter is a parameter obtained based on a client. The user information can be user information input by a user through equipment (such as a smart phone, a computer and the like) where a client is located, such as a unique ID of the user, a name of the user and the like; or information of the device where the client is located, such as an identification number of the device, information of a geographic location where the device is currently located, and the like. In the following description, the application of the first parameter will be further explained.
Step 102, according to the identification information of the target page and the first binding relationship, calling a first rule engine containing a first data rendering rule expression, so that the first rule engine obtains target data according to the first data rendering rule expression.
A rules engine is a component embedded in an internet page that receives data input, interprets business rules, and makes business decisions based on the business rules. In the present embodiment, the rule engine embedded in the target page code is referred to as a first rule engine. The number of the first rule engines is not limited to one, and the specific number thereof may be determined according to the business scenario of the target page.
In the preset first binding relationship, the identification information of the target page is already bound with the first rule engine, so that the first rule engine can be obtained by searching the first binding relationship based on the identification information of the target page obtained in the data acquisition request.
The first rule engine includes a data rendering rule expression. The data rendering rule expression can access the context of the page and the objects in different action domains, obtain the values of the object attributes, and execute operation or judgment operation. In this embodiment, the data rendering rule expression related to the target page in the first rule engine is recorded as the first data rendering rule expression. The first data rendering rule expression may be one or more, and the specific number thereof may be determined according to the business scenario of the target page.
The first data rendering rule expression may be implemented in various forms of expression languages, such as el (expression Language) expression, OGNL (Object Graph Navigation Language) expression, linguistic expression of a threemeleaf template, and so on. In this embodiment, the first data rendering rule Expression is implemented by using a spring Expression language. The SpEL expression language can be independently operated without Spring, supports mathematics, relation, logic, conditional operators, sets and regular expressions, can also inject bean or bean attributes into another bean, also supports method calling of the bean, and is more suitable for scenes with separated client and server sides, such as data rendering.
After invoking the first rule engine, the first rule engine will perform the relevant operation according to the first data rendering rule expression.
Specifically, first, the first parameter and/or the second parameter is/are given to relevant variables in the first data rendering rule expression, and then candidate data are obtained from the data interface.
The meaning of the first parameter has already been explained in the foregoing description, and in the present embodiment, the second parameter is a parameter set at the server side. Generally, the second parameter is set by the operation and maintenance personnel of the target webpage at the server side, and the second parameter is usually information required for querying the data interface. The data interface described in this embodiment is a data interface corresponding to data required by the target web page.
For example, in a target web page, user A may input user identification information indicating that the target web page is capable of showing the amount of positions taken for the plurality of financial products B, C, D that the user A holds. In this example, the ID of user a is the first parameter uploaded by the client, the identification information of financial product B, C, D is the second parameter configured by the operation and maintenance personnel at the server, and the data interface is the data interface related to the position taken amount. The position information of the financial product B, C, D held by user A (e.g., user A holds financial product B ten thousand dollars, user A holds financial product C five thousand dollars, and user A holds financial product D six thousand dollars) is the data returned by the data interface based on the user ID and the identification information of the financial product.
The service scenario reflected by the target web page is not limited to the above example, and may also be: inquiring user information through the user ID, inquiring income conditions of different financial products in each time period through the user ID and the time interval, inquiring detailed information of the products through the product ID and the like. When the service scenes are different, the required first parameter, the required second parameter and the required data interface are different, and the data returned by the data interface are also different.
Further, in the above example, the candidate data is acquired from the data interface based on the first parameter and the second parameter at the same time. In practical applications, however, the candidate data may also be obtained from the data interface based on the first parameter or the second parameter alone.
And then, carrying out logic processing on the candidate data according to the logic relation described by the first data rendering rule expression to obtain target data.
After the candidate data is obtained from the data interface, in this step, the candidate data is further subjected to logic processing according to the logical relationship described by the first data rendering rule expression, so as to obtain the target data. Taking the previous example as an example, after the position information of the financial product B, C, D held by user A has been obtained from the data interface, in this step, the position information of different financial products may be arranged according to the logical relationship described by the first data rendering rule expression to obtain a normalized target data. In other embodiments, the logic processing on the candidate data according to the logical relationship described by the first data rendering rule expression may also be in other implementation forms, such as performing logic judgment according to the candidate data, giving corresponding display information (the display information is target data) according to a logic judgment result, and further selecting from the candidate data, and taking a final result after selection as the target data.
For example, in another target web page, after the user inputs the user identification information, it is desirable to obtain the coupon availability of the user.
In this example, the user ID is a first parameter, and the condition parameter (whether there is a threshold) is a second parameter.
The first data rendering rule expression corresponding to the target webpage in the first rule engine is as follows:
the method name (user ID, threshold or not) | null and @ service interface the method name (user ID, threshold or not). get ('success') and @ service interface the method name (user ID, threshold or not)? @ service interface, method name (user ID, threshold or not), get ('value'). get ('coupon'). get ('data'): no coupon currently }
According to the expression, information of the coupon (including the coupon with the use threshold and the coupon without the use threshold) can be acquired from a data interface related to the coupon based on the first parameter and the second parameter, then the logic judgment is carried out on the coupon information of the user according to the logic relation described by the first data rendering rule expression, if the coupon with the use threshold is available, the information of the coupon with the use threshold is used as target data, and if the coupon with the use threshold is not available, the display information of 'no coupon currently' is used as the target data.
And 103, transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.
The target data generated by the first rules engine is dynamic data that needs to be displayed at the client as part of the target page. The specific implementation process of generating and displaying the target page according to the target data is common knowledge of those skilled in the art, and therefore, the description is not repeated in this embodiment.
According to the data rendering method, the corresponding rule engine is called at the server side through the data acquisition request of the target page, the rule engine obtains target data from the data interface according to the corresponding data rendering rule expression and parameters, and then the target page is generated and displayed at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
Based on any one of the above embodiments, in this embodiment, the invoking a first rule engine including a first data rendering rule expression, so that the first rule engine obtains target data according to the first data rendering rule expression, includes:
invoking a first rules engine comprising a first data rendering rule expression, such that the first rules engine performs the following operations in accordance with the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data;
the first parameter is obtained based on a client; the second parameter is a parameter set at the server side.
According to the data rendering method, the corresponding rule engine is called at the server side through the data acquisition request of the target page, the rule engine obtains target data from the data interface according to the corresponding data rendering rule expression and parameters, and then the target page is generated and displayed at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
Based on any of the foregoing embodiments, in this embodiment, before the invoking a first rule engine including a first data rendering rule expression according to the identification information of the target page and the first binding relationship, the method further includes:
determining a first data rendering rule according to a service scene of a target page;
setting the first data rendering rule expression according to the first data rendering rule;
defining a variable for the first data rendering regular expression, the variable corresponding to the first parameter and/or the second parameter;
determining a first rule engine according to the defined first data rendering rule expression.
In the previous embodiment, the first rule engine and the first data rendering rule expression in the first rule engine are predefined and can be directly invoked when data rendering is performed. In this embodiment, a description is given of a first rule engine and a definition process of a first data rendering rule expression in the first rule engine.
For example, the target page is a web page of a shopping website, and the business scene of the target page is information that needs to show recommended goods to the user. Due to different preferences of different users, the target page can display different recommended commodities according to different users.
The information of the recommended article is related not only to the user but also to the category of the candidate article. For example, when the same user browses the home appliance goods web page and the clothing goods web page, the information of the recommended goods to be displayed on the shopping website web page should be different.
Thus, the information of recommended merchandise displayed on the webpage of the shopping website is related to two types of factors: user, category of candidate item.
Based on the service scene of the target page, the first data rendering rule set for the target page is as follows: and generating a picture of the recommended commodity, the name of the recommended commodity and the price of the recommended commodity according to the types of the user and the candidate commodity.
The first data rendering rule expression may be set based on the first data rendering rule and a grammar rule of an expression language. In setting the first data rendering regular expression, it is necessary to define a variable for the first data rendering regular expression, the variable corresponding to the first parameter and/or the second parameter.
One example of a first data rendering rule expression is:
and (4) commodity pictures: method name (user ID, goods ID) get (' picUrl '): bottom data ' }
The commodity name is as follows: # { @ Business interface method name (user ID, Commodity ID). get (' name '): bottom data ' }
Price of the commodity: the method name (user ID, goods ID) get (' price '): bottom data ' }.
Here, a and b in the "method names (a and b)" are variables, which correspond to the first parameter "user ID" and the second parameter "article ID".
A first rule engine may be generated based on the defined first data rendering rule expression. The data rendering regular expressions included in the first rule engine may not be limited to the foregoing examples, and may include other data rendering regular expressions.
According to the data rendering method, the first data rendering rule expression and the first rule engine are defined according to the service scene of the target page, so that the server side can meet diversified data display requirements of the client side, and the definition of the data rendering rule expression and the definition of the rule engine have relatively uniform specifications, so that the definition process can be quickly realized, and the development amount of the server side is reduced.
Based on any one of the above embodiments, in this embodiment, after the determining the first rule engine, the method further includes:
and binding the identification information of the target page with the first rule engine to obtain a first binding relationship.
In the previous embodiments, it was described how the first rules engine is defined. The first rule engine and the target page have a corresponding relationship, and in order to enable the server to know the corresponding relationship, the first rule engine needs to be bound with the target page in the process of generating the target page. In this embodiment, the identification information of the target page is bound with the first rule engine, so as to obtain a first binding relationship capable of reflecting the binding relationship between the two.
According to the data rendering method, the identification information of the target page is bound with the first rule engine, so that the first rule engine can be called in time in the generation process of the target page, and target data required by the target page generation are obtained.
Based on any one of the above embodiments, in this embodiment, the first rule engine including the first data rendering rule expression is called, so that the first rule engine performs the following operations according to the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data, wherein the acquiring comprises the following steps:
calling a first rule engine comprising a first data rendering rule expression so that the first rule engine classifies a plurality of first data rendering rule expressions with the same variable into one class, executing an operation of giving a first parameter and/or a second parameter to the variable in the first data rendering rule expression once for the plurality of first data rendering rule expressions of the same class, further acquiring candidate data from a data interface, and then respectively acquiring target data according to the plurality of first data rendering rule expressions of the same class based on the candidate data.
In this disclosure, the data rendering regular expressions corresponding to the target page are all referred to as first data rendering regular expressions. There may be multiple pieces of the first data rendering rule expression contained in the first rule engine. There may be differences in the content of different first data rendering regular expressions. The difference may be a difference between variables corresponding to the first parameter and/or the second parameter in different expressions, or a difference between logic semantics of different expressions.
If the logic semantics of different expressions are different but the variables of the expressions are the same, the process of obtaining the candidate data from the data interface by the expressions according to the first parameter and/or the second parameter is actually the same, and only the subsequent processing process of the candidate data is different.
In this case, in the present embodiment, the plurality of first data rendering rule expressions are sorted. Namely: and for the plurality of first data rendering regular expressions of the same class, the operation of endowing the first parameter and/or the second parameter to the variable in the first data rendering regular expression only needs to be executed once, and then candidate data is obtained from a data interface. The candidate data obtained by one operation can be further processed according to different first data rendering rule expressions in the same class to respectively obtain different target data.
For example, there are three first data rendering rule expressions:
and (4) commodity pictures: method name (user ID, goods ID) get (' picUrl '): bottom data ' }
The commodity name is as follows: # { @ Business interface method name (user ID, Commodity ID). get (' name '): bottom data ' }
Price of the commodity: the method name (user ID, goods ID) get (' price '): bottom data ' }.
The variables in the three expressions are the same, namely, the user ID and the commodity ID are used as the variables. The same product information can be obtained from the data interface based on the same user ID and product ID. The commodity information includes picture information of the commodity, name information of the commodity, and price information of the commodity. However, different expressions have different logical meanings, and finally, target data generated by the expressions are different. For example, according to the expression of the commodity picture, the picture information of the commodity is selected from the commodity information; selecting name information of the commodity from the commodity information according to an expression of the commodity name; according to the expression of the commodity price, the price information of the commodity is selected from the commodity information.
According to the data rendering method, the expressions in the first rule engine are classified and sorted, so that the number of interactive operations between the first rule engine and the data interface is reduced, and the purpose of improving the processing efficiency is achieved.
Fig. 2 is a second flowchart of the data rendering method provided by the present disclosure, and as shown in fig. 2, the data rendering method provided by the present disclosure is applied to a client, and the method includes:
step 201, generating a data acquisition request of a target page; the data acquisition request comprises identification information of a target page.
In this embodiment, the internet page to be generated is referred to as a target page. As known to those skilled in the art, when a user wishes to browse a target page, a data acquisition request is generally sent from the user to a server via a client (e.g., a browser). The data acquisition request may be in the form of an address URL. The data acquisition request describes how to acquire data required for generating the target page.
The data acquisition request may include identification information of the target page. Optionally, the first parameter may also be included. The first parameter is a parameter obtained based on a client.
Step 202, sending a data acquisition request of the target page to a server, so that the server invokes a first rule engine comprising a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enables the first rule engine to acquire target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine.
In the present embodiment, the rule engine embedded in the target page code is referred to as a first rule engine.
In the preset first binding relationship, the identification information of the target page is already bound with the first rule engine, so that the first rule engine can be obtained by searching the first binding relationship based on the identification information of the target page obtained in the data acquisition request.
The first rule engine includes a data rendering rule expression. The data rendering rule expression can access the context of the page and the objects in different action domains, obtain the values of the object attributes, and execute operation or judgment operation. In this embodiment, the data rendering rule expression related to the target page in the first rule engine is recorded as the first data rendering rule expression.
After invoking the first rule engine, the first rule engine will perform the relevant operation according to the first data rendering rule expression.
Specifically, first, the first parameter and/or the second parameter is/are given to relevant variables in the first data rendering rule expression, and then candidate data are obtained from the data interface.
And then, carrying out logic processing on the candidate data according to the logic relation described by the first data rendering rule expression to obtain target data.
Step 203, receiving the target data, and then generating and displaying a target page according to the target data.
The target data generated by the first rules engine is dynamic data that is displayed at the client as part of the target page. The specific implementation process of generating and displaying the target page according to the target data is common knowledge of those skilled in the art, and therefore, the description is not repeated in this embodiment.
According to the data rendering method, the corresponding rule engine is called at the server side through the data acquisition request of the target page, the rule engine obtains target data from the data interface according to the corresponding data rendering rule expression and parameters, and then the target page is generated and displayed at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
The data rendering system provided by the embodiment of the present disclosure is described below, and the data rendering system described below and the data rendering method described above may be referred to correspondingly.
The data rendering system provided by the disclosure comprises a server side and a client side, wherein the server side is in communication connection with the client side.
Fig. 3 is a schematic diagram of a server side in the data rendering system provided in the present disclosure, and as shown in fig. 3, the server side includes:
a request receiving and analyzing module 301, configured to receive a data obtaining request of a target page, and determine identification information of the target page according to the data obtaining request;
a data obtaining module 302, configured to invoke a first rule engine including a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
a data sending module 303, configured to transmit the target data to a client, so that the client generates a target page according to the target data and displays the target page.
The data rendering system calls the corresponding rule engine at the server side through the data acquisition request of the target page, obtains target data from the data interface according to the corresponding data rendering rule expression and parameters by the rule engine, and further generates the target page and displays the target page at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
Based on any one of the above embodiments, in this embodiment, the data obtaining module is configured to:
invoking a first rules engine comprising a first data rendering rule expression, such that the first rules engine performs the following operations in accordance with the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data;
the first parameter is obtained based on a client; the second parameter is a parameter set at the server side.
The data rendering device provided by the disclosure calls the corresponding rule engine at the server side through the data acquisition request of the target page, and the rule engine obtains the target data from the data interface according to the corresponding data rendering rule expression and parameters, so as to generate the target page and display the target page at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
Based on any one of the above embodiments, in this embodiment, the server further includes:
the rule determining module is used for determining a first data rendering rule according to the service scene of the target page;
a rule expression setting module, configured to set the first data rendering rule expression according to the first data rendering rule;
a variable definition module, configured to define a variable for the first data rendering regular expression, where the variable corresponds to the first parameter and/or the second parameter;
and the rule engine determining module is used for determining a first rule engine according to the defined first data rendering rule expression.
The data rendering system defines the first data rendering rule expression and the first rule engine according to the business scene of the target page, so that the server side can meet diversified data display requirements of the client side, and the definition of the data rendering rule expression and the definition of the rule engine have relatively uniform specifications, so that the definition process can be quickly realized, and the development amount of the server side is reduced.
Based on any one of the above embodiments, in this embodiment, the server further includes:
and the binding module is used for binding the identification information of the target page with the first rule engine to obtain a first binding relationship.
The data rendering system provided by the disclosure binds the identification information of the target page with the first rule engine, so that the first rule engine can be called in time in the generation process of the target page, and target data required by the target page generation is obtained.
Based on any one of the above embodiments, in this embodiment, the data obtaining module is configured to:
calling a first rule engine containing a first data rendering rule expression so that the first rule engine classifies a plurality of first data rendering rule expressions with the same variable into one class, executing an operation of giving the first parameter and/or the second parameter to the variable in the first data rendering rule expression once for the plurality of first data rendering rule expressions of the same class, further acquiring candidate data from a data interface, and then respectively acquiring target data according to the plurality of first data rendering rule expressions of the same class based on the candidate data.
The data rendering system provided by the disclosure is beneficial to reducing the interactive operation times between the first rule engine and the data interface by classifying and sorting the expression in the first rule engine, so that the purpose of improving the processing efficiency is achieved.
Fig. 4 is a schematic diagram of a client in a data rendering system provided in the present disclosure, as shown in fig. 4, the client includes:
a request generating module 401, configured to generate a data obtaining request of a target page; the data acquisition request comprises identification information of a target page;
a request sending module 402, configured to send a data obtaining request of the target page to a server, so that the server invokes a first rule engine including a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enables the first rule engine to obtain target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and a display module 403, configured to receive the target data, generate a target page according to the target data, and display the target page.
The data rendering system calls the corresponding rule engine at the server side through the data acquisition request of the target page, obtains target data from the data interface according to the corresponding data rendering rule expression and parameters by the rule engine, and further generates the target page and displays the target page at the client side. The process realizes the separation of the client code and the server code for data rendering, and the rule engine of the server uniformly realizes the acquisition process of the target data, so that the debugging and the automatic testing are facilitated, the development efficiency is improved, and the management and maintenance difficulty is reduced.
Fig. 5 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 5: a processor (processor)510, a communication Interface (Communications Interface)520, a memory (memory)530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 530 communicate with each other via the communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a data rendering method comprising:
receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request;
calling a first rule engine containing a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.
Or comprises the following steps:
generating a data acquisition request of a target page; the data acquisition request comprises identification information of a target page;
sending a data acquisition request of the target page to a server side, so that the server side calls a first rule engine comprising a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enabling the first rule engine to acquire target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and receiving target data, and then generating and displaying a target page according to the target data.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present disclosure also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the data rendering method provided by the above methods, the method comprising:
receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request;
calling a first rule engine containing a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.
Or comprises the following steps:
generating a data acquisition request of a target page; the data acquisition request comprises identification information of a target page;
sending a data acquisition request of the target page to a server side, so that the server side calls a first rule engine comprising a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enabling the first rule engine to acquire target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and receiving target data, and then generating and displaying a target page according to the target data.
In yet another aspect, the present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the data rendering method provided above, the method comprising:
receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request;
calling a first rule engine containing a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.
Or comprises the following steps:
generating a data acquisition request of a target page; the data acquisition request comprises identification information of a target page;
sending a data acquisition request of the target page to a server side, so that the server side calls a first rule engine comprising a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enabling the first rule engine to acquire target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and receiving target data, and then generating and displaying a target page according to the target data.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (11)

1. A data rendering method is applied to a server side, and comprises the following steps:
receiving a data acquisition request of a target page, and determining identification information of the target page according to the data acquisition request;
calling a first rule engine containing a first data rendering rule expression according to the identification information of the target page and the first binding relationship, so that the first rule engine obtains target data according to the first data rendering rule expression; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine; and transmitting the target data to a client so that the client generates a target page according to the target data and displays the target page.
2. The data rendering method of claim 1, wherein the invoking a first rule engine including a first data rendering rule expression, so that the first rule engine obtains target data according to the first data rendering rule expression, comprises:
invoking a first rules engine comprising a first data rendering rule expression, such that the first rules engine performs the following operations in accordance with the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data;
the first parameter is obtained based on a client; the second parameter is a parameter set at the server side.
3. The data rendering method of claim 2, wherein before the invoking of the first rule engine including the first data rendering rule expression according to the identification information of the target page and the first binding relationship, the method further comprises:
determining a first data rendering rule according to a service scene of a target page;
setting the first data rendering rule expression according to the first data rendering rule;
defining a variable for the first data rendering regular expression, the variable corresponding to the first parameter and/or the second parameter;
determining a first rule engine according to the defined first data rendering rule expression.
4. The data rendering method of claim 3, wherein after the determining the first rule engine, the method further comprises:
and binding the identification information of the target page with the first rule engine to obtain a first binding relationship.
5. The data rendering method of claim 2, wherein the invoking of the first rule engine comprising the first data rendering rule expression causes the first rule engine to perform the following operations in accordance with the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data, wherein the acquiring comprises the following steps:
calling a first rule engine comprising a first data rendering rule expression so that the first rule engine gives a first parameter and/or a second parameter to a variable in the first data rendering rule expression, and further acquiring candidate data from a data interface; and performing logic processing on the candidate data according to the logic relation described by the first data rendering rule expression to obtain target data.
6. The data rendering method of claim 2, wherein the invoking of the first rule engine comprising the first data rendering rule expression causes the first rule engine to perform the following operations in accordance with the first data rendering rule expression: acquiring candidate data from a data interface according to the first parameter and/or the second parameter, and then acquiring target data based on the candidate data, wherein the acquiring comprises the following steps:
calling a first rule engine comprising a first data rendering rule expression so that the first rule engine classifies a plurality of first data rendering rule expressions with the same variable into one class, executing an operation of giving a first parameter and/or a second parameter to the variable in the first data rendering rule expression once for the plurality of first data rendering rule expressions of the same class, further acquiring candidate data from a data interface, and then respectively acquiring target data according to the plurality of first data rendering rule expressions of the same class based on the candidate data.
7. The data rendering method of claim 1, wherein the first data rendering rule expression is described in a SpEL expression language.
8. A data rendering method is applied to a client, and comprises the following steps:
generating a data acquisition request of a target page; the data acquisition request comprises identification information of a target page;
sending a data acquisition request of the target page to a server side, so that the server side calls a first rule engine comprising a first data rendering rule expression according to the identification information of the target page and the first binding relationship, and further enabling the first rule engine to acquire target data according to the first data rendering rule expression and return the target data; the first binding relationship is used for describing the binding relationship between the identification information of the target page and the first rule engine;
and receiving target data, and then generating and displaying a target page according to the target data.
9. A data rendering system is characterized by comprising a server side and a client side; wherein,
the server side, configured to perform the steps of the data rendering method according to any one of claims 1 to 7;
the client for performing the steps of the data rendering method of claim 8.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of the data rendering method according to any of claims 1 to 7 or performs the steps of the data rendering method according to claim 8.
11. A non-transitory computer readable storage medium, having stored thereon a computer program, which, when being executed by a processor, carries out the steps of the data rendering method according to any one of claims 1 to 7, or carries out the steps of the data rendering method according to claim 8.
CN202110960822.4A 2021-08-20 2021-08-20 Data rendering method, system, electronic device and storage medium Active CN113656719B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110960822.4A CN113656719B (en) 2021-08-20 2021-08-20 Data rendering method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110960822.4A CN113656719B (en) 2021-08-20 2021-08-20 Data rendering method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113656719A true CN113656719A (en) 2021-11-16
CN113656719B CN113656719B (en) 2024-04-05

Family

ID=78480554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110960822.4A Active CN113656719B (en) 2021-08-20 2021-08-20 Data rendering method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113656719B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817804A (en) * 2022-03-31 2022-07-29 北京达佳互联信息技术有限公司 Webpage generation method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8392245B1 (en) * 2000-09-29 2013-03-05 Jda Software Group, Inc. System and method for rendering content according to availability data for one or more items
KR20130080536A (en) * 2012-01-05 2013-07-15 (주)이스트소프트 Web-browser for automatic change of rendering engine, method of automatic change of rendering engine
US20160019350A1 (en) * 2014-06-26 2016-01-21 Koninklijke Philips N.V. Visually rendering longitudinal patient data
CN108287708A (en) * 2017-12-22 2018-07-17 深圳市云智融科技有限公司 A kind of data processing method, device, server and computer readable storage medium
US20180210715A1 (en) * 2017-01-25 2018-07-26 Wal-Mart Stores, Inc. Systems, method, and non-transitory computer-readable storage media for generating code for displaying a webpage
US10452981B1 (en) * 2011-06-30 2019-10-22 Allscripts Software, Llc Clinical decision support systems, apparatus, and methods
CN113032702A (en) * 2019-12-06 2021-06-25 北京沃东天骏信息技术有限公司 Page loading method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8392245B1 (en) * 2000-09-29 2013-03-05 Jda Software Group, Inc. System and method for rendering content according to availability data for one or more items
US10452981B1 (en) * 2011-06-30 2019-10-22 Allscripts Software, Llc Clinical decision support systems, apparatus, and methods
KR20130080536A (en) * 2012-01-05 2013-07-15 (주)이스트소프트 Web-browser for automatic change of rendering engine, method of automatic change of rendering engine
US20160019350A1 (en) * 2014-06-26 2016-01-21 Koninklijke Philips N.V. Visually rendering longitudinal patient data
US20180210715A1 (en) * 2017-01-25 2018-07-26 Wal-Mart Stores, Inc. Systems, method, and non-transitory computer-readable storage media for generating code for displaying a webpage
CN108287708A (en) * 2017-12-22 2018-07-17 深圳市云智融科技有限公司 A kind of data processing method, device, server and computer readable storage medium
CN113032702A (en) * 2019-12-06 2021-06-25 北京沃东天骏信息技术有限公司 Page loading method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢用辉: "保险IT***建设", 首都经济贸易大学出版社, pages: 140 - 141 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817804A (en) * 2022-03-31 2022-07-29 北京达佳互联信息技术有限公司 Webpage generation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113656719B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN109145078B (en) The application page of the machine application is indexed
US10678516B2 (en) Chatbot builder user interface
CN110930186B (en) System, method, device, equipment and storage medium for task display
CN111428131B (en) Information pushing method, device and system
CN104579909B (en) Method and equipment for classifying user information and acquiring user grouping information
JP2009181468A (en) Image search log collection system, image search log collection method and program
US9135316B2 (en) Information providing device, method, program, information display device, method, program, information search system, and recording medium for enhanced search results
CN111274516B (en) Page display method, page configuration method and device
CN110968314B (en) Page generation method and device
CN112740228A (en) Visual search engine
CN114239504A (en) Form configuration method, device, equipment, readable storage medium and program product
CN113626624B (en) Resource identification method and related device
CN113656719B (en) Data rendering method, system, electronic device and storage medium
US20120323702A1 (en) System and method for client-server cooperation in selecting content for display
CN113656737A (en) Webpage content display method and device, electronic equipment and storage medium
CN111753056A (en) Information pushing method and device, computing equipment and computer readable storage medium
CN115061785A (en) Information issuing method and device, storage medium and server
CN111125501B (en) Method and device for processing information
CN112540820A (en) User interface updating method and device and electronic equipment
CN113779403A (en) Book information acquisition method, book information display method, server and user terminal
US10839430B1 (en) Systems, methods and computer program products for populating field identifiers from telephonic or electronic automated conversation, generating or modifying elements of telephonic or electronic automated conversation based on values from field identifiers
KR20220053398A (en) Service System for Connecting and Recommending Clothing Products by Using AI
CN113076428B (en) Book list generation method and device
US12050634B2 (en) Method and apparatus for distributing content across platforms, device and storage medium
CN111870937B (en) Data processing method, simulation server and timeliness application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant