CN113722037B - User interface refreshing method and device, electronic equipment and storage medium - Google Patents

User interface refreshing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113722037B
CN113722037B CN202111032217.7A CN202111032217A CN113722037B CN 113722037 B CN113722037 B CN 113722037B CN 202111032217 A CN202111032217 A CN 202111032217A CN 113722037 B CN113722037 B CN 113722037B
Authority
CN
China
Prior art keywords
business logic
window
message queue
logic
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.)
Active
Application number
CN202111032217.7A
Other languages
Chinese (zh)
Other versions
CN113722037A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111032217.7A priority Critical patent/CN113722037B/en
Publication of CN113722037A publication Critical patent/CN113722037A/en
Application granted granted Critical
Publication of CN113722037B publication Critical patent/CN113722037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/545Gui
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure provides a refreshing method and device of a user interface, electronic equipment and a storage medium, and relates to the technical field of computer application, in particular to a user interface technology. The specific implementation scheme is as follows: acquiring current business logic by calling a sub-thread; if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; repeatedly executing the operation until the business logic with the updating requirement of the user interface is pushed to the message queue; if at least one business logic exists in the message queue, executing each business logic in the message queue one by calling the main thread; and synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics. The method and the device can asynchronously execute each business logic through the message queue and synchronously refresh the user interface based on the execution result, so that the development flow can be simplified, the development efficiency can be improved, and the product maintenance cost can be reduced.

Description

