CN114253586A - Rendering method and device of user interface, storage medium and electronic device - Google Patents

Rendering method and device of user interface, storage medium and electronic device Download PDF

Info

Publication number
CN114253586A
CN114253586A CN202111496672.2A CN202111496672A CN114253586A CN 114253586 A CN114253586 A CN 114253586A CN 202111496672 A CN202111496672 A CN 202111496672A CN 114253586 A CN114253586 A CN 114253586A
Authority
CN
China
Prior art keywords
updated
target client
description file
version
user interface
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.)
Pending
Application number
CN202111496672.2A
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202111496672.2A priority Critical patent/CN114253586A/en
Publication of CN114253586A publication Critical patent/CN114253586A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a rendering method and device of a user interface, a storage medium and an electronic device, wherein the method comprises the following steps: determining whether an updated version exists in a hot update module of a target client in the case that the target client has been started; under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version; the description file to be updated is obtained according to the storage address, so that the target client is controlled to render the first user interface of the target client according to the description file to be updated.

Description

Rendering method and device of user interface, storage medium and electronic device
Technical Field
The invention relates to the field of communication, in particular to a rendering method and device of a user interface, a storage medium and an electronic device.
Background
And (2) using the Flutter to develop the user page in a cross-terminal manner, compiling the template code into an Abstract Syntax Tree (AST) description file by using the declaration programming characteristic of the Dart language and the construction mode of the Flutter UI, dynamically analyzing the AST description file when the APP runs, constructing a Widget object, and re-rendering the user page through the set State. Since Flutter does not support dynamic hot update, the release period of the APP version is frequent, and the APP version cannot respond to the changing business demand quickly. How to break the period of the release version suddenly, and under the condition of not releasing the release version, the method can quickly meet the changing business requirements and is compatible with performance experience, so that dynamic hot update under the Flutter ecology needs to be explored.
The Flutter official has introduced a Code Push scheme, specifically: and downloading a replaced Flutter compiling product, and replacing the compiling product under the APP installation catalog to realize dynamic updating. However, this scheme does not achieve satisfactory performance in implementing dynamic performance, and it has a safety hazard. In addition, the limitation of the scheme is obvious, the native-flute mixed app is not friendly to support, the business customization operation such as gray level and the like cannot be carried out, and the goals of universality and high performance cannot be met. Eventually the solution is called by the authority.
Aiming at the problems that the target client constructed by the Flutter cannot be dynamically updated and the like in the related technology, an effective solution is not provided yet.
Disclosure of Invention
The embodiment of the invention provides a rendering method and device of a user interface, a storage medium and an electronic device, which are used for at least solving the problems that a target client constructed by Flutter cannot be dynamically updated and the like in the related art.
According to an embodiment of the present invention, there is provided a rendering method of a user interface, including: determining whether an updated version exists in a hot update module of a target client in the case that the target client has been started; under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version; and acquiring the description file to be updated according to the storage address so as to control the target client to render a first user interface of the target client according to the description file to be updated.
In an exemplary embodiment, the obtaining a storage address of the description file to be updated corresponding to the updated version includes: sending a query request to a server corresponding to the target client, wherein the query request is used for requesting to query whether the server has an update version corresponding to the hot update module; and receiving the storage address of the description file to be updated, which is sent by the server side, under the condition that the server side determines that the update version corresponding to the hot update module exists in the server side according to the query request.
In an exemplary embodiment, sending the query request to the server corresponding to the target client includes: sending a query request including a timestamp of the current version and a version number of the current version to a server corresponding to the target client to indicate that the server determines whether the server has the updated version corresponding to the hot update module according to the timestamp and the version number of the description file to be updated and the timestamp and the version number of the current version; receiving a storage address of the description file to be updated corresponding to the update version sent by the server, including: and under the condition that the server determines that the updated version corresponding to the hot updating module exists in the server according to the timestamp and the version number of the to-be-updated description file, the timestamp and the version number of the current version, receiving a storage address of the to-be-updated description file corresponding to the updated version sent by the server, wherein the server receives the to-be-updated description file sent by a target object and stores the to-be-updated description file in the storage address corresponding to the server.
In an exemplary embodiment, after controlling the target client to render the first user interface of the target client according to the description file to be updated, the method further includes: analyzing the description file to be updated to obtain a global function, a global variable and a class file in the description file to be updated, wherein the class file comprises: local methods and local variables; pressing the global function, the global variable and the class file into corresponding variable stacks; and performing operation on the global variable and the local variable in the variable stack according to the global function and the local method so as to enable the target client to execute a corresponding business function.
In an exemplary embodiment, after performing an operation on the global variable and the local variable in the variable stack according to the global function and the local method, the method further includes: determining an operation result of performing operation on the global variable and the local variable in the variable stack; and rendering a second user interface of the target client according to the operation result.
In one exemplary embodiment, after determining whether an updated version exists for the hot update module of the target client, the method further comprises: under the condition that the hot updating module of the target client does not have an updating version, acquiring a description file of a current version stored by the target client; and controlling the target client to render the user interface of the target client according to the description file of the current version.
In an exemplary embodiment, controlling the target client to render the user interface of the target client according to the description file to be updated includes: analyzing the description file to be updated into a corresponding code program; and controlling the target client to execute the code program so as to render a user interface of the target client.
According to another embodiment of the present invention, there is also provided a rendering apparatus of a user interface, including: the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining whether an updated version exists in a hot updating module of a target client under the condition that the target client is started; the acquisition module is used for acquiring a storage address of the description file to be updated corresponding to the updated version under the condition that the hot update module of the target client has the updated version; and the control module is used for acquiring the description file to be updated according to the storage address so as to control the target client to render the first user interface of the target client according to the description file to be updated.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the rendering method of the user interface when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the rendering method of the user interface through the computer program.
In the embodiment of the invention, in the case that a target client is started, whether an updated version exists in a hot update module of the target client is determined; under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version; obtaining the description file to be updated according to the storage address so as to control the target client to render a first user interface of the target client according to the description file to be updated; the technical scheme is adopted, the problems that the target client constructed by the FLUTTER cannot be dynamically updated and the like are solved, the target client constructed by the FLUTTER has dynamic hot updating capability, service pain points can be well solved, and high-speed iterative service requirement service is provided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal of a rendering method of a user interface according to an embodiment of the present invention;
FIG. 2 is a flow chart of a rendering method of a user interface according to an embodiment of the present invention;
FIG. 3 is a flowchart of a rendering method of a user interface according to an alternative embodiment of the present invention;
FIG. 4 is a flow chart of a method of rendering a user interface according to an alternative embodiment of the invention;
fig. 5 is a block diagram of a rendering apparatus of a user interface according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal or a similar operation device. Taking the example of running on a computer terminal, fig. 1 is a hardware structure block diagram of a computer terminal of a rendering method of a user interface according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the rendering method of the user interface in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a rendering method of a user interface is provided, which is applied to the computer terminal, and fig. 2 is a flowchart of the rendering method of the user interface according to the embodiment of the present invention, where the flowchart includes the following steps:
step S202, under the condition that a target client is started, determining whether an update version exists in a hot update module of the target client;
step S204, under the condition that the hot updating module of the target client has an updating version, acquiring a storage address of the description file to be updated corresponding to the updating version;
step S206, the description file to be updated is obtained according to the storage address, so that the target client is controlled to render the first user interface of the target client according to the description file to be updated.
Through the steps, in the case that the target client is started, whether the hot update module of the target client has an updated version or not is determined; under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version; obtaining the description file to be updated according to the storage address so as to control the target client to render a first user interface of the target client according to the description file to be updated; the technical scheme is adopted, the problems that the target client constructed by the FLUTTER cannot be dynamically updated and the like are solved, the target client constructed by the FLUTTER has dynamic hot updating capability, service pain points can be well solved, and high-speed iterative service requirement service is provided.
In an exemplary embodiment, the obtaining a storage address of the description file to be updated corresponding to the updated version includes: sending a query request to a server corresponding to the target client, wherein the query request is used for requesting to query whether the server has an update version corresponding to the hot update module; and receiving the storage address of the description file to be updated, which is sent by the server side, under the condition that the server side determines that the update version corresponding to the hot update module exists in the server side according to the query request.
That is to say, the description file to be updated is stored in the server, and specifically, the developer compiles the compiled dart file into the description file to be updated; the method comprises the following steps that a Dart file can be converted into a description file to be updated through an SDK analyzer tool provided by a Dart official; the developer compresses the converted description file to be updated and uploads the compressed description file to the server through the AST management platform, the server stores the description file to be updated, and under the condition that a query request which is sent by the client and used for requesting to query whether the update version corresponding to the hot update module exists at the server is received, whether the update version corresponding to the hot update module exists at the server is determined according to whether the description file to be updated is stored at the server; and under the condition that the update version corresponding to the hot update module exists, sending a storage address of the description file to be updated stored by the server to the client.
In an exemplary embodiment, sending the query request to the server corresponding to the target client includes: sending a query request including a timestamp of the current version and a version number of the current version to a server corresponding to the target client to indicate that the server determines whether the server has the updated version corresponding to the hot update module according to the timestamp and the version number of the description file to be updated and the timestamp and the version number of the current version; receiving a storage address of the description file to be updated corresponding to the update version sent by the server, including: and under the condition that the server determines that the updated version corresponding to the hot updating module exists in the server according to the timestamp and the version number of the to-be-updated description file, the timestamp and the version number of the current version, receiving a storage address of the to-be-updated description file corresponding to the updated version sent by the server, wherein the server receives the to-be-updated description file sent by a target object and stores the to-be-updated description file in the storage address corresponding to the server.
Specifically, the query request sent by the client further includes: a timestamp of the current version and a version number of the current version; the server determines whether the description file stored in the server is the description file to be updated or not according to the timestamp and the version number of the description file of the current version sent by the client and the timestamp and the version number of the description file stored in the server; under the condition that the description file stored by the server is determined to be the description file to be updated, sending the storage address of the description file to be updated corresponding to the updated version to the client, wherein the developer compiles the compiled dart file into the description file to be updated (such as an AST description file); the method comprises the following steps that a Dart file can be converted into a description file to be updated through an SDK analyzer tool provided by a Dart official; the developer uploads the converted description file to be updated to the server through the AST management platform after compressing, and the compression packet is named in a form of 'timestamp _ version number', so that different description files can be distinguished according to the corresponding names of the description files; and the server stores the uploaded compressed packet of the description file to be updated.
In an exemplary embodiment, after controlling the target client to render the first user interface of the target client according to the description file to be updated, the method further includes: analyzing the description file to be updated to obtain a global function, a global variable and a class file in the description file to be updated, wherein the class file comprises: local methods and local variables; pressing the global function, the global variable and the class file into corresponding variable stacks; and performing operation on the global variable and the local variable in the variable stack according to the global function and the local method so as to enable the target client to execute a corresponding business function.
Specifically, reading a description file to be updated, gradually analyzing the description file to be updated, specifically, analyzing a global function and a global variable in the description file to be updated, and pressing the global function into a variable stack; analyzing a class file in the description file to be updated, and pressing the class file into a variable stack; analyzing the methods and variables in the classes, and pressing the methods and variables into variable stacks; executing logic in the code block according to variable values in the variable stack, and performing operation on the global variables and the variables in the class files; so that the target client executes the corresponding service function.
In an exemplary embodiment, after performing an operation on the global variable and the local variable in the variable stack according to the global function and the local method, the method further includes: determining an operation result of performing operation on the global variable and the local variable in the variable stack; and rendering a second user interface of the target client according to the operation result.
That is to say, according to the variable values in the variable stack, the logic in the code block is executed, the operation is performed on the global variables and the variables in the class file, the obtained operation result is sent to the client, and then the user interface is rendered again according to the operation result.
In one exemplary embodiment, after determining whether an updated version exists for the hot update module of the target client, the method further comprises: under the condition that the hot updating module of the target client does not have an updating version, acquiring a description file of a current version stored by the target client; and controlling the target client to render the user interface of the target client according to the description file of the current version.
Namely, under the condition that the server side does not update the version, the compressed package of the description file of the current version preset locally is used for UI rendering; it should be noted that, when the client acquires the description file at the server, the description file is cached in the local database, so that the acquisition of the description file at the server is reduced during subsequent access, and the access speed of the module is increased.
In an exemplary embodiment, controlling the target client to render the user interface of the target client according to the description file to be updated includes: analyzing the description file to be updated into a corresponding code program; and controlling the target client to execute the code program so as to render a user interface of the target client.
In other words, the developer compiles the template code into an AST description file by using the declarative programming characteristics of the Dart language and the construction mode of the Flutter UI, and then dynamically parses the AST description file when the client runs, and parses the description file into the corresponding Dart code to construct the Widget object, and then re-renders the user interface through setState.
In order to better understand the process of the rendering method of the user interface, the following describes a flow of the implementation method of the rendering of the user interface with reference to an optional embodiment, but is not limited to the technical solution of the embodiment of the present invention.
In this embodiment, a rendering method of a user interface is provided, and fig. 3 is a flowchart (one) of a rendering method of a user interface according to an alternative embodiment of the present invention, as shown in fig. 3, specifically including the following steps:
step S301: a developer develops and writes a dart code;
it should be noted that after the developer develops and writes the dart code, there is no problem in the local testing.
Step S302: the developer compiles the compiled dart file into an AST description file (equivalent to the description file to be updated in the above embodiment); converting the Dart file into an AST description file through an SDK analyzer tool provided by the Dart official;
step S303: a developer compresses the converted AST description file and uploads the compressed AST description file to a server (equivalent to a server in the embodiment) through an AST management platform, a compression package needs to be named in a form of 'timestamp _ version number', and the name corresponding to the AST description file needs to be determined when the compression package is uploaded for the first time, so that different description files can be distinguished;
step S304: the server stores the compressed package of the AST description file uploaded;
step S305: a user starts a client and enters a corresponding hot updating module;
step S306: the client actively requests the server for whether a new version exists;
step S307: the server side determines whether a new version exists;
step S308: if the new version does not exist, performing UI (user interface) rendering by using a locally preset compression package;
step S309: if the new version is updated, returning the storage address of the compressed packet of the description file of the latest version;
step S310: the client reads the storage address, acquires a compressed packet of the latest AST description file through the storage address, and decompresses the compressed packet to obtain the latest AST description file; the client caches the latest AST description file to improve the access speed of the module;
step S311: and the client analyzes the AST description file, analyzes the description file into a corresponding dart code and performs UI rendering.
Step S312: the client executes the service logic in the description file through the AST runtime and re-renders the UI.
The specific steps of step S312 are as follows: fig. 4 is a flowchart (ii) of a rendering method of a user interface according to an alternative embodiment of the present invention, as shown in fig. 4:
step S401: starting;
step S402: reading the AST description file;
step S403: analyzing a Global Function (Global Function) and a Global Variable (Global Variable) in the AST description file, and pushing the Global Function to a Variable stack;
step S404: analyzing a Class (Class) in the AST description file, and pushing the Class into a variable stack;
step S405: analyzing a Method (Class Method) and a Variable (Class Variable) in the Class, and pushing the Method and the Variable to a Variable stack;
step S406: executing logic in the code block according to variable values in the variable stack, and performing operation on the variables;
step S407: taking out the return value variable in the variable stack, and returning the value corresponding to the return value variable;
step S408: and (6) ending.
It should be noted that step S405 may not be executed after step S404 is executed, and there is no order relationship between step S404 and step S405.
Through the steps, in the case that the target client is started, whether the hot update module of the target client has an updated version or not is determined; under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version; obtaining the description file to be updated according to the storage address so as to control the target client to render a first user interface of the target client according to the description file to be updated; the technical scheme is adopted, the problems that the target client constructed by the FLUTTER cannot be dynamically updated and the like are solved, the target client constructed by the FLUTTER has dynamic hot updating capability, service pain points can be well solved, and high-speed iterative service requirement service is provided.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a rendering apparatus of a user interface is further provided, and the rendering apparatus of the user interface is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated after the description is given. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
FIG. 5 is a block diagram of a rendering apparatus of a user interface according to an embodiment of the present invention; as shown in fig. 5, includes:
a determining module 52, configured to determine whether an updated version exists in a hot update module of a target client in a case that the target client has been started;
an obtaining module 54, configured to obtain, when an update version exists in a hot update module of the target client, a storage address of a to-be-updated description file corresponding to the update version;
and the control module 56 is configured to obtain the description file to be updated according to the storage address, so as to control the target client to render the first user interface of the target client according to the description file to be updated.
By the device, in the condition that a target client is started, whether an updated version exists in a hot updating module of the target client is determined; under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version; obtaining the description file to be updated according to the storage address so as to control the target client to render a first user interface of the target client according to the description file to be updated; the technical scheme is adopted, the problems that the target client constructed by the FLUTTER cannot be dynamically updated and the like are solved, the target client constructed by the FLUTTER has dynamic hot updating capability, service pain points can be well solved, and high-speed iterative service requirement service is provided.
In an exemplary embodiment, the obtaining module is further configured to send an inquiry request to a server corresponding to the target client, where the inquiry request is used to request to inquire whether the server has an update version corresponding to the hot update module; and receiving the storage address of the description file to be updated, which is sent by the server side, under the condition that the server side determines that the update version corresponding to the hot update module exists in the server side according to the query request.
In an exemplary embodiment, the obtaining module is further configured to send, to a server corresponding to the target client, a query request including a timestamp of a current version and a version number of the current version, so as to instruct the server to determine, according to the timestamp and the version number of the to-be-updated description file, the timestamp of the current version and the version number of the current version, whether the update version corresponding to the hot update module exists at the server; receiving a storage address of the description file to be updated corresponding to the update version sent by the server, including: and under the condition that the server determines that the updated version corresponding to the hot updating module exists in the server according to the timestamp and the version number of the to-be-updated description file, the timestamp and the version number of the current version, receiving a storage address of the to-be-updated description file corresponding to the updated version sent by the server, wherein the server receives the to-be-updated description file sent by a target object and stores the to-be-updated description file in the storage address corresponding to the server.
In an exemplary embodiment, the apparatus further includes: the analysis module is configured to analyze the description file to be updated to obtain a global function, a global variable, and a class file in the description file to be updated, where the class file includes: local methods and local variables; pressing the global function, the global variable and the class file into corresponding variable stacks; and performing operation on the global variable and the local variable in the variable stack according to the global function and the local method so as to enable the target client to execute a corresponding business function.
In an exemplary embodiment, the control module is further configured to determine an operation result of performing an operation on the global variable and the local variable in the variable stack; and rendering a second user interface of the target client according to the operation result.
In an exemplary embodiment, the control module is further configured to, in a case that there is no updated version in the hot update module of the target client, obtain a description file of a current version stored by the target client; and controlling the target client to render the user interface of the target client according to the description file of the current version.
In an exemplary embodiment, the control module is further configured to parse the description file to be updated into a corresponding code program; and controlling the target client to execute the code program so as to render a user interface of the target client.
An embodiment of the present invention further provides a storage medium including a stored program, wherein the program executes any one of the methods described above.
Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
s1, in the case that the target client is started, determining whether the hot update module of the target client has an updated version;
s2, acquiring the storage address of the description file to be updated corresponding to the updated version under the condition that the hot update module of the target client has the updated version;
s3, the description file to be updated is obtained according to the storage address, so that the target client is controlled to render the first user interface of the target client according to the description file to be updated.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, in the case that the target client is started, determining whether the hot update module of the target client has an updated version;
s2, acquiring the storage address of the description file to be updated corresponding to the updated version under the condition that the hot update module of the target client has the updated version;
s3, the description file to be updated is obtained according to the storage address, so that the target client is controlled to render the first user interface of the target client according to the description file to be updated.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A rendering method of a user interface is applied to a target client constructed by Flutter, and is characterized by comprising the following steps:
determining whether an updated version exists in a hot update module of a target client in the case that the target client has been started;
under the condition that an update version exists in a hot update module of the target client, acquiring a storage address of a description file to be updated corresponding to the update version;
and acquiring the description file to be updated according to the storage address so as to control the target client to render a first user interface of the target client according to the description file to be updated.
2. The rendering method of the user interface according to claim 1, wherein obtaining a storage address of the description file to be updated corresponding to the updated version comprises:
sending a query request to a server corresponding to the target client, wherein the query request is used for requesting to query whether the server has an update version corresponding to the hot update module;
and receiving the storage address of the description file to be updated, which is sent by the server side, under the condition that the server side determines that the update version corresponding to the hot update module exists in the server side according to the query request.
3. The rendering method of the user interface according to claim 2, wherein sending the query request to the server corresponding to the target client comprises:
sending a query request including a timestamp of the current version and a version number of the current version to a server corresponding to the target client to indicate that the server determines whether the server has the updated version corresponding to the hot update module according to the timestamp and the version number of the description file to be updated and the timestamp and the version number of the current version;
receiving a storage address of the description file to be updated corresponding to the update version sent by the server, including:
and under the condition that the server determines that the updated version corresponding to the hot updating module exists in the server according to the timestamp and the version number of the to-be-updated description file, the timestamp and the version number of the current version, receiving a storage address of the to-be-updated description file corresponding to the updated version sent by the server, wherein the server receives the to-be-updated description file sent by a target object and stores the to-be-updated description file in the storage address corresponding to the server.
4. The method for rendering the user interface according to claim 1, wherein after controlling the target client to render the first user interface of the target client according to the description file to be updated, the method further comprises:
analyzing the description file to be updated to obtain a global function, a global variable and a class file in the description file to be updated, wherein the class file comprises: local methods and local variables;
pressing the global function, the global variable and the class file into corresponding variable stacks;
and performing operation on the global variable and the local variable in the variable stack according to the global function and the local method so as to enable the target client to execute a corresponding business function.
5. The rendering method of a user interface according to claim 4, wherein after performing an operation on the global variable and the local variable in the variable stack according to the global function and the local method, the method further comprises:
determining an operation result of performing operation on the global variable and the local variable in the variable stack;
and rendering a second user interface of the target client according to the operation result.
6. The method of rendering a user interface of claim 1, wherein after determining whether an updated version exists for the hot update module of the target client, the method further comprises:
under the condition that the hot updating module of the target client does not have an updating version, acquiring a description file of a current version stored by the target client;
and controlling the target client to render the user interface of the target client according to the description file of the current version.
7. The method for rendering the user interface according to claim 1, wherein controlling the target client to render the user interface of the target client according to the description file to be updated comprises:
analyzing the description file to be updated into a corresponding code program;
and controlling the target client to execute the code program so as to render a user interface of the target client.
8. An apparatus for rendering a user interface, comprising:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining whether an updated version exists in a hot updating module of a target client under the condition that the target client is started;
the acquisition module is used for acquiring a storage address of the description file to be updated corresponding to the updated version under the condition that the hot update module of the target client has the updated version;
and the control module is used for acquiring the description file to be updated according to the storage address so as to control the target client to render the first user interface of the target client according to the description file to be updated.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202111496672.2A 2021-12-08 2021-12-08 Rendering method and device of user interface, storage medium and electronic device Pending CN114253586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111496672.2A CN114253586A (en) 2021-12-08 2021-12-08 Rendering method and device of user interface, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111496672.2A CN114253586A (en) 2021-12-08 2021-12-08 Rendering method and device of user interface, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN114253586A true CN114253586A (en) 2022-03-29

