CN112540804A - Applet running method and device, electronic equipment and medium - Google Patents

Applet running method and device, electronic equipment and medium Download PDF

Info

Publication number
CN112540804A
CN112540804A CN202011539853.4A CN202011539853A CN112540804A CN 112540804 A CN112540804 A CN 112540804A CN 202011539853 A CN202011539853 A CN 202011539853A CN 112540804 A CN112540804 A CN 112540804A
Authority
CN
China
Prior art keywords
applet
request
service request
service
sending
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
CN202011539853.4A
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.)
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 CN202011539853.4A priority Critical patent/CN112540804A/en
Publication of CN112540804A publication Critical patent/CN112540804A/en
Priority to PCT/CN2021/092041 priority patent/WO2022134425A1/en
Pending legal-status Critical Current

Links

Images

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/445Program loading or initiating
    • G06F9/44568Immediately runnable code

Abstract

The disclosure provides an applet running method, and relates to the technical fields of internet, such as an applet technology, cloud computing and a cloud platform. The method comprises the following steps: in response to a triggering event for the applet, sending a first service request and at least one second service request to the applet server; responding to a request response message aiming at any one of the first service request and the second service request, and acquiring service data corresponding to the service request; and rendering and loading the corresponding content of the small program based on the service data. The disclosure also provides an applet running device, an electronic device and a computer readable medium.

Description