User interface refreshing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computer application, and further relates to a user interface technology, in particular to a refreshing method and device of a user interface, electronic equipment and a storage medium.
Background
A User Interface (UI) is a medium for interaction and information exchange between a system and a User, and it implements conversion between an internal form of information and a human acceptable form. The user interface is designed to be interactive communication related software between the user and the hardware, so that the user can conveniently and effectively operate the hardware to achieve bidirectional interaction, the work expected to be completed by the hardware is completed, the user interface is widely defined and comprises a man-machine interaction and a graphic user interface, and the user interface exists in the field of information communication between human beings and machines.
Disclosure of Invention
The disclosure provides a refreshing method and device of a user interface, electronic equipment and a storage medium.
In a first aspect, the present application provides a method for refreshing a user interface, the method comprising:
acquiring current business logic by calling a sub-thread;
if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling the sub-thread; repeatedly executing the operation until each business logic with the updating requirement of the user interface is pushed to the message queue;
if at least one business logic exists in the message queue, each business logic in the message queue is executed one by calling a main thread, and an execution result of each business logic is obtained;
and synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics.
In a second aspect, the present application provides a user interface refreshing apparatus, the apparatus comprising: the device comprises an acquisition module, a pushing module, an execution module and a refreshing module; wherein,,
the acquisition module is used for acquiring the current business logic by calling the sub-thread;
the pushing module is used for pushing the current business logic into the message queue by calling the sub-thread if the current business logic has the updating requirement of the user interface; repeatedly executing the operation until each business logic with the updating requirement of the user interface is pushed to the message queue;
the execution module is used for executing each business logic in the message queue one by calling a main thread if at least one business logic exists in the message queue, so as to obtain an execution result of each business logic;
and the refreshing module is used for synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
a memory for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for refreshing a user interface according to any embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a storage medium having stored thereon a computer program, which when executed by a processor implements the method for refreshing a user interface according to any embodiment of the present application.
In a fifth aspect, a computer program product is provided, which when executed by a computer device implements a method of refreshing a user interface according to any embodiment of the application.
According to the technical scheme provided by the application, each business logic can be asynchronously executed through the message queue, and then the user interface is synchronously refreshed based on the execution result, so that the development flow can be simplified, the development efficiency can be improved, and the product maintenance cost can be reduced.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a first flow chart of a method for refreshing a user interface according to an embodiment of the present application;
FIG. 2 is a second flow chart of a method for refreshing a user interface according to an embodiment of the present application;
FIG. 3 is a third flow chart of a method for refreshing a user interface according to an embodiment of the present application
FIG. 4 is a schematic structural diagram of a refreshing device for a user interface according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing a method of refreshing a user interface in accordance with an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Example 1
Fig. 1 is a schematic flow chart of a method for refreshing a user interface according to an embodiment of the present application, where the method may be performed by a refreshing device or an electronic device of the user interface, where the device or the electronic device may be implemented in software and/or hardware, and where the device or the electronic device may be integrated into any intelligent device with a network communication function. As shown in fig. 1, the method for refreshing a user interface may include the steps of:
s101, acquiring current business logic by calling a sub-thread.
In this step, the electronic device may obtain the current service logic by calling the sub-thread. Specifically, a developer can write a service logic first, and the electronic device can acquire the service logic through calling a sub-thread, and the service logic is used as the current service logic; or, the developer may write a plurality of service logics, and the electronic device may obtain the plurality of service logics by calling the sub-thread, and use each service logic in the plurality of service logics as the current service logic respectively.
S102, if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; the above operations are repeatedly performed until each business logic with the update requirement of the user interface is pushed to the message queue.
In the step, if the current business logic has the update requirement of the user interface, the electronic equipment can push the current business logic into the message queue by calling the sub-thread; the above operations are repeatedly performed until each business logic with the update requirement of the user interface is pushed to the message queue. Specifically, the electronic device may detect whether the current service logic has an update requirement of the user interface, and if the current service logic has an update requirement of the user interface, the electronic device may push the current service logic into the message queue; if the current business logic does not have the update requirement of the user interface, the electronic device can repeatedly execute the operation by taking the next business logic as the current business logic until the business logic with the update requirement of the user interface is pushed to the message queue.
S103, if at least one business logic exists in the message queue, each business logic in the message queue is executed one by calling the main thread, and an execution result of each business logic is obtained.
In this step, if at least one service logic exists in the message queue, each service logic in the message queue is executed one by calling the main thread, and an execution result of each service logic is obtained. Specifically, the electronic device may assemble one or more business logic in the message queue into a task package by invoking the main thread; then transmitting the task package from the window where the message queue is located to the execution window of each business logic; unpacking the task package in the execution window of each service logic to obtain each service logic in the task package; and executing each business logic in the task package one by one to obtain an execution result of each business logic.
S104, synchronously refreshing user interfaces corresponding to the business logics based on execution results of the business logics.
In this step, the electronic device may synchronously refresh the user interfaces corresponding to the respective service logics based on the execution results of the respective service logics. Specifically, the electronic device may first extract one service logic from all service logics as a current service logic; then synchronously refreshing the user interface corresponding to the current business logic based on the execution result of the current business logic; and repeatedly executing the operation until refreshing the user interfaces corresponding to the business logics.
In practical development, in many cases, developers put some logic (such as input and output operations, network requests, etc.) that takes a long time into threads for processing, and after the processing is finished, the user interface needs to be synchronously refreshed to prompt the user. The inventor researches and discovers that for the development of the Windows client, the action of directly operating the UI in the sub-thread brings potential safety hazards, and the operation on the UI thread increases the safety. The prior art scheme has several obvious disadvantages: 1) Development difficulty: the developer needs to define a plurality of related IDs to realize related logic, so that the complexity of codes is increased; and specific window support is necessary, further increasing code complexity. 2) Maintenance is difficult: the logic in the same interface needs to jump to another place, which brings great complexity to maintenance.
The refreshing method of the user interface provided by the embodiment of the application comprises the steps of firstly, acquiring current business logic by calling a sub-thread; if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; if at least one business logic exists in the message queue, each business logic in the message queue is executed one by calling a main thread, and an execution result of each business logic is obtained; and synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics. That is, the present application may push each business logic with update requirements for the user interface into the message queue and then refresh the user interface based on the message queue without defining an ID for each business logic. In the existing user interface refreshing method, an ID needs to be defined for each service logic, and the complexity of codes is increased. Because the application adopts the technical means of asynchronously executing service logic based on the message queue and synchronously refreshing the user interface, the technical problems of difficult development and difficult maintenance in the prior art are overcome, and the technical scheme provided by the application can asynchronously execute each service logic through the message queue and synchronously refresh the user interface based on the execution result, thereby simplifying the development flow, improving the development efficiency and reducing the product maintenance cost; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example two
Fig. 2 is a second flow chart of a method for refreshing a user interface according to an embodiment of the present application. Further optimization and expansion based on the above technical solution can be combined with the above various alternative embodiments. As shown in fig. 2, the refreshing method of the user interface may include the steps of:
s201, acquiring current business logic by calling a sub-thread.
In the specific embodiment of the application, before the electronic device acquires the current business logic by calling the sub-thread, the electronic device can register a global Windows window based on a Windows operating system, and the Windows window is used as a message processing center; executing the operation of acquiring the current business logic by calling the sub-thread in the message processing center; wherein the Windows window is a window in a 32-bit environment of the Windows operating system.
S202, if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; the above operations are repeatedly performed until each business logic with the update requirement of the user interface is pushed to the message queue.
S203, if at least one business logic exists in the message queue, one or more business logic in the message queue is assembled into a task packet by calling the main thread.
In this step, if at least one service logic exists in the message queue, the electronic device may assemble one or more service logic in the message queue into a task packet by invoking the main thread. Specifically, the electronic device may assemble one service logic in the message queue into one task packet, or may assemble two or more service logics in the message queue into one task packet, which may be set by a developer according to the service requirement, and is not limited herein.
S204, transmitting the task packet from the window where the message queue is located to the execution window of each business logic.
In this step, the electronic device may transfer the task packet from the window in which the message queue is located to the execution window of each business logic. Specifically, the electronic device may transfer the task package from the window in which the message queue is located to the execution window of each business logic based on a specific function in the user program interface; wherein the specific function includes: postMessage functions and GetMessage functions. Further, the electronic device may first send, in a window where the message queue is located, a task packet from the window where the message queue is located to an execution window of each service logic through a PostMessage function; the task package is then received through the GetMessage function in the execution window of each business logic.
S205, unpacking the task package in the execution window of each business logic to obtain each business logic in the task package.
In this step, the electronic device may unpack the task packet in the execution window of each service logic to obtain each service logic in the task packet. Specifically, the electronic device may use a preset decryption algorithm to unpack the task packet in the execution window of each service logic, so as to obtain each service logic in the task packet.
S206, executing each business logic in the task package one by one to obtain an execution result of each business logic.
In this step, the electronic device may execute each service logic in the task packet one by one, to obtain an execution result of each service logic. For example, assume that there are three business logics in the task packet, namely business logic 1, business logic 2 and business logic 3; in this step, the electronic device may execute the service logic 1 first, to obtain an execution result of the service logic 1; then executing the service logic 2 to obtain an execution result of the service logic 2; and executing the service logic 3 to obtain an execution result of the service logic 3.
S207, synchronously refreshing user interfaces corresponding to the business logics based on execution results of the business logics.
In this step, the electronic device may synchronously refresh the user interfaces corresponding to the respective service logics based on the execution results of the respective service logics. Specifically, the electronic device may first extract one service logic from all service logics as a current service logic; then synchronously refreshing the user interface corresponding to the current business logic based on the execution result of the current business logic; and repeatedly executing the operation until refreshing the user interfaces corresponding to the business logics.
The refreshing method of the user interface provided by the embodiment of the application comprises the steps of firstly, acquiring current business logic by calling a sub-thread; if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; if at least one business logic exists in the message queue, each business logic in the message queue is executed one by calling a main thread, and an execution result of each business logic is obtained; and synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics. That is, the present application may push each business logic with update requirements for the user interface into the message queue and then refresh the user interface based on the message queue without defining an ID for each business logic. In the existing user interface refreshing method, an ID needs to be defined for each service logic, and the complexity of codes is increased. Because the application adopts the technical means of asynchronously executing service logic based on the message queue and synchronously refreshing the user interface, the technical problems of difficult development and difficult maintenance in the prior art are overcome, and the technical scheme provided by the application can asynchronously execute each service logic through the message queue and synchronously refresh the user interface based on the execution result, thereby simplifying the development flow, improving the development efficiency and reducing the product maintenance cost; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example III
Fig. 3 is a third flow chart of a method for refreshing a user interface according to an embodiment of the present application. Further optimization and expansion based on the above technical solution can be combined with the above various alternative embodiments. As shown in fig. 3, the refreshing method of the user interface may include the steps of:
s301, acquiring current business logic by calling a sub-thread.
S302, if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; the above operations are repeatedly performed until each business logic with the update requirement of the user interface is pushed to the message queue.
S303, if at least one business logic exists in the message queue, one or more business logic in the message queue is assembled into a task packet by calling the main thread.
S304, based on a specific function in the user program interface, the task package is transferred to the execution window of each business logic from the window where the message queue is located.
In this step, the electronic device may transfer the task packet from the window where the message queue is located to the execution window of each business logic based on a specific function in the user program interface; wherein the specific function includes: postMessage functions and GetMessage functions. Specifically, the electronic device may first send, in a window where the message queue is located, a task packet from the window where the message queue is located to an execution window of each service logic through a PostMessage function; the task package is then received through the GetMessage function in the execution window of each business logic.
S305, unpacking the task package in the execution window of each business logic to obtain each business logic in the task package.
In this step, the electronic device may unpack the task packet in the execution window of each service logic to obtain each service logic in the task packet. Specifically, the electronic device may use a preset decryption algorithm to unpack the task packet in the execution window of each service logic, so as to obtain each service logic in the task packet.
S306, executing each business logic in the task package one by one to obtain an execution result of each business logic.
In this step, the electronic device may execute each service logic in the task packet one by one, to obtain an execution result of each service logic. For example, assume that there are three business logics in the task packet, namely business logic 1, business logic 2 and business logic 3; in this step, the electronic device may execute the service logic 1 first, to obtain an execution result of the service logic 1; then executing the service logic 2 to obtain an execution result of the service logic 2; and executing the service logic 3 to obtain an execution result of the service logic 3.
S307, synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics.
In this step, the electronic device may synchronously refresh the user interfaces corresponding to the respective service logics based on the execution results of the respective service logics. Specifically, the electronic device may first extract one service logic from all service logics as a current service logic; then synchronously refreshing the user interface corresponding to the current business logic based on the execution result of the current business logic; and repeatedly executing the operation until refreshing the user interfaces corresponding to the business logics.
The refreshing method of the user interface provided by the embodiment of the application comprises the steps of firstly, acquiring current business logic by calling a sub-thread; if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling a sub-thread; if at least one business logic exists in the message queue, each business logic in the message queue is executed one by calling a main thread, and an execution result of each business logic is obtained; and synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics. That is, the present application may push each business logic with update requirements for the user interface into the message queue and then refresh the user interface based on the message queue without defining an ID for each business logic. In the existing user interface refreshing method, an ID needs to be defined for each service logic, and the complexity of codes is increased. Because the application adopts the technical means of asynchronously executing service logic based on the message queue and synchronously refreshing the user interface, the technical problems of difficult development and difficult maintenance in the prior art are overcome, and the technical scheme provided by the application can asynchronously execute each service logic through the message queue and synchronously refresh the user interface based on the execution result, thereby simplifying the development flow, improving the development efficiency and reducing the product maintenance cost; in addition, the technical scheme of the embodiment of the application is simple and convenient to realize, convenient to popularize and wider in application range.
Example IV
Fig. 4 is a schematic structural diagram of a user interface refreshing device according to an embodiment of the present application. As shown in fig. 4, the apparatus 400 includes: an acquisition module 401, a push module 402, an execution module 403 and a refresh module 404; wherein,,
the obtaining module 401 is configured to obtain a current service logic by calling a sub-thread;
the pushing module 402 is configured to, if the current service logic has an update requirement of a user interface, push the current service logic to a message queue by calling the sub-thread; repeatedly executing the operation until each business logic with the updating requirement of the user interface is pushed to the message queue;
the executing module 403 is configured to, if at least one service logic exists in the message queue, execute each service logic in the message queue one by calling a main thread, so as to obtain an execution result of each service logic;
the refreshing module 404 is configured to synchronously refresh the user interfaces corresponding to the service logics based on the execution results of the service logics.
Further, the device further comprises: a registration module 405 (not shown in the figure) configured to register a global Windows window based on a Windows operating system, and use the Windows window as a message processing center; executing the operation of acquiring the current business logic by calling a sub-thread in the message processing center; the Windows window is a window in a 32-bit environment of a Windows operating system.
Further, the execution module 403 is specifically configured to assemble one or more service logics in the message queue into a task packet by calling the main thread; transmitting the task package from the window where the message queue is located to the execution window of each business logic; unpacking the task package in an execution window of each service logic to obtain each service logic in the task package; and executing each business logic in the task package one by one to obtain an execution result of each business logic.
Further, the execution module 403 is specifically configured to transfer, based on a specific function in a user program interface, the task packet from a window where the message queue is located to an execution window of each service logic; wherein the specific function includes: postMessage functions and GetMessage functions.
Further, the executing module 403 is specifically configured to send, in a window where the message queue is located, the task packet from the window where the message queue is located to an executing window of each service logic through the PostMessage function; and receiving the task package through the GetMessage function in an execution window of each business logic.
Further, the refreshing module 404 is specifically configured to extract one service logic from all service logics as a current service logic; synchronously refreshing a user interface corresponding to the current business logic based on an execution result of the current business logic; and repeatedly executing the operation until refreshing the user interfaces corresponding to the business logics.
The refreshing device of the user interface can execute the method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in this embodiment may refer to the method for refreshing a user interface provided in any embodiment of the present application.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
Example five
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 5 illustrates a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 includes a computing unit 501 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, ROM 502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, etc.; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508 such as a magnetic disk, an optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as a refresh method of a user interface. For example, in some embodiments, the method of refreshing a user interface may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the user interface refresh method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the refresh method of the user interface in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (12)

