CN112000394A - Method, apparatus, device and storage medium for accessing an applet - Google Patents
Method, apparatus, device and storage medium for accessing an applet Download PDFInfo
- Publication number
- CN112000394A CN112000394A CN202010880567.8A CN202010880567A CN112000394A CN 112000394 A CN112000394 A CN 112000394A CN 202010880567 A CN202010880567 A CN 202010880567A CN 112000394 A CN112000394 A CN 112000394A
- Authority
- CN
- China
- Prior art keywords
- access request
- determining
- cache
- target data
- client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 230000004044 response Effects 0.000 claims description 42
- 230000008859 change Effects 0.000 claims description 30
- 230000015654 memory Effects 0.000 claims description 19
- 238000011084 recovery Methods 0.000 claims description 12
- 230000002452 interceptive effect Effects 0.000 claims description 11
- 238000004458 analytical method Methods 0.000 claims description 3
- 230000004075 alteration Effects 0.000 claims 1
- 230000036316 preload Effects 0.000 claims 1
- 238000011161 development Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 239000003795 chemical substances by application Substances 0.000 description 6
- 230000003993 interaction Effects 0.000 description 6
- 238000004590 computer program Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000006872 improvement Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application discloses a method, a device, equipment and a storage medium for accessing an applet, and relates to the field of Internet and applet development. The specific implementation scheme is as follows: receiving an access request aiming at the small program sent by a client; analyzing the access request, and determining target data requested by the access request; responding to the condition that target data are not stored in a preset cache database, and sending an access request to a server; and receiving target data sent by the server, caching the target data in a cache database and forwarding the target data to the client so as to display the landing page of the applet. The realization mode can effectively improve the display speed of the small program landing page and improve the browsing experience of a user.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of internet and applet development, and in particular, to a method, an apparatus, a device, and a storage medium for accessing an applet.
Background
With the explosive growth of applets, there are more and more scenarios for providing services by way of applets on super APPs. The speed of opening the applet landing page determines to some extent the user experience. The optimization of the applet in the industry generally focuses on the improvement of a client framework, front-end rendering and loading performance, and the bottleneck of the loading and rendering performance of the applet at the end can be effectively solved by the method. However, the existing method has limited performance improvement.
Disclosure of Invention
A method, apparatus, device, and storage medium for accessing an applet are provided.
According to a first aspect, there is provided a method for accessing an applet, comprising: receiving an access request aiming at the small program sent by a client; analyzing the access request, and determining target data requested by the access request; responding to the condition that target data are not stored in a preset cache database, and sending an access request to a server; and receiving target data sent by the server, caching the target data in a cache database and forwarding the target data to the client so as to display the landing page of the applet.
According to a second aspect, there is provided an apparatus for accessing an applet, comprising: a request receiving unit configured to receive an access request for an applet sent by a client; the request analysis unit is configured to analyze the access request and determine target data requested by the access request; the request forwarding unit is configured to respond to the fact that target data are not stored in a preset cache database, and send an access request to the server; and the data forwarding unit is configured to receive the target data sent by the server, cache the target data in the cache database and forward the target data to the client so as to display the landing page of the applet.
According to a third aspect, there is provided an electronic device for accessing an applet, 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 as described in the first aspect.
According to a fourth aspect, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method as described in the first aspect.
According to the method and the device, the problem that the speed of opening the landing page cannot be increased in a conventional applet access method is limited is solved, the display speed of the landing page of the applet can be effectively increased, and the browsing experience of a user 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 drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for accessing an applet, in accordance with the present application;
FIG. 3 is a schematic diagram of one application scenario of a method for accessing an applet, according to the present application;
FIG. 4 is a flow diagram of another embodiment of a method for accessing an applet, in accordance with the present application;
FIG. 5 is a schematic diagram of an embodiment of an apparatus for accessing applets, according to the present application;
FIG. 6 is a block diagram of an electronic device used to implement the method for accessing applets of an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. 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 application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for accessing an applet or the apparatus for accessing an applet of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, a proxy server 103, and a server 104. The network serves as a medium for providing communication links between the terminal devices 101, 102, the proxy server 103 and the server 104. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal device 101, 102 to interact with a proxy server 103, a server 105, via a network 104, to receive or send messages, etc. Various communication client applications, such as a search application, a social platform application, and the like, may be installed on the terminal devices 101 and 102. These applications may be hosted applications as applets.
The terminal apparatuses 101 and 102 may be hardware or software. When the terminal devices 101, 102 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, e-book readers, in-car computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101 and 102 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The proxy server 103 may be a server for providing a proxy, for example, a server that forwards or processes requests sent by the terminal devices 101, 102. The proxy server 103 may also interact with the server 104, for example forwarding requests of the terminal devices 101, 102 to the server 104 or sending feedback of the server 104 to the terminal devices 101, 102.
The server 104 may be a server providing various services, such as a background server providing support for applets running on the terminal devices 101, 102. The background server may proxy the request sent by the server 103, or may receive the request of the terminal device 101, 102, determine the data for which the request is directed, and then feed back the data to the terminal device 101, 102.
The proxy server 103 and the server 104 may be hardware or software. When the proxy server 103 and the server 104 are hardware, they may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the proxy server 103, the server 105 are software, they may be implemented as a plurality of software or software modules (for example, for providing distributed services), or as a single software or software module. And is not particularly limited herein.
It should be noted that the method for accessing an applet provided in the embodiment of the present application is generally performed by the proxy server 103. Accordingly, the means for accessing the applet is typically provided in the proxy server 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for accessing an applet, in accordance with the present application, is shown. The method for accessing an applet of the present embodiment includes the steps of:
In this embodiment, an execution subject (e.g., the proxy server 103 in fig. 1) of the method for accessing an applet may receive an access request for the applet, which is sent by a client (e.g., the terminal device 101, 102 in fig. 1). The applet may be an applet hosted on the client of other hosted applications installed. A user may send an access request for an applet through various operations. For example, a user may send an access request for an applet by clicking on the identification of the applet. It will be appreciated that the access request may include an identification of the applet, and the data for which the request is directed.
After receiving the access request, the execution subject may parse the access request to determine the target data requested by the access request. The target data may be, for example, a page accessed, requested music, and the like.
After determining the target data, the execution main body may query a preset cache database, and determine whether the preset cache database stores the target data. If the target data is not stored, the executing agent may send an access request to a server (e.g., server 104 shown in FIG. 1). After receiving the access request, the server side can analyze the access request to obtain target data. Then, the server may send the acquired target data to the execution subject.
And step 204, receiving the target data sent by the server, caching the target data in a cache database and forwarding the target data to the client so as to display the landing page of the applet.
After receiving the target data sent by the server, the execution subject may cache the target data in a cache database. Meanwhile, the target data can be forwarded to the client, so that the client can display the landing page of the small program according to the target data after receiving the target data.
With continued reference to FIG. 3, a schematic diagram of one application scenario of a method for accessing applets in accordance with the present application is shown. In the application scenario of fig. 3, a user accesses applet b via a host application a installed on a handset 301, and thus applet b sends an access request to a proxy server 302. The proxy server 302 parses the access request to determine the target data. Proxy server 302 then queries cache database 303. If the target data is not stored in the cache database 303, the proxy server 302 forwards the access request to the server 304. The server 304 determines the target data and forwards the target data to the proxy server 302. The proxy server 302 caches the target data in the cache database 303 and then forwards the target data to the handset 301.
According to the method for accessing the applet, the target data can be cached in the cache database communicated with the proxy server, so that the display speed of the landing page of the applet can be effectively improved, and the browsing experience of a user is improved.
In some optional implementations of this embodiment, the method may further include the following steps not shown in fig. 2: and responding to the fact that the target data are stored in the preset cache database, and sending the target data to the client side for displaying the landing page of the small program.
In this implementation, if the execution subject determines that the preset cache database stores the target data, the execution subject may directly read the target data, and then send the target data to the client for displaying the landing page of the applet.
With continued reference to FIG. 4, a flow 400 of another embodiment of a method for accessing an applet, in accordance with the present application, is shown. As shown in fig. 4, the method for accessing an applet of the present embodiment may include the steps of:
In this embodiment, the execution body may further receive configuration information sent by the client. The configuration information may be used to indicate whether the access request is allowed to be processed. The configuration information may be used to configure information such as a uniform resource identifier list, disaster recovery information, and cache delay. Here, the uniform resource identifier list is used to indicate legitimate uniform resource identifiers. That is, if the uniform resource identifier of the transmission request is located in the uniform resource identifier list, the request may be processed. The disaster recovery information indicates processing information in a state where an access error occurs or no response is made. The cache latency indicates the setting of the cache in the presence of an access error or in the absence of a response. The execution agent may load the configuration information at startup.
The execution agent may parse the access request to determine a uniform resource identifier for the access request. Then, the uniform resource identifier list may be queried to determine whether the uniform resource identifier list includes the uniform resource identifier of the access request. If the request sent by the client can be processed, the execution main body can receive the access request sent by the client and aiming at the small program.
In this embodiment, the access request may further include a digital signature. The executing agent may first get a digital signature in the access request. And then analyzing the digital signature to determine whether the digital signature is matched with a preset first key and a preset second key. Here, matching means that the first key and the second key are obtained after a series of calculations on the digital signature. If the executing agent determines that the digital signature matches the first key and the second key, the access request may continue to be parsed to obtain the target data. The first key may determine whether the sender of the access request is a legitimate requester. The second key may be used to generate a digital signature.
In some optional implementations of this embodiment, the digital signature may be obtained through the following steps not shown in fig. 4: determining an interface called by the access request; and generating a digital signature according to at least one parameter, the first key and the second key which are included by the interface.
In this implementation, the execution subject may parse the access request and determine an interface to be called by the access request. Then, at least one parameter comprised by the interface may be determined. And finally, generating a digital signature according to the parameters, the first key and the second key. Specifically, the executing entity may add each parameter and the second key, add the sum to the first key, and calculate the sum using MD5, and use the resulting value as a digital signature.
And 405, receiving target data sent by the server, caching the target data in a cache database and forwarding the target data to the client so as to display the landing page of the applet.
The execution subject may also determine a current disaster tolerance number and determine a current cache state. In particular, the execution agent may determine the two parameters from local parameters. And if the current disaster tolerance times are smaller than the preset threshold value, the execution main body can process the request aiming at the small program currently. If the current disaster tolerance times are larger than or equal to the preset threshold value, the execution main body is in a fault state at present and cannot process the request. The current cache state is used to indicate whether data can currently be cached. The current cache state comprises opening and closing, and when the current cache state is opened, the current cache state shows that data can be cached currently. At the time of shutdown, it is stated that data cannot be currently cached. If the current disaster tolerance times are smaller than the preset threshold value and the current cache state is open, the current access request can be processed, that is, the access request aiming at the small program sent by the client can be received.
In some optional implementations of this embodiment, the execution subject may determine the current disaster recovery number by: sending a heartbeat packet to a server; and recording the frequency of not receiving response information which is returned by the server and aims at the heartbeat packet within the preset time length as the current disaster tolerance frequency.
In this implementation manner, the execution main body may also send a heartbeat packet to the server at intervals to determine whether the server is available. And if response information aiming at the heartbeat packet is received from the server within a preset time length, the server is indicated to be available currently. And if response information aiming at the heartbeat packet from the server side is received within a preset time length, recording the current disaster tolerance times. For example, if the current disaster tolerance frequency is 0, and if response information from the server for the heartbeat packet is received within a preset time period, the current disaster tolerance frequency +1 is changed to 1.
In some optional implementation manners of this embodiment, the executing main body may further update the current disaster recovery times in real time through the following steps: and reducing the value of the current disaster tolerance times in response to receiving response information aiming at the target data sent by the client.
In this implementation manner, if the execution main body receives the response information for the target data sent by the client, which indicates that the interaction between the current client and the execution main body is normal, the value of the current disaster tolerance times may be reduced.
In some optional implementations of this embodiment, the method may further include the following steps: determining interactive data corresponding to the configuration information; and caching the interactive data in a cache database at the interval of sending the heartbeat packet.
The execution subject may determine the interaction data corresponding to the configuration information. For example, the interactive data may include pictures, audio, and the like. The execution subject may cache the interaction data in the cache database at the interval of sending the heartbeat packet. I.e. pre-loaded interaction data. This speeds up the access of the client to the interactive data.
In this embodiment, the execution subject may determine the cache state change duration. The cache state change duration is used for indicating the duration required by changing the cache state. Specifically, the cache state change duration is used to indicate a duration required for changing the cache state from off to on. The execution subject may calculate the expiration time between the time of the cache state change and the current time. Here, the buffer state change time is a time at which the buffer state is changed, for example, a time at which the buffer state is changed from the on state to the off state. If the expiration time is greater than or equal to the cache change time, the current cache state may be changed.
In some optional implementation manners of this embodiment, the configuration information may further include a cache invalidation time length. The execution subject may determine the cache state change duration by: and determining the cache state change time length according to the current disaster tolerance times and the cache failure time length.
In this implementation, the cache invalidation time length may be the minimum time unit of cache invalidation. The execution main body can determine the cache state change duration according to the current disaster tolerance times and the cache failure duration. Specifically, the execution main body may multiply the current disaster recovery frequency by the cache invalidation time length, and an obtained product is used as the cache state change time length.
If the execution main body determines that the current disaster tolerance times are equal to the preset threshold value, the execution main body is not available at present, and if the current cache state is open, the execution main body can change the current cache state to be closed.
In this embodiment, the execution principal may also provide the set of generic components to the client. Components in the general component set described above may be included in a page of an applet. Here, the client may be a client used by a developer. The execution main body can also receive the custom assembly sent by the client side and store the custom assembly in the cache database. Therefore, the user can conveniently utilize the self-defined assembly next time.
According to the method for accessing the applet, network requests are carried out on the component, the component is cached, the heartbeat package and the pre-loaded interactive data are sent to the server, the opening speed of the applet is further stably improved, the capability resource problem of the applet developers of the middle and long tails is taken into consideration, convenience is provided for the developers to act, and meanwhile, the user is provided with extreme experience.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for accessing an applet, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for accessing an applet of the present embodiment includes: a request receiving unit 501, a request parsing unit 502, a request forwarding unit 503, and a data forwarding unit 504.
A request receiving unit 501 configured to receive an access request for an applet sent by a client.
A request analysis unit 502 configured to analyze the access request and determine target data requested by the access request;
a request forwarding unit 503 configured to send an access request to the server in response to determining that the target data is not stored in the preset cache database;
and the data forwarding unit 504 is configured to receive the target data sent by the server, cache the target data in the cache database, and forward the target data to the client, so as to display the landing page of the applet.
In some optional implementations of this embodiment, the apparatus 500 may further include a data sending unit, not shown in fig. 5, configured to send, in response to determining that the preset cache database stores the target data, the target data to the client for displaying the landing page of the applet.
In some optional implementations of this embodiment, the apparatus 500 may further include a configuration loading unit, not shown in fig. 5, configured to: receiving configuration information sent by a client; and loading the configuration information.
In some optional implementations of this embodiment, the configuration information includes a list of uniform resource identifiers. The request receiving unit 501 may be further configured to: determining whether the list of uniform resource identifiers includes a uniform resource identifier of the access request; in response to determining that the list of uniform resource identifiers includes a uniform resource identifier of the access request, an access request sent by the client for the applet is received.
In some optional implementation manners of this embodiment, the configuration information includes a preset threshold corresponding to the disaster tolerance number and a cache state. The request receiving unit 501 may be further configured to: determining the current disaster tolerance times and determining the current cache state; and receiving an access request aiming at the small program sent by the client in response to the fact that the current disaster recovery times are smaller than the preset threshold value and the current cache state is started.
In some optional implementations of this embodiment, the request receiving unit 501 may be further configured to: sending a heartbeat packet to a server; and recording the frequency of not receiving response information which is returned by the server and aims at the heartbeat packet within the preset time length as the current disaster tolerance frequency.
In some optional implementations of this embodiment, the apparatus 500 may further include a cache state changing unit, not shown in fig. 5, configured to: determining the cache state change duration; determining the failure duration between the cache state change moment and the current moment; and changing the current cache state in response to determining that the expiration time is greater than or equal to the cache change time.
In some optional implementation manners of this embodiment, the configuration information further includes a cache expiration duration. The cache state change unit is further configured to: and determining the cache state change time length according to the current disaster tolerance times and the cache failure time length.
In some optional implementations of this embodiment, the cache state changing unit is further configured to: and changing the current cache state into a closed state in response to the fact that the current disaster recovery times are equal to a preset threshold value and the current cache state is opened.
In some optional implementations of this embodiment, the apparatus 500 may further include a disaster tolerance number determination unit, not shown in fig. 5, configured to: and reducing the value of the current disaster tolerance times in response to receiving response information aiming at the target data sent by the client.
In some optional implementations of this embodiment, the apparatus 500 may further include a preloading unit, not shown in fig. 5, configured to: determining interactive data corresponding to the configuration information; and caching the interactive data in a cache database at the interval of sending the heartbeat packet.
In some optional implementations of this embodiment, the access request includes a digital signature. The request parsing unit 502 may be further configured to: determining whether the digital signature is matched with a preset first key and a preset second key; in response to determining that the digital signature matches the first key and the second key, target data requested by the access request is determined.
In some optional implementations of this embodiment, the apparatus 500 may further include a signature generation unit, not shown in fig. 5, configured to: determining an interface called by the access request; and generating a digital signature according to at least one parameter, the first key and the second key which are included by the interface.
In some optional implementations of this embodiment, the apparatus 500 may further include a component caching unit, not shown in fig. 5, configured to: acquiring a general component set from a buffer database and sending the component set to a client; receiving the custom assembly sent by the client and storing the custom assembly in a cache database.
It should be understood that units 501 to 504, which are recited in the apparatus 500 for accessing an applet, correspond to the respective steps in the method described with reference to fig. 2, respectively. Thus, the operations and features described above for the method for accessing applets are equally applicable to the apparatus 500 and the units contained therein and will not be described in detail here.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 6, is a block diagram of an electronic device that performs a method for accessing an applet according to an embodiment of the application. 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 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 present application that are described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the methods for accessing applets provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the methods provided herein for accessing an applet.
The memory 602, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method for accessing a applet performed in the embodiments of the present application (for example, the request receiving unit 501, the request parsing unit 502, the request forwarding unit 503, and the data forwarding unit 504 shown in fig. 5). The processor 601 executes various functional applications of the server and data processing by running non-transitory software programs, instructions and modules stored in the memory 602, that is, implementing the method for accessing the applet performed in the above method embodiment.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created from use of an electronic device that executes for accessing the applet, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory located remotely from the processor 601, which may be connected via a network to an electronic device executing the program for accessing the applet. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device performing the method for accessing an applet may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus performing the access to the applet, such as a touch screen, keypad, mouse, track pad, touch pad, pointer stick, one or more mouse buttons, track ball, joystick or other input device. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs 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.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
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.
According to the technical scheme of the embodiment of the application, the display speed of the small program landing page can be effectively improved, and the browsing experience of a user 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 the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. 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 application shall be included in the protection scope of the present application.
Claims (30)
1. A method for accessing an applet, comprising:
receiving an access request aiming at the small program sent by a client;
analyzing the access request, and determining target data requested by the access request;
responding to the condition that the target data is not stored in a preset cache database, and sending the access request to a server;
and receiving the target data sent by the server, caching the target data in the cache database and forwarding the target data to the client so as to display the landing page of the applet.
2. The method of claim 1, wherein the method further comprises:
and responding to the fact that the target data are stored in a preset cache database, and sending the target data to the client side for displaying the landing page of the small program.
3. The method of claim 1, wherein the method further comprises:
receiving configuration information sent by the client;
and loading the configuration information.
4. The method of claim 3, wherein the configuration information comprises a list of uniform resource identifiers; and
the receiving of the access request for the applet sent by the client includes:
determining whether the list of uniform resource identifiers includes a uniform resource identifier of the access request;
in response to determining that the list of uniform resource identifiers includes a uniform resource identifier of the access request, receiving an access request sent by a client for an applet.
5. The method according to claim 3, wherein the configuration information includes a preset threshold corresponding to the disaster tolerance times and a cache state; and
the receiving of the access request for the applet sent by the client includes:
determining the current disaster tolerance times and determining the current cache state;
and receiving an access request aiming at the small program sent by the client in response to the fact that the current disaster tolerance times are smaller than the preset threshold value and the current cache state is started.
6. The method of claim 5, wherein the determining the current disaster recovery number comprises:
sending a heartbeat packet to the server;
and recording the frequency of not receiving response information aiming at the heartbeat packet returned by the server within a preset time length as the current disaster tolerance frequency.
7. The method of claim 5, wherein the method further comprises:
determining the cache state change duration;
determining the failure duration between the cache state change moment and the current moment;
and changing the current cache state in response to determining that the expiration time is greater than or equal to the cache change time.
8. The method of claim 6, wherein the configuration information further comprises a cache expiration duration; and
the determining of the cache state change duration includes:
and determining the cache state change time length according to the current disaster tolerance times and the cache failure time length.
9. The method of claim 6, wherein the method further comprises:
and changing the current cache state to be closed in response to the fact that the current disaster recovery times are equal to the preset threshold value and the current cache state is open.
10. The method of claim 5, wherein the method further comprises:
and reducing the value of the current disaster tolerance times in response to receiving response information aiming at the target data sent by the client.
11. The method of claim 3, wherein the method further comprises:
determining interactive data corresponding to the configuration information;
and caching the interactive data in the cache database at the interval of sending the heartbeat packet.
12. The method of claim 1, wherein the access request comprises a digital signature; and
the analyzing the access request and determining the target data requested by the access request includes:
determining whether the digital signature is matched with a preset first key and a preset second key;
in response to determining that the digital signature matches the first key and the second key, target data requested by the access request is determined.
13. The method of claim 12, wherein the method further comprises:
determining an interface called by the access request;
and generating the digital signature according to at least one parameter, the first key and the second key which are included by the interface.
14. The method of claim 1, wherein the method further comprises:
acquiring a universal component set from the cache database and sending the component set to the client;
and receiving a custom assembly sent by the client and storing the custom assembly in the cache database.
15. An apparatus for accessing an applet, comprising:
a request receiving unit configured to receive an access request for an applet sent by a client;
the request analysis unit is configured to analyze the access request and determine target data requested by the access request;
the request forwarding unit is configured to respond to the fact that the target data are not stored in a preset cache database, and send the access request to a server;
and the data forwarding unit is configured to receive the target data sent by the server, cache the target data in the cache database and forward the target data to the client so as to display the landing page of the applet.
16. The apparatus of claim 15, wherein the apparatus further comprises:
and the data sending unit is configured to respond to the fact that the target data are stored in a preset cache database, and send the target data to the client side for displaying the landing page of the small program.
17. The apparatus of claim 15, wherein the apparatus further comprises a configuration loading unit configured to:
receiving configuration information sent by the client;
and loading the configuration information.
18. The apparatus of claim 17, wherein the configuration information comprises a list of uniform resource identifiers; and
the request receiving unit is further configured to:
determining whether the list of uniform resource identifiers includes a uniform resource identifier of the access request;
in response to determining that the list of uniform resource identifiers includes a uniform resource identifier of the access request, receiving an access request sent by a client for an applet.
19. The apparatus according to claim 17, wherein the configuration information includes a preset threshold corresponding to the disaster tolerance times and a cache status; and
the request receiving unit is further configured to:
determining the current disaster tolerance times and determining the current cache state;
and receiving an access request aiming at the small program sent by the client in response to the fact that the current disaster tolerance times are smaller than the preset threshold value and the current cache state is started.
20. The apparatus of claim 19, wherein the request receiving unit is further configured to:
sending a heartbeat packet to the server;
and recording the frequency of not receiving response information aiming at the heartbeat packet returned by the server within a preset time length as the current disaster tolerance frequency.
21. The apparatus of claim 19, wherein the apparatus further comprises a buffer status change unit configured to:
determining the cache state change duration;
determining the failure duration between the cache state change moment and the current moment;
and changing the current cache state in response to determining that the expiration time is greater than or equal to the cache change time.
22. The apparatus of claim 21, wherein the configuration information further comprises a cache expiration duration; and
the cache state change unit is further configured to:
and determining the cache state change time length according to the current disaster tolerance times and the cache failure time length.
23. The apparatus of claim 19, wherein the cache state alteration unit is further configured to:
and changing the current cache state to be closed in response to the fact that the current disaster recovery times are equal to the preset threshold value and the current cache state is open.
24. The apparatus of claim 19, wherein the apparatus further comprises a disaster tolerance number determination unit configured to:
and reducing the value of the current disaster tolerance times in response to receiving response information aiming at the target data sent by the client.
25. The apparatus of claim 17, wherein the apparatus further comprises a preload unit configured to:
determining interactive data corresponding to the configuration information;
and caching the interactive data in the cache database at the interval of sending the heartbeat packet.
26. The apparatus of claim 15, wherein the access request comprises a digital signature; and
the request resolution unit is further configured to:
determining whether the digital signature is matched with a preset first key and a preset second key;
in response to determining that the digital signature matches the first key and the second key, target data requested by the access request is determined.
27. The apparatus of claim 26, wherein the apparatus further comprises a signature generation unit configured to:
determining an interface called by the access request;
and generating the digital signature according to at least one parameter, the first key and the second key which are included by the interface.
28. The apparatus of claim 15, wherein the apparatus further comprises a component caching unit configured to:
acquiring a universal component set from the cache database and sending the component set to the client;
and receiving a custom assembly sent by the client and storing the custom assembly in the cache database.
29. An electronic device for accessing an applet, 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-14.
30. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-14.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010880567.8A CN112000394B (en) | 2020-08-27 | 2020-08-27 | Method, apparatus, device and storage medium for accessing applet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010880567.8A CN112000394B (en) | 2020-08-27 | 2020-08-27 | Method, apparatus, device and storage medium for accessing applet |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112000394A true CN112000394A (en) | 2020-11-27 |
CN112000394B CN112000394B (en) | 2024-01-09 |
Family
ID=73471613
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010880567.8A Active CN112000394B (en) | 2020-08-27 | 2020-08-27 | Method, apparatus, device and storage medium for accessing applet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112000394B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112506582A (en) * | 2020-12-18 | 2021-03-16 | 北京百度网讯科技有限公司 | Applet data packet processing method, apparatus, device and medium |
CN112732999A (en) * | 2021-01-21 | 2021-04-30 | 建信金融科技有限责任公司 | Static disaster recovery method, system, electronic device and storage medium |
CN113553074A (en) * | 2021-07-23 | 2021-10-26 | 北京百度网讯科技有限公司 | Applet distribution control method, device, electronic equipment and storage medium |
CN113761404A (en) * | 2021-02-09 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Page access method, server, terminal equipment, system and electronic equipment |
CN113778430A (en) * | 2021-02-02 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Data rendering method, device and equipment of small program and storage medium |
CN113905091A (en) * | 2021-09-15 | 2022-01-07 | 盐城金堤科技有限公司 | Method and device for processing access request |
CN114490752A (en) * | 2021-12-31 | 2022-05-13 | 北京声智科技有限公司 | Data acquisition method and device, electronic equipment and storage medium |
CN114510296A (en) * | 2022-02-25 | 2022-05-17 | 支付宝(杭州)信息技术有限公司 | Applet storage and calling method, device and equipment |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110185051A1 (en) * | 2010-01-27 | 2011-07-28 | Arcot Systems, Inc. | Client device identification through cache manipulation |
US20120144202A1 (en) * | 2010-12-06 | 2012-06-07 | Verizon Patent And Licensing Inc. | Secure authentication for client application access to protected resources |
US20120297041A1 (en) * | 2011-05-20 | 2012-11-22 | Citrix Systems, Inc. | Shell Integration on a Mobile Device for an Application Executing Remotely on a Server |
CN110333912A (en) * | 2019-07-11 | 2019-10-15 | 百度在线网络技术(北京)有限公司 | A kind of method, apparatus and computer readable storage medium of small routine data pre-fetching |
CN110347488A (en) * | 2019-07-08 | 2019-10-18 | 北京字节跳动网络技术有限公司 | A kind of service processing method, device, terminal device and storage medium |
CN111222062A (en) * | 2020-01-09 | 2020-06-02 | 百度在线网络技术(北京)有限公司 | Applet running method and device, electronic equipment and storage medium |
CN111382362A (en) * | 2020-03-13 | 2020-07-07 | 百度在线网络技术(北京)有限公司 | Applet processing method, device, equipment and storage medium |
CN111586126A (en) * | 2020-04-28 | 2020-08-25 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for pre-downloading small program and storage medium |
-
2020
- 2020-08-27 CN CN202010880567.8A patent/CN112000394B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110185051A1 (en) * | 2010-01-27 | 2011-07-28 | Arcot Systems, Inc. | Client device identification through cache manipulation |
US20120144202A1 (en) * | 2010-12-06 | 2012-06-07 | Verizon Patent And Licensing Inc. | Secure authentication for client application access to protected resources |
US20120297041A1 (en) * | 2011-05-20 | 2012-11-22 | Citrix Systems, Inc. | Shell Integration on a Mobile Device for an Application Executing Remotely on a Server |
CN110347488A (en) * | 2019-07-08 | 2019-10-18 | 北京字节跳动网络技术有限公司 | A kind of service processing method, device, terminal device and storage medium |
CN110333912A (en) * | 2019-07-11 | 2019-10-15 | 百度在线网络技术(北京)有限公司 | A kind of method, apparatus and computer readable storage medium of small routine data pre-fetching |
CN111222062A (en) * | 2020-01-09 | 2020-06-02 | 百度在线网络技术(北京)有限公司 | Applet running method and device, electronic equipment and storage medium |
CN111382362A (en) * | 2020-03-13 | 2020-07-07 | 百度在线网络技术(北京)有限公司 | Applet processing method, device, equipment and storage medium |
CN111586126A (en) * | 2020-04-28 | 2020-08-25 | 百度在线网络技术(北京)有限公司 | Method, device and equipment for pre-downloading small program and storage medium |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112506582B (en) * | 2020-12-18 | 2024-04-09 | 北京百度网讯科技有限公司 | Method, device, equipment and medium for processing small program data packet |
CN112506582A (en) * | 2020-12-18 | 2021-03-16 | 北京百度网讯科技有限公司 | Applet data packet processing method, apparatus, device and medium |
CN112732999B (en) * | 2021-01-21 | 2023-06-09 | 建信金融科技有限责任公司 | Static disaster recovery method, system, electronic equipment and storage medium |
CN112732999A (en) * | 2021-01-21 | 2021-04-30 | 建信金融科技有限责任公司 | Static disaster recovery method, system, electronic device and storage medium |
CN113778430A (en) * | 2021-02-02 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Data rendering method, device and equipment of small program and storage medium |
CN113761404A (en) * | 2021-02-09 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Page access method, server, terminal equipment, system and electronic equipment |
CN113553074B (en) * | 2021-07-23 | 2023-07-25 | 北京百度网讯科技有限公司 | Applet distribution control method, device, electronic equipment and storage medium |
CN113553074A (en) * | 2021-07-23 | 2021-10-26 | 北京百度网讯科技有限公司 | Applet distribution control method, device, electronic equipment and storage medium |
CN113905091A (en) * | 2021-09-15 | 2022-01-07 | 盐城金堤科技有限公司 | Method and device for processing access request |
CN113905091B (en) * | 2021-09-15 | 2023-09-01 | 盐城天眼察微科技有限公司 | Method and device for processing access request |
CN114490752A (en) * | 2021-12-31 | 2022-05-13 | 北京声智科技有限公司 | Data acquisition method and device, electronic equipment and storage medium |
CN114510296A (en) * | 2022-02-25 | 2022-05-17 | 支付宝(杭州)信息技术有限公司 | Applet storage and calling method, device and equipment |
CN114510296B (en) * | 2022-02-25 | 2024-02-02 | 支付宝(杭州)信息技术有限公司 | Applet storage calling method, device and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112000394B (en) | 2024-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112000394B (en) | Method, apparatus, device and storage medium for accessing applet | |
KR102563165B1 (en) | Memory access request scheduling method, device, apparatus, and storage medium | |
EP3058481B1 (en) | Acceleration based on cached flows | |
CN112073994A (en) | Method and device for over-the-air upgrading, electronic equipment and readable storage medium | |
CN109918191B (en) | Method and device for preventing frequency of service request | |
CN111770161B (en) | https sniffing jump method and device | |
CN111881387B (en) | Data processing method, device, equipment and medium for small program | |
CN112100481A (en) | Search method, search device, electronic device, and storage medium | |
KR102572726B1 (en) | Compiling optimization method and device for hosting application, electronic equipment and readable storage medium | |
CN111813623B (en) | Page monitoring method and device, electronic equipment and storage medium | |
CN111782254A (en) | Method, device, equipment and storage medium for upgrading object | |
CN110765075A (en) | Storage method and equipment of automatic driving data | |
CN114513468B (en) | Method, device, equipment, storage medium and product for protecting flow in Sentinel | |
CN113094139B (en) | UI style updating method and device | |
CN113158098A (en) | Page generation method, device, equipment and medium | |
US11689630B2 (en) | Request processing method and apparatus, electronic device, and computer storage medium | |
CN111639116B (en) | Data access connection session protection method and device | |
CN112069137A (en) | Method and device for generating information, electronic equipment and computer readable storage medium | |
CN111966877A (en) | Front-end service method, device, equipment and storage medium | |
US11748438B2 (en) | Customizable redaptor extensions for single-page web applications | |
CN112379945B (en) | Method, apparatus, device and storage medium for running application | |
CN112579096B (en) | Method, device, equipment and medium for compiling and loading applet startup file | |
CN112752323B (en) | Method and device for changing hot spot access state | |
CN115639953A (en) | Data migration method and device | |
CN111835857B (en) | Method and apparatus for accessing data |
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 |