Applet running method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of internet technologies such as applet technologies, cloud computing, and cloud platforms, and in particular, to an applet running method and apparatus, an electronic device, and a computer-readable medium.
Background
At present, more and more application programs can bear the operation of the small program, and the small program is used as an application which can be used without downloading and installing, so that a user can use the service provided by the small program more conveniently and quickly.
With the wide application of the applet, the experience requirements of the user for using the applet are higher and higher, and in the process of using the applet, when the start or page jump response of the applet is slow, the waiting time of the user in a loading state is increased, so that the user experience is poor.
Therefore, how to effectively improve the response speed and the error rate of the applet starting process or the page jump so as to improve the user experience becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The present disclosure is directed to at least one of the technical problems in the prior art, and provides an applet running method and apparatus, an electronic device, and a computer readable medium.
In a first aspect, the present disclosure provides an applet running method, including: in response to a triggering event for the applet, sending a first service request and at least one second service request to the applet server; responding to a request response message aiming at any one of the first service request and the second service request, and acquiring service data corresponding to the service request; and rendering and loading the corresponding content of the small program based on the service data.
In a second aspect, the present disclosure provides an applet running apparatus including: the request sending module is used for responding to a trigger event aiming at the small program and sending a first service request and at least one second service request to the small program server; a data obtaining module, configured to obtain service data corresponding to the service request in response to a request response message that is currently received for any one of the first service request and the second service request; and the data rendering module is used for rendering and loading the corresponding content of the applet based on the service data.
In a third aspect, the present disclosure provides an electronic device comprising: at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores one or more instructions executable by the at least one processor, the one or more instructions being executable by the at least one processor to enable the at least one processor to perform the applet running method described above.
In a fourth aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, wherein the computer program, when executed, implements an applet running method as described above.
In a fifth aspect, the present disclosure provides a computer program product comprising a computer program which, when executed by a processor, implements the applet running method described above.
According to the technical scheme provided by the embodiment of the disclosure, in response to a trigger event for an applet, corresponding service data is acquired by sending a plurality of service requests to an applet server, and the corresponding service data is rendered to present the content of the corresponding applet. In response to a trigger event for the applet, request competition is carried out by sending a plurality of service requests, so that the probability of failure in request return can be reduced, the requests can be effectively ensured to be returned and responded, the real response time of the trigger event (such as an applet starting event or an applet page jumping event) is the service request with the shortest response time, the response time of service data is reduced to a certain extent, the response speed of the service data is improved, and the experience degree of a user is effectively improved. In practical application, in response to a starting event aiming at the applet, a plurality of service requests are sent to perform request competition, so that the first effective rendering (drawing) time (FMP) of the applet can be effectively improved, and the performance of the applet is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
fig. 1 is a flowchart of an applet running method provided in an embodiment of the disclosure;
FIG. 2 is a flow chart of another applet running method provided by an embodiment of the disclosure;
FIG. 3 is a flowchart of one specific implementation of step S1 in FIG. 1;
fig. 4 is a block diagram of an applet running device provided in an embodiment of the disclosure;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
To facilitate a better understanding of the technical aspects of the present disclosure, exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, wherein various details of the embodiments of the present disclosure are included to facilitate an understanding, and they should be considered as merely exemplary. Accordingly, those 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.
Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Fig. 1 is a flowchart of an applet running method according to an embodiment of the disclosure.
Referring to fig. 1, an embodiment of the present disclosure provides an applet running method, which may be performed by an applet running apparatus, which may be implemented by software and/or hardware, and which may be integrated in an electronic device such as a server. The small program operation method comprises the following steps:
step S1, in response to a trigger event for the applet, sending the first service request and the at least one second service request to the applet server.
Step S2, in response to the request response message for any one of the first service request and the second service request being received, obtaining service data corresponding to the service request.
And step S3, rendering and loading the content of the corresponding small program based on the service data.
The applet running method provided by the embodiment of the disclosure responds to a trigger event for an applet, acquires corresponding service data by sending a plurality of service requests to an applet server, and renders the corresponding service data to present the content of the corresponding applet. In response to a trigger event for the applet, request competition is carried out by sending a plurality of service requests, so that the probability of failure in request return can be reduced, the requests can be effectively ensured to be returned and responded, the real response time of the trigger event (such as an applet starting event or an applet page jumping event) is the service request with the shortest response time, the response time of service data is reduced to a certain extent, the response speed of the service data is improved, and the experience degree of a user is effectively improved. In practical application, in response to a start event for an applet, a plurality of service requests are sent to perform request competition, so that the First effective rendering (drawing) time (FMP) of the applet can be effectively improved, and the performance of the applet is improved.
In the embodiment of the present disclosure, in step S1, the trigger event for the applet may be, for example, a start event or a page jump event of the applet.
In the embodiment of the present disclosure, the trigger event for the applet may be a request generated by a user by triggering the corresponding control, may also be a request generated by the user by triggering in a voice manner, and may also be a request generated by the user by triggering in a manner of scanning the two-dimensional code of the applet, and the like. For example, a start event for an applet is generated when a user clicks on an applet icon or scans an applet two-dimensional code. The embodiments of the present disclosure do not limit the triggering manner of the triggering event for the applet.
In the embodiment of the present disclosure, in step S1, the applet server is a developer server corresponding to the applet and is used for providing various service supports for the applet.
In the embodiment of the present disclosure, an applet is hosted by a host application, the host application is a client (application program), the host application may be installed on an electronic device, and the host application may carry a plurality of applets. The electronic device may be, for example, a mobile terminal, and the mobile terminal may be various hardware devices with an operating system, such as a mobile phone, a tablet computer, and a personal digital assistant.
In some embodiments, the applet running device may be integrated into a host application, that is, the applet running method may be implemented based on the host application of the applet. In the case that the triggering event is a start event, before sending the first service request and the at least one second service request to the applet server in step S1, the method may further include: and responding to a trigger event aiming at the small program, and starting the small program frame corresponding to the small program. Specifically, the step of starting the applet frame corresponding to the applet may include: and acquiring and loading a developer service code corresponding to the applet so as to start the applet framework. The developer service code corresponding to the applet may be an app.
In some embodiments, the applet running device may be integrated into an applet framework, that is, the applet running method may be implemented based on an applet, for example, the applet framework is an applet running SDK (Software Development Kit). In the case that the trigger event is a start event, in step S1, in response to the trigger event for the applet, the first service request and the at least one second service request are sent to the applet server when the applet frame corresponding to the applet starts. Specifically, the host application starts the applet framework in response to a trigger event for the applet, and when the applet framework is started, the applet running device in the applet framework sends a first service request and at least one second service request to the applet server.
In some embodiments, in step S1, the sending the first service request and the at least one second service request to the applet server specifically includes: and calling a preset data request interface to send the first service request and at least one second service request to the applet server. The preset data request interface is a preset data request interface in an applet frame corresponding to the applet, and the preset data request interface (request API) may be a swan.
Fig. 2 is a flowchart of another applet running method provided in an embodiment of the disclosure, and as shown in fig. 2, in some embodiments, in step S1, before sending the first service request and the at least one second service request to the applet server, step S01 is further included, and after step S01, step S02 to step S04 are further included.
Step S01, in response to the trigger event for the applet, identifying whether the interface parameters of the preset data request interface in the applet frame of the applet include preset request parameters, if yes, performing step S1, otherwise, performing step S02.
The preset request parameter is a parameter representing multiple requests.
As an example, when a developer develops an applet, an extension field may be added to an interface parameter of a preset data request interface, and the extension field may include a parameter indicating whether a request is frequently generated, a request delay control parameter, and a protocol field parameter. As an example, the key of the extension field may be "ext", the value may be an object, and the format of the object may be { "resend": "true", "delay": 300ms "," protocol ": "http or quic", where "resend": "true" is a parameter indicating multiple requests, "delay": 300ms "is a corresponding request delay control parameter," protocol ": "http or quic" is the corresponding protocol field parameter.
In step S01, in response to the trigger event for the applet, if it is identified that the interface parameter of the preset data request interface in the applet frame includes the above-mentioned extension field and the extension field includes a parameter indicating multiple requests, the interface parameter of the preset data request interface in the applet frame that identifies the applet includes the preset request parameter, otherwise, the interface parameter of the preset data request interface in the applet frame that identifies the applet does not include the preset request parameter.
In step S01, in response to identifying that the interface parameters of the preset data request interface in the applet framework include the preset request parameters, the step of sending the first service request and the at least one second service request to the applet server in step S1 is performed.
And step S02, sending the first service request to the applet server.
Specifically, in response to identifying that the interface parameter of the preset data request interface in the applet framework does not contain the preset request parameter, the preset data request interface in the applet framework is called, and the first service request is sent to the applet server.
Step S03, in response to the request response message for the first service request, obtaining service data corresponding to the first service request.
Specifically, after sending a first service request to the applet server, checking whether a request response message returned by the applet server for the first service request is received currently, and if so, responding to the request response message for the first service request to acquire service data corresponding to the first service request. If the request response message returned by the applet server for the first service request is not received within the preset timeout, performing exception handling, for example, returning a prompt message for triggering event handling exception to the user, where the prompt message is information such as applet start failure, page loading failure, and the like.
And step S04, rendering and loading the content of the corresponding small program based on the service data.
In some embodiments, in step S01, in response to identifying that the interface parameters of the preset data request interface in the applet frame do not include the preset request parameters, only one service request is sent in response to the trigger event for the applet, and steps S02 to S04 are performed to perform an operation corresponding to the trigger event.
Fig. 3 is a flowchart of a specific implementation manner of step S1 in fig. 1, in some embodiments, in order to guarantee the performance of the applet server, the first service request and the at least one second service request are sent by asynchronously sending the requests. As shown in fig. 3, step S1 may further include: step S11 to step S13.
And step S11, sending a first service request to the applet server, and starting a preset timer.
In step S11, specifically, the preset data request interface is called to send the first service request to the applet server, and the preset timer is started. Wherein the first service request may be sent based on HTTP transport protocol or QUIC transport protocol.
Further, the interface parameters of the preset data request interface further include a request delay control parameter corresponding to the preset request parameter, and the preset timer is a timer corresponding to the request delay control parameter, in step S11, specifically, the preset timer corresponding to the request delay control parameter is started. For example, if the value of the request delay control parameter is 300ms, a 300ms timer is started.
Step S12, when the preset timer expires, checking whether a request response message returned by the applet server for the first service request has been received, if yes, executing step S03, otherwise, executing step S13.
For example, the timer is 300ms, and when the timer counts to 300ms, it is checked whether a request response message returned by the applet server for the first service request has been received currently.
Step S13, in case it is checked that the request response message for the first service request is not currently received, sending at least one second service request to the applet server.
Specifically, in step S13, in case that it is checked that the request response message for the first service request is not currently received, the preset data request interface is invoked to send at least one second service request to the applet server.
Further, the interface parameters of the preset data request interface further include a protocol field parameter corresponding to the preset request parameter, and in step S13, at least one second service request is sent to the applet server based on the transmission protocol corresponding to the protocol field parameter. The protocol field parameters may include HTTP protocol field parameters or QUIC protocol field parameters, the transmission protocol corresponding to the HTTP protocol field parameters is an HTTP transmission protocol, and the transmission protocol corresponding to the QUIC protocol field parameters is a QUIC transmission protocol.
In the case that the number of the second service requests is multiple, the second service requests may also be sent by asynchronous sending requests, for example, sending the second service requests at certain intervals.
In some embodiments, before step S2, the method further includes: it is checked whether a request response message for any of the first service request and the second service request has been currently received. If a request response message for any one of the first service request and the second service request has been currently received, step S2 is executed to obtain service data corresponding to the first service request or the second service request. If the request response message returned by the applet server for any one of the first service request and the second service request is not received within the preset timeout, performing exception handling, for example, returning a prompt message for triggering event handling exception to the user, where the prompt message is information such as applet start failure and page loading failure.
In the embodiment of the present disclosure, the first service request and the at least one service request are the same service request and are both used for requesting to acquire the same service data. The request response message returned by the applet server may include service data corresponding to the service request, or after receiving the request response message, the applet server interacts with the applet server to obtain the service data corresponding to the service request.
In some embodiments, the trigger event for the applet is a start event, the first service request and the at least one service request may be a rendering request for a head screen page of the applet or a rendering request for a preset advertisement page, and correspondingly, the service data corresponding to the service request is the head screen page of the applet or page data of the preset advertisement page. In step S3, based on the service data, the content of the corresponding applet is rendered and loaded to draw and present the corresponding page and start the applet.
In some embodiments, the trigger event for the applet is a page jump event, the first service request and the at least one service request may be rendering requests for a page to be jumped, and correspondingly, the service data corresponding to the service request is page data of the page to be jumped. In step S3, based on the service data, the content of the corresponding applet is rendered and loaded to draw and present the corresponding page, thereby completing the page jump. It is to be understood that the page jump refers to jumping from a currently displayed page of the applet to another page for display, and the page jump event may be a request generated by a user clicking a certain page component or link, an address, etc. on the currently displayed page of the applet.
In some embodiments, after step S1, the method may further include: and canceling the sending process of at least one second service request in response to the request response message aiming at the first service request being received currently. In some embodiments, after step S1, the method may further include: and in response to the request response message aiming at any second service request being received currently, canceling the sending process of the first service request, and canceling the sending processes of other second service requests under the condition that the number of the second service requests is multiple. Therefore, the request congestion of the small program server is avoided, the load of the small program server is reduced, and meanwhile, the response delay influencing the follow-up request is avoided.
In the embodiment of the disclosure, in response to a trigger event for an applet, request competition is performed by sending a plurality of service requests, so that not only can the probability of failure in request return be reduced, and it is effectively ensured that the request can be effectively returned and responded, but also the real response time of the trigger event (such as an applet starting event or an applet page jumping event) is the service request with the shortest response time, the response time of service data is reduced to a certain extent, the response speed of the service data is increased, and thus the experience of a user is effectively improved. In practical application, in response to a start event for an applet, a plurality of service requests are sent to perform request competition, so that the First effective rendering (drawing) time (FMP) of the applet can be effectively improved, and the performance of the applet is improved.
Fig. 4 is a block diagram of an applet running apparatus according to an embodiment of the disclosure.
Referring to fig. 4, an embodiment of the present disclosure provides an applet executing apparatus 300, where the applet executing apparatus 300 includes: a request sending module 301, a data obtaining module 302 and a data rendering module 303.
The request sending module 301 is configured to send a first service request and at least one second service request to the applet server in response to a trigger event for the applet. The data obtaining module 302 is configured to obtain service data corresponding to the service request in response to a request response message for any one of the first service request and the second service request being currently received; the data rendering module 303 is configured to render and load the content of the corresponding applet based on the service data.
In some embodiments, the applet running device 300 further includes an identification module (not shown in the figure) for identifying whether the interface parameters of the preset data request interface in the applet framework of the applet include preset request parameters; the request sending module 301 is specifically configured to, in response to the identification module identifying that the interface parameter of the preset data request interface in the applet framework includes the preset request parameter, execute a step of sending the first service request and the at least one second service request to the applet server.
In some embodiments, the applet running device 300 further comprises a task cancellation module (not shown in the figures) for: canceling the sending process of the at least one second service request in response to the request response message for the first service request being received currently; or, in response to the request response message for any one of the second service requests being received currently, canceling the sending process of the first service request; and under the condition that the number of the second service requests is multiple, responding to the currently received request response message aiming at any one second service request, and canceling the sending process of other second service requests.
In addition, the applet running apparatus 300 provided in the embodiment of the present disclosure is used to implement the applet running method provided in any embodiment, and specific relevant descriptions may refer to the descriptions of any embodiment, which are not described herein again.
The present disclosure also provides an electronic device, a computer readable medium and a computer program product according to embodiments of the present disclosure.
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
FIG. 5 shows a schematic block diagram of an electronic device 500 that may be used to implement embodiments of the present disclosure. The electronic device 500 is 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 phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
Referring to fig. 5, the electronic device includes a computing unit 501 that can perform various appropriate 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 calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the electronic device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, 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 through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 501 executes the respective methods and processes described above, such as the applet running method. For example, in some embodiments, the applet running methods described above may be implemented as computer software programs or instructions tangibly embodied on a machine (computer) readable medium, such as storage unit 508. In some embodiments, some or all of the computer programs or instructions may be loaded and/or installed onto device 500 via ROM 502 and/or communications unit 509. When the computer program or instructions are loaded into RAM 503 and executed by the computing unit 501, one or more steps of the applet running method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured in any other suitable way (e.g., by means of firmware) to perform the applet running method described above.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a 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 or instructions that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes 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 codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. 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 (computer) readable medium may be a tangible medium that can contain, or store a computer 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. A 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 a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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 present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements any one of the above-described applet running methods.
According to the technical scheme of the embodiment of the disclosure, in response to a trigger event for an applet, corresponding service data is acquired by sending a plurality of service requests to an applet server, and the corresponding service data is rendered to present the content of the corresponding applet. In response to a trigger event for the applet, request competition is carried out by sending a plurality of service requests, so that the probability of failure in request return can be reduced, the requests can be effectively ensured to be returned and responded, the real response time of the trigger event (such as an applet starting event or an applet page jumping event) is the service request with the shortest response time, the response time of service data is reduced to a certain extent, the response speed of the service data is improved, and the experience degree of a user is effectively improved. In practical application, in response to a start event for an applet, a plurality of service requests are sent to perform request competition, so that the First effective rendering (drawing) time (FMP) of the applet can be effectively improved, and the performance of the applet is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
It is to be understood that the above-described embodiments are merely exemplary embodiments that have been employed to illustrate the principles of the present disclosure, and that the above-described specific embodiments are not to be construed as limiting the scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (12)

1. An applet running method comprising:
in response to a triggering event for the applet, sending a first service request and at least one second service request to the applet server;
responding to a request response message aiming at any one of the first service request and the second service request, and acquiring service data corresponding to the service request;
and rendering and loading the corresponding content of the small program based on the service data.
2. The applet running method according to claim 1, wherein before sending the first service request and the at least one second service request to the applet server, further comprising:
identifying whether interface parameters of a preset data request interface in an applet frame of the applet contain preset request parameters;
and in response to recognizing that the interface parameters of the preset data request interface in the applet framework comprise preset request parameters, executing the step of sending the first service request and at least one second service request to the applet server.
3. The applet running method according to claim 2, wherein the sending of the first service request and the at least one second service request to the applet server comprises:
and calling the preset data request interface to send a first service request and at least one second service request to the applet server.
4. The applet running method according to claim 2 or 3, wherein the sending of the first service request and the at least one second service request to the applet server comprises:
sending a first service request to the applet server, and starting a preset timer;
when the preset timer expires, checking whether a request response message returned by the applet server for the first service request is received currently;
and sending at least one second service request to the applet server in case that it is checked that a request response message for the first service request is not currently received.
5. The applet operating method according to claim 4, wherein the interface parameters further include a request delay control parameter corresponding to the preset request parameter;
the preset timer is a timer corresponding to the request delay control parameter.
6. The applet running method according to claim 4, wherein the interface parameters further include a protocol field parameter corresponding to the preset request parameter;
the sending at least one of the second service requests to the applet server comprises: and sending at least one second service request to the applet server based on the transmission protocol corresponding to the protocol field parameter.
7. The applet running method according to claim 6, wherein the protocol field parameters comprise HTTP protocol field parameters or QUIC protocol field parameters.
8. The applet running method according to claim 1, wherein after sending the first service request and the at least one second service request to the applet server, further comprising:
canceling the sending process of the at least one second service request in response to the request response message for the first service request being received currently; alternatively, the first and second electrodes may be,
canceling the sending process of the first service request in response to the request response message aiming at any one second service request being received currently;
and under the condition that the number of the second service requests is multiple, responding to the currently received request response message aiming at any one second service request, and canceling the sending process of other second service requests.
9. An applet running apparatus, the apparatus comprising:
the request sending module is used for responding to a trigger event aiming at the small program and sending a first service request and at least one second service request to the small program server;
a data obtaining module, configured to obtain service data corresponding to the service request in response to a request response message that is currently received for any one of the first service request and the second service request;
and the data rendering module is used for rendering and loading the corresponding content of the applet based on the service data.
10. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores one or more instructions executable by the at least one processor to enable the at least one processor to perform the applet running method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, wherein the computer program, when executed, implements the applet running method according to any one of claims 1-8.
12. A computer program product comprising a computer program which, when executed by a processor, implements an applet running method according to any one of claims 1-8.
CN202011539853.4A 2020-12-23 2020-12-23 Applet running method and device, electronic equipment and medium Pending CN112540804A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011539853.4A CN112540804A (en) 2020-12-23 2020-12-23 Applet running method and device, electronic equipment and medium
PCT/CN2021/092041 WO2022134425A1 (en) 2020-12-23 2021-05-07 Applet running method and apparatus, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011539853.4A CN112540804A (en) 2020-12-23 2020-12-23 Applet running method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN112540804A true CN112540804A (en) 2021-03-23

Family

ID=75017649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011539853.4A Pending CN112540804A (en) 2020-12-23 2020-12-23 Applet running method and device, electronic equipment and medium

Country Status (2)

Country Link
CN (1) CN112540804A (en)
WO (1) WO2022134425A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022134425A1 (en) * 2020-12-23 2022-06-30 北京百度网讯科技有限公司 Applet running method and apparatus, electronic device, and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008074124A1 (en) * 2006-12-21 2008-06-26 Bce Inc. Systems and methods for conveying information to an instant messaging client
CN111200645A (en) * 2019-12-27 2020-05-26 北京健康之家科技有限公司 Service request processing method, device, equipment and readable storage medium
CN111523102A (en) * 2020-04-24 2020-08-11 腾讯科技(深圳)有限公司 Applet login method, device, equipment and computer readable storage medium
CN111586128A (en) * 2020-04-28 2020-08-25 百度在线网络技术(北京)有限公司 Method, device and equipment for acquiring applet data and storage medium
CN112052185A (en) * 2020-09-29 2020-12-08 北京百度网讯科技有限公司 Applet exception handling method and device, electronic device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105814922B (en) * 2014-03-17 2019-08-20 华为技术有限公司 Address mark distributing method and relevant device and system
CN110007936B (en) * 2019-04-16 2022-04-29 上海连尚网络科技有限公司 Data processing method and device
CN111767090A (en) * 2020-06-28 2020-10-13 百度在线网络技术(北京)有限公司 Method and device for starting small program, electronic equipment and storage medium
CN112540804A (en) * 2020-12-23 2021-03-23 北京百度网讯科技有限公司 Applet running method and device, electronic equipment and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008074124A1 (en) * 2006-12-21 2008-06-26 Bce Inc. Systems and methods for conveying information to an instant messaging client
CN111200645A (en) * 2019-12-27 2020-05-26 北京健康之家科技有限公司 Service request processing method, device, equipment and readable storage medium
CN111523102A (en) * 2020-04-24 2020-08-11 腾讯科技(深圳)有限公司 Applet login method, device, equipment and computer readable storage medium
CN111586128A (en) * 2020-04-28 2020-08-25 百度在线网络技术(北京)有限公司 Method, device and equipment for acquiring applet data and storage medium
CN112052185A (en) * 2020-09-29 2020-12-08 北京百度网讯科技有限公司 Applet exception handling method and device, electronic device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022134425A1 (en) * 2020-12-23 2022-06-30 北京百度网讯科技有限公司 Applet running method and apparatus, electronic device, and medium

Also Published As

Publication number Publication date
WO2022134425A1 (en) 2022-06-30

Similar Documents

Publication Publication Date Title
CN112506581B (en) Method, apparatus, electronic device and readable storage medium for rendering applet
CN113766487B (en) Cloud mobile phone information acquisition method, device, equipment and medium
CN111125057A (en) Service request processing method and device and computer system
CN112965799B (en) Task state prompting method and device, electronic equipment and medium
CN114528517A (en) View processing method and device, electronic equipment and computer readable medium
CN112540804A (en) Applet running method and device, electronic equipment and medium
CN114374703B (en) Cloud mobile phone information acquisition method, device, equipment and storage medium
CN113691937B (en) Method for determining position information, cloud mobile phone and terminal equipment
CN113641929B (en) Page rendering method, device, electronic equipment and computer readable storage medium
CN113535020B (en) Method, apparatus, device, medium and product for generating application icons
CN112925623A (en) Task processing method and device, electronic equipment and medium
CN114090118A (en) Method, device and equipment for starting small program and storage medium
CN115237574A (en) Scheduling method and device of artificial intelligence chip and electronic equipment
CN114490126A (en) Page processing method and device, electronic equipment and storage medium
CN114386577A (en) Method, apparatus, and storage medium for executing deep learning model
CN114095564A (en) Data processing method and device, equipment and medium
CN113535187B (en) Service online method, service updating method and service providing method
CN113032040B (en) Method, apparatus, device, medium, and article for processing tasks
CN113950034B (en) Bluetooth behavior simulation method, device and equipment
CN114428646A (en) Data processing method and device, electronic equipment and storage medium
CN114265535B (en) Floor page display method, device, equipment and medium for push message
CN113360407B (en) Function positioning method and device, electronic equipment and readable storage medium
US20220347566A1 (en) Method and apparatus for pre-starting cloud application, device, storage medium, and program product
CN114217837A (en) Software updating method, device, equipment and medium for cloud mobile phone
CN116010744A (en) Page data processing method and device, electronic equipment and readable storage medium

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