1. A method of refreshing a user interface, the method comprising:
acquiring current business logic by calling a sub-thread;
if the current business logic has the updating requirement of the user interface, pushing the current business logic into a message queue by calling the sub-thread; repeatedly executing the operation until each business logic with the updating requirement of the user interface is pushed to the message queue;
if at least one business logic exists in the message queue, one or more business logic in the message queue is assembled into a task packet by calling a main thread; transmitting the task package from the window where the message queue is located to the execution window of each business logic; unpacking the task package in an execution window of each service logic to obtain each service logic in the task package; executing each business logic in the task package one by one to obtain an execution result of each business logic;
and synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics.
2. The method of claim 1, wherein prior to the obtaining current business logic by invoking a sub-thread, the method further comprises:
registering a global Windows window based on a Windows operating system, and taking the Windows window as a message processing center; executing the operation of acquiring the current business logic by calling a sub-thread in the message processing center; the Windows window is a window in a 32-bit environment of a Windows operating system.
3. The method of claim 1, wherein said transferring the task packet from the window in which the message queue is located to the execution window of each business logic comprises:
based on a specific function in a user program interface, transmitting the task package from a window where the message queue is located to an execution window of each business logic; wherein the specific function includes: postMessage functions and GetMessage functions.
4. A method according to claim 3, wherein said passing the task package from the window in which the message queue is located to the execution window of each business logic based on a specific function in the user program interface comprises:
in the window where the message queue is located, sending the task packet from the window where the message queue is located to an execution window of each business logic through the PostMessage function;
and receiving the task package through the GetMessage function in an execution window of each business logic.
5. The method of claim 1, wherein the step of synchronously refreshing the user interface corresponding to each business logic based on the execution result of each business logic comprises:
extracting a service logic from all service logics as a current service logic;
synchronously refreshing a user interface corresponding to the current business logic based on an execution result of the current business logic; and repeatedly executing the operation until refreshing the user interfaces corresponding to the business logics.
6. A refresh device for a user interface, the device comprising: the device comprises an acquisition module, a pushing module, an execution module and a refreshing module; wherein,,
the acquisition module is used for acquiring the current business logic by calling the sub-thread;
the pushing module is used for pushing the current business logic into the message queue by calling the sub-thread if the current business logic has the updating requirement of the user interface; repeatedly executing the operation until each business logic with the updating requirement of the user interface is pushed to the message queue;
the execution module is used for assembling one or more business logics in the message queue into a task packet by calling a main thread if at least one business logic exists in the message queue; transmitting the task package from the window where the message queue is located to the execution window of each business logic; unpacking the task package in an execution window of each service logic to obtain each service logic in the task package; executing each business logic in the task package one by one to obtain an execution result of each business logic;
and the refreshing module is used for synchronously refreshing the user interfaces corresponding to the business logics based on the execution results of the business logics.
7. The apparatus of claim 6, the apparatus further comprising: the registration module is used for registering a global Windows window based on a Windows operating system, and taking the Windows window as a message processing center; executing the operation of acquiring the current business logic by calling a sub-thread in the message processing center; the Windows window is a window in a 32-bit environment of a Windows operating system.
8. The apparatus according to claim 6, wherein the execution module is configured to transfer the task packet from the window in which the message queue is located to an execution window of each business logic based on a specific function in a user program interface; wherein the specific function includes: postMessage functions and GetMessage functions.
9. The apparatus of claim 8, wherein the execution module is specifically configured to send, in a window in which the message queue is located, the task packet from the window in which the message queue is located to an execution window of each service logic through the PostMessage function; and receiving the task package through the GetMessage function in an execution window of each business logic.
10. The apparatus of claim 6, wherein the refresh module is specifically configured to extract one service logic from all service logics as a current service logic; synchronously refreshing a user interface corresponding to the current business logic based on an execution result of the current business logic; and repeatedly executing the operation until refreshing the user interfaces corresponding to the business logics.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202111032217.7A 2021-09-03 2021-09-03 User interface refreshing method and device, electronic equipment and storage medium Active CN113722037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111032217.7A CN113722037B (en) 2021-09-03 2021-09-03 User interface refreshing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111032217.7A CN113722037B (en) 2021-09-03 2021-09-03 User interface refreshing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113722037A CN113722037A (en) 2021-11-30
CN113722037B true CN113722037B (en) 2023-08-11