Family

ID=80791866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111496672.2A Pending CN114253586A (en) 2021-12-08 2021-12-08 Rendering method and device of user interface, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN114253586A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115113962A (en) * 2022-06-17 2022-09-27 北京城市网邻信息技术有限公司 Interface skipping method and device, electronic equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115113962A (en) * 2022-06-17 2022-09-27 北京城市网邻信息技术有限公司 Interface skipping method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN109618176B (en) Processing method, equipment and storage medium for live broadcast service
CN113064685A (en) H5 page loading method and device
CN111885115A (en) Equipment binding change method and device
CN112631622A (en) Application installation method and device, server and computer readable medium
CN112632420A (en) Interface skipping method and device, storage medium and electronic device
CN113467832A (en) Equipment control processing method, device, storage medium and electronic device
CN114756306A (en) Service calling method, device, equipment and storage medium
CN113434230A (en) Jump control method and device for H5 page, storage medium and electronic device
CN114253586A (en) Rendering method and device of user interface, storage medium and electronic device
CN113067853A (en) Data pushing method and device, electronic equipment and storage medium
CN111176706A (en) Terminal upgrading method and device, electronic equipment and storage medium
CN111552484A (en) Application package distribution method, device, equipment and storage medium
CN110569129A (en) Resource allocation method and device, storage medium and electronic device
CN113495765A (en) Business data filling method and device, storage medium and electronic device
CN110990381B (en) Processing method and device of server, storage medium and electronic device
CN115129574A (en) Code testing method and device
CN114253441B (en) Method and device for enabling target function, storage medium and electronic device
CN113190565B (en) Data updating method and device, storage medium and electronic device
CN113572816B (en) Equipment control processing method and device, storage medium and electronic device
CN114090074A (en) Method and device for configuring operating environment, storage medium and electronic device
CN112698948A (en) Method and device for acquiring product resources, storage medium and electronic device
CN115878443A (en) Interface test script generation method and device, storage medium and electronic device
CN112651523A (en) Event determination method and device, storage medium and electronic device
CN113434525A (en) Cache data updating method and device, storage medium and electronic device
CN112131505A (en) Data storage processing method and device, storage medium and electronic device

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