Family

ID=78681445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111032217.7A Active CN113722037B (en) 2021-09-03 2021-09-03 User interface refreshing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113722037B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116360775A (en) * 2021-12-28 2023-06-30 北京字跳网络技术有限公司 User interface processing method, system, electronic device, medium and program product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975351A (en) * 2016-04-25 2016-09-28 乐视控股(北京)有限公司 User behavior message reporting method and apparatus
CN106775699A (en) * 2016-12-09 2017-05-31 武汉斗鱼网络科技有限公司 The method that UI is updated in asynchronous thread
CN108008950A (en) * 2017-11-24 2018-05-08 武汉斗鱼网络科技有限公司 The implementation method and device of a kind of user interface updating
CN109254819A (en) * 2018-08-30 2019-01-22 深圳大势智能科技有限公司 Interface updating method, system, equipment and storage medium based on android system
CN110837367A (en) * 2018-08-16 2020-02-25 阿里巴巴集团控股有限公司 User interface processing method and device and electronic equipment
CN111737012A (en) * 2020-07-31 2020-10-02 腾讯科技(深圳)有限公司 Data packet synchronization method, device, equipment and storage medium
CN113032151A (en) * 2021-03-31 2021-06-25 广州虎牙科技有限公司 Service message processing method, electronic equipment, mobile terminal and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9830209B2 (en) * 2014-02-27 2017-11-28 Netapp, Inc. Web based user interface driven prophylactic cross-domain communication architecture

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975351A (en) * 2016-04-25 2016-09-28 乐视控股(北京)有限公司 User behavior message reporting method and apparatus
CN106775699A (en) * 2016-12-09 2017-05-31 武汉斗鱼网络科技有限公司 The method that UI is updated in asynchronous thread
CN108008950A (en) * 2017-11-24 2018-05-08 武汉斗鱼网络科技有限公司 The implementation method and device of a kind of user interface updating
CN110837367A (en) * 2018-08-16 2020-02-25 阿里巴巴集团控股有限公司 User interface processing method and device and electronic equipment
CN109254819A (en) * 2018-08-30 2019-01-22 深圳大势智能科技有限公司 Interface updating method, system, equipment and storage medium based on android system
CN111737012A (en) * 2020-07-31 2020-10-02 腾讯科技(深圳)有限公司 Data packet synchronization method, device, equipment and storage medium
CN113032151A (en) * 2021-03-31 2021-06-25 广州虎牙科技有限公司 Service message processing method, electronic equipment, mobile terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宋玲玲 ; 蒋泽军 ; 王丽芳 ; 黄鹏 ; .基于XML消息队列的多层架构设计.电子测量技术.2009,(第11期),全文. *

Also Published As

Publication number Publication date
CN113722037A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
US20220374713A1 (en) Method and apparatus for performing distributed training on deep learning model, device and storage medium
US11928432B2 (en) Multi-modal pre-training model acquisition method, electronic device and storage medium
CN112540806B (en) Method and device for rendering small program page, electronic equipment and storage medium
US20210365285A1 (en) Voice data procession method, apparatus, device and storage medium
US20220287118A1 (en) Method and apparatus for interconnecting vehicle and machine
US20200050481A1 (en) Computing Method Applied to Artificial Intelligence Chip, and Artificial Intelligence Chip
CN113453073B (en) Image rendering method and device, electronic equipment and storage medium
US20220303260A1 (en) Method for synchronizing verificaion code, electronic device
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN113722037B (en) User interface refreshing method and device, electronic equipment and storage medium
US11784946B2 (en) Method for improving data flow and access for a neural network processor
JP7482223B2 (en) APPLET PAGE RENDERING METHOD, DEVICE, ELECTRONIC DEVICE, AND STORAGE MEDIUM
EP4261827A1 (en) Method and apparatus for implementing mirror image storage of memory model, and storage medium
CN114780196B (en) User interface form rendering method and device, electronic equipment and storage medium
CN113051510A (en) Interactive processing method and device, front-end equipment, back-end equipment and storage medium
CN112541346A (en) Abstract generation method and device, electronic equipment and readable storage medium
CN113835893B (en) Data processing method, device, equipment, storage medium and program product
CN113361235B (en) HTML file generation method and device, electronic equipment and readable storage medium
CN116431108B (en) Object type processing method and device, electronic equipment and storage medium
CN113656038B (en) Editing processing method and device
CN114416199B (en) Windows program running method and device, electronic equipment and storage medium
US20230012881A1 (en) Method and apparatus for reading data, electronic device and storage medium
US20210342538A1 (en) Processing word segmentation ambiguity
CN117675897A (en) Application interaction method, device, equipment and storage medium
CN117270862A (en) Software pluggable method, device, equipment and medium based on dynamic compiling

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