CN112202876A - Request processing method and device and electronic equipment - Google Patents

Request processing method and device and electronic equipment Download PDF

Info

Publication number
CN112202876A
CN112202876A CN202011045221.2A CN202011045221A CN112202876A CN 112202876 A CN112202876 A CN 112202876A CN 202011045221 A CN202011045221 A CN 202011045221A CN 112202876 A CN112202876 A CN 112202876A
Authority
CN
China
Prior art keywords
page
shopping
shopping cart
storage area
current 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
Application number
CN202011045221.2A
Other languages
Chinese (zh)
Other versions
CN112202876B (en
Inventor
钟望
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202011045221.2A priority Critical patent/CN112202876B/en
Publication of CN112202876A publication Critical patent/CN112202876A/en
Application granted granted Critical
Publication of CN112202876B publication Critical patent/CN112202876B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5683Storage of data provided by user terminals, i.e. reverse caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0641Shopping interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a request processing method, a request processing device and electronic equipment, wherein the login state of a current client is detected in response to a request of adding a target commodity to a shopping cart; and if the current client is not logged in, storing the commodity information of the target commodity in a local storage area of the current client. In the method, when the client is in the non-login state, the commodity information added to the shopping cart is stored in the local storage area of the current client, and compared with a method of storing the shopping cart data through the server, on one hand, complete shopping cart data can be provided for the user under different network environments, and on the other hand, unnecessary server overhead and network overhead are reduced.

Description

Request processing method and device and electronic equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a request processing method and apparatus, and an electronic device.
Background
In the related art, a shopping cart service in a shopping website needs to be realized by the cooperation of a front-end client and a back-end server. For example, when a user adds a commodity A to a shopping cart, the client sends a shopping cart updating request to the server, the server updates the commodity information of the commodity A to the shopping cart data of the user, the server stores the shopping cart data of the user, and the complete shopping cart data of the user is returned to the client. If the user does not log in, the server side cannot identify which user sends the shopping cart updating request, and only can store the shopping cart data of the IP address based on the IP address in the request; however, if the user changes the network environment, the IP address changes, and it is difficult for the server to provide the user with complete shopping cart data, and unnecessary server overhead and network overhead are also incurred.
Disclosure of Invention
In view of the above, the present invention provides a request processing method, an apparatus and an electronic device, which can save shopping cart data to a local storage of a client when a user does not log in, so as to reduce server overhead and network overhead.
In a first aspect, an embodiment of the present invention provides a request processing method, where the method includes: detecting a login state of a current client in response to a request to add a target commodity to a shopping cart; and if the current client is not logged in, storing the commodity information of the target commodity in a local storage area of the current client.
Further, the current storage area local to the client includes: and the local storage area corresponding to the appointed sub-page loaded in the first shopping page to which the target commodity belongs.
Further, the step of detecting the login status of the current client includes: sending the request to a designated sub-page to detect the login state of the current client through the designated sub-page; the step of saving the commodity information of the target commodity to a local storage area of the current client comprises the following steps: through the appointed sub-page, updating the commodity information of the target commodity to the shopping cart data stored in the local storage area corresponding to the appointed sub-page; wherein the shopping cart data comprises: the commodity information of the commodity added to the shopping cart.
Further, after the step of storing the commodity information of the target commodity in a local storage area of the current client, the method further includes: and acquiring the shopping cart data in the local storage area of the appointed sub-page through the appointed sub-page, and sending the shopping cart data to the first shopping page so that the shopping cart data is displayed in the first shopping page.
Further, the local storage area includes: the localstorage stores objects.
Further, the first shopping page and the designated sub-page communicate through a postMessage interface function.
Furthermore, the designated sub-page is also used for being loaded into a second shopping page, and the local storage area corresponding to the designated sub-page stores commodity information of commodities added to the shopping cart in the second shopping page.
Further, the appointed sub page is loaded in the first shopping page through an iframe tag; the iframe tag is in a hidden display state in the first shopping page.
Further, the current storage area local to the client includes: and the local storage area corresponds to the first shopping page to which the target commodity belongs.
Further, after the step of storing the commodity information of the target commodity in a local storage area of the current client, the method further includes: when a current client logs in a server, shopping cart data are acquired from a local storage area of the current client; and sending the shopping cart data to the server so as to store the shopping cart data and the account association of the current client to the server.
In a second aspect, an embodiment of the present invention provides a request processing apparatus, where the apparatus includes: the detection module is used for responding to a request for adding the target commodity to the shopping cart and detecting the login state of the current client; and the storage module is used for storing the commodity information of the target commodity to a local storage area of the current client if the current client is not logged in.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the request processing method of the first aspect.
In a fourth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the request processing method of the first aspect.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a request processing method, a request processing device and electronic equipment, wherein the login state of a current client is detected in response to a request of adding a target commodity to a shopping cart; and if the current client is not logged in, storing the commodity information of the target commodity in a local storage area of the current client. In the method, when the client is in the non-login state, the commodity information added to the shopping cart is stored in the local storage area of the current client, and compared with a method of storing the shopping cart data through the server, on one hand, complete shopping cart data can be provided for the user under different network environments, and on the other hand, unnecessary server overhead and network overhead are reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a request processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another request processing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a request processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, a shopping cart service in a shopping website needs to be realized by the cooperation of a front-end client and a back-end server. For example, when a user adds a commodity A to a shopping cart, the client sends a shopping cart updating request to the server, the server updates the commodity information of the commodity A to the shopping cart data of the user, the server stores the shopping cart data of the user, and the complete shopping cart data of the user is returned to the client. If the user does not log in, the server side cannot identify which user sends the shopping cart updating request, and only can store the shopping cart data of the IP address based on the IP address in the request; on the basis of the request processing method, the request processing device and the electronic equipment, which are provided by the embodiment of the invention, the technology can be applied to equipment such as mobile phones, computers, tablet computers and the like, and particularly can be applied to equipment with a shopping function.
To facilitate understanding of the present embodiment, a detailed description is first provided for a request processing method disclosed in the embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, responding to a request of adding a target commodity to a shopping cart, and detecting the login state of the current client.
The current client may be a web browser, an application with shopping capabilities, etc. Specifically, when a user carries out cloud shopping through a client in equipment such as a mobile phone and a computer, the user can browse commodities displayed on a shopping page through the shopping page provided by the current client and select a target commodity from the commodities; and adding the target commodity to the shopping cart through a control for adding the shopping cart in the shopping page. In response to a request for adding a target commodity to a shopping cart, a current client may detect a login state of the current client, that is, whether an account (or a user) logs in through a shopping page to which the target commodity belongs or a sub-page loaded on the shopping page to which the target commodity belongs.
And step S104, if the current client is not logged in, the commodity information of the target commodity is stored in a local storage area of the current client.
The commodity information of the target commodity comprises information such as the name, the attribute, the category, the quantity and the like of the commodity; the local storage area of the current client includes a local storage area corresponding to a first shopping page to which the target commodity belongs, and may further include a local storage area corresponding to a designated sub-page loaded in the first shopping page to which the target commodity belongs. The local storage area is usually a storage space set by a web browser, and is used for storing shopping data of the current client.
Specifically, if the current client is not logged in, the commodity information of the target commodity can be stored in a local storage area corresponding to a first shopping page to which the target commodity belongs through the first shopping page to which the target commodity belongs; or through the appointed sub-page loaded in the first shopping page to which the target commodity belongs, the commodity information of the target commodity is stored in the local storage area corresponding to the appointed sub-page loaded in the first shopping page to which the target commodity belongs.
In this embodiment, the local storage area of the current client includes: and the local storage area corresponding to the appointed sub-page loaded in the first shopping page to which the target commodity belongs.
The process of loading the designated sub-page in the first shopping page can be specifically completed in the following manner: running a current client, and loading a preset front-end SDK (Software Development Kit) on a first shopping page when the first shopping page is opened; and setting a webpage label in the first shopping page through a preset front-end SDK.
A designated sub-page can be loaded through the webpage label; when the web page tag is included in the first shopping page, it is usually equivalent to nesting another small browser in the current first shopping page (also called parent page), and the small browser can load the designated sub page (also called child page) like a normal browser. In addition, a display component of the shopping cart is established in the first shopping page, and the first shopping page is displayed; the webpage label of the first shopping page is in a hidden state and is not displayed on a user interface; the display component of the shopping cart is mainly used for displaying information of commodities added at present, including the quantity of the commodities and the like.
The embodiment of the invention provides a request processing method, which is used for responding to a request of adding a target commodity to a shopping cart and detecting the login state of a current client; and if the current client is not logged in, storing the commodity information of the target commodity in a local storage area of the current client. In the method, when the client is in the non-login state, the commodity information added to the shopping cart is stored in the local storage area of the current client, and compared with a method of storing the shopping cart data through the server, on one hand, complete shopping cart data can be provided for the user under different network environments, and on the other hand, unnecessary server overhead and network overhead are reduced.
The present embodiment further provides another request processing method, which is implemented on the basis of the foregoing embodiment, and the present embodiment mainly describes a specific implementation process of a step of detecting a login state of a current client (implemented by step S202), a specific implementation process of a step of saving commodity information of a target commodity to a local storage area of the current client (implemented by step S204), and a specific implementation process of a step after the step of saving commodity information of the target commodity to the local storage area of the current client (implemented by steps S206 to S210).
The local storage area in the foregoing embodiment includes: a localstorage storage object; in the local storage area of the localstorage storage object, only the first shopping page of the current client can be accessed; each webpage domain name has an independent storage area; for example, the domain name of the first shopping page is a.com, and the domain name of the second shopping page is b.com, at this time, the first shopping page cannot access the data stored in the storage area of the second shopping page.
The localstorage storage object is only accessible by the client, and compared with the cookie storage object, both the client and the server can access data in the storage area, the data is sent to the server along with an http request under the condition that a user logs in or does not log in, but the data stored in the cookie storage object may be redundant for the current request, so that additional network traffic overhead may be brought, and the local storage area in this embodiment includes: the localstorage storage object can avoid the problems.
As shown in fig. 2, the method comprises the steps of:
step S202, responding to a request for adding the target commodity to the shopping cart, sending the request to a specified sub-page so as to detect the login state of the current client through the specified sub-page.
The request usually includes related information of the target product, such as name, attribute, quantity, etc. of the target product; after the first shopping page receives a request of adding a target commodity to a shopping cart, the request can be sent to a designated sub-page in an interface function mode; and after the appointed sub-page receives the request sent by the first shopping page, the login state of the current client side is detected, and whether the current client side logs in is judged.
The first shopping page and the appointed sub-page loaded by the first shopping page are communicated through a postMessage interface function; the postMessage interface function is a communication mechanism between a parent webpage and a sub-webpage, and the parent webpage and the sub-webpage can mutually transmit messages to each other and receive messages transmitted by each other through the postMessage interface function. That is, after the first shopping page receives the request for adding the target product to the shopping cart, the request can be sent to the designated sub-page through the postMessage interface function.
Step S204, if the current client is not logged in, the commodity information of the target commodity is updated to the shopping cart data stored in the local storage area corresponding to the appointed sub-page through the appointed sub-page; wherein the shopping cart data comprises: the commodity information of the commodity added to the shopping cart.
Specifically, if the designated sub-page detects that the current client is not logged in, the commodity information of the target commodity can be updated to the shopping cart data stored in the local storage area corresponding to the designated sub-page in an incremental storage manner; that is, the shopping cart data stored in the local storage area corresponding to the designated sub-page stores m data, and then stores n data therein, so that the shopping cart data stored in the local storage area corresponding to the designated sub-page includes two data, m and n. If the commodity information of the target commodity is the same as the commodity in the shopping cart data stored in the local storage area corresponding to the designated sub-page, only the quantity of the commodity is updated, and the quantity of the commodity of the target commodity can be increased on the original data.
In addition, if the appointed sub-page detects that the current client is logged in, sending commodity information of the target commodity to the server and storing the commodity information in the server; after the storage is successful, the server sends the full shopping cart data to the first shopping page through the postMessage.
Step S206, acquiring the shopping cart data in the local storage area of the appointed sub-page through the appointed sub-page, and sending the shopping cart data to the first shopping page so as to display the shopping cart data in the first shopping page.
After commodity information of a target commodity is updated to shopping cart data stored in a local storage area corresponding to an appointed sub-page through the appointed sub-page, the appointed sub-page is in a hidden state and cannot be displayed on a user interface, shopping cart data in the local storage area of the appointed sub-page can be obtained through the appointed sub-page, the shopping cart data are sent to a first shopping page through a postMessage interface function, after the shopping cart data are received by the first shopping page, the commodity information in the shopping cart data is extracted, the commodity information is updated to the first shopping page, and the commodity information is displayed in a shopping cart component of the first shopping page.
It should be noted that all the data in the above steps are stored in the client, and no request is sent to the server. In addition, in the case where the client has already added a product to the shopping cart without logging in, and then logs in the client, the data stored in the client may be subjected to the following synchronization processing:
in step S208, when the current client logs in to the server, shopping cart data is acquired from a local storage area of the current client.
Step S210, sending the shopping cart data to a server so as to store the shopping cart data and the account of the current client in a correlated manner to the server.
The local storage area of the current client is a local storage area corresponding to a designated sub-page loaded in a first shopping page to which the target commodity belongs; specifically, after the current client logs in the server, the appointed sub-page sends the shopping cart data in the local storage area corresponding to the appointed sub-page to the server, and after receiving the new shopping cart data, the server combines the shopping cart data already stored in the server with the shopping cart data sent from the appointed sub-page; and simultaneously storing the combined shopping cart data and the account of the current client in a related manner to the server.
Then the server sends the final shopping cart data stored in a correlated mode to the appointed sub-page, and after the appointed sub-page receives the final shopping cart data sent by the server, the final shopping cart data are sent to the first shopping page through a postMessage interface function; and meanwhile, the designated sub-page clears the data stored in the corresponding local storage area.
In the method, the shopping cart data are stored in the local storage area corresponding to the appointed sub-page loaded in the first shopping page, and are communicated with the first shopping page through the postMessage interface function, so that the situation that a user logs in is avoided, the client sends an http request to the server, the shopping cart data can be stored in the local storage area of the client, and all the shopping cart data are stored in the local storage area of the client when the user does not log in, the server overhead and the network overhead are reduced, and the waste of service resources is reduced.
Considering that the localstorage storage object can only take effect under the domain name of the current page, shopping webpages with different domain names cannot simultaneously access shopping data in the same localstorage storage object, for example, a market mall is composed of two sub-pages, namely a shopping page of a self-owned mall and a shopping page of a third-party mall, the domain name of the shopping page of the self-owned mall is a.market.com, and the domain name of the shopping page of the third-party mall is b.market.com; at this time, the shopping pages of the self-service mall and the shopping pages of the third-party mall can only store corresponding shopping data respectively, that is, the shopping data of the shopping pages of the self-service mall is stored in the local storage area corresponding to the sub-page loaded in the shopping pages of the self-service mall; the shopping data of the shopping page of the third-party mall is stored in a local storage area corresponding to the sub-page loaded in the shopping page of the third-party mall; the shopping data of two system pages cannot be stored into the local storage area corresponding to the same sub-page at the same time. The shopping pages of different systems cannot be shared, and unnecessary waste of service resources is generated.
Based on this, the present embodiment further provides another request processing method, which is implemented on the basis of the foregoing embodiment; the appointed sub page is loaded in a first shopping page through an iframe label; the iframe tag is in a hidden display state in the first shopping page.
When the iframe tag is set in the first shopping page, the small browser can load a designated sub-page (also called a sub-web page) like a normal browser, which is equivalent to nesting another small browser in the current first shopping page (also called a parent web page). And the main domain name of the designated sub-page is the same as the main domain name of the first shopping page.
The appointed sub-page is also used for being loaded into a second shopping page, and commodity information of commodities added to the shopping cart in the second shopping page is stored in a local storage area corresponding to the appointed sub-page. Wherein, the designated sub-page can also be called a proxy page.
The second shopping page and the first shopping page belong to the current client, and the process of loading the designated sub-page in the second shopping page can be specifically completed in the following way:
when the current client is operated, the first shopping page and the second shopping page are respectively loaded with a preset front end SDK; setting the same iframe tag in the first shopping page and the second shopping page through a preset front end SDK; a designated sub-page may be loaded through the iframe tag. Because the same iframe tag is set in the first shopping page and the second shopping page, the designated sub-page loaded by the iframe tag is the same as the main domain names of the first shopping page and the second shopping page.
For example, the domain name of the first shopping page is a.mark.com and the domain name of the second shopping page is b.mark.com; then the loaded designated subpage may be proxy.mark.com; the main domain name of the appointed sub-page is the same as the main domain names of the first shopping page and the second shopping page; the postMessage interface function can communicate between the parent webpage and the sub-webpage with the same main domain name, so that the designated sub-page can communicate with the first shopping page and the second shopping page respectively, and the local storage area corresponding to the designated sub-page can also store commodity information of commodities added to the shopping cart in the second shopping page. The process of saving the commodity information of the commodity added to the shopping cart in the second shopping page is the same as the process of saving the commodity information of the commodity added to the shopping cart in the first shopping page in the local storage area corresponding to the designated sub-page, and is not described herein again.
After the step of saving the commodity information of the target commodity in the local storage area of the current client, similarly, the shopping cart data in the local storage area of the designated sub-page is obtained through the designated sub-page, and the shopping cart data is sent to the corresponding first shopping page or second shopping page, so that the shopping cart data is displayed in the first shopping page or the second shopping page.
In the above manner, by using the iframe tag and the localstorage storage object in a matching manner, the front-end shopping pages of different systems can access the same designated sub-page together and use the storage area corresponding to the designated sub-page together, so that service resources are saved; the shopping cart data can be stored in the local storage of the client under the condition that the user does not log in, and the shopping cart data in each page share the same local storage area under the cross-system condition, so that the situation that the client sends an http request to the server under the condition that the user does not log in is avoided, and meanwhile, all the shopping cart data are stored in the local storage area of the client when the user does not log in, and the server overhead and the network overhead are reduced.
Corresponding to the above method embodiment, this embodiment further provides a request processing apparatus, as shown in fig. 3, the apparatus includes:
a detecting module 31, configured to detect a login status of a current client in response to a request for adding a target commodity to a shopping cart.
And the storage module 32 is configured to store the commodity information of the target commodity in a local storage area of the current client if the current client is not logged in.
The embodiment of the invention provides a request processing device, which responds to a request for adding a target commodity to a shopping cart and detects the login state of a current client; and if the current client is not logged in, storing the commodity information of the target commodity in a local storage area of the current client. In the method, when the client is in the non-login state, the commodity information added to the shopping cart is stored in the local storage area of the current client, and compared with a method of storing the shopping cart data through the server, on one hand, complete shopping cart data can be provided for the user under different network environments, and on the other hand, unnecessary server overhead and network overhead are reduced.
Further, the storage area local to the current client includes: and the local storage area corresponding to the appointed sub-page loaded in the first shopping page to which the target commodity belongs.
Further, the detection module is further configured to: sending the request to a designated sub-page to detect the login state of the current client through the designated sub-page; the storage module is further configured to: through the appointed sub-page, updating the commodity information of the target commodity to the shopping cart data stored in the local storage area corresponding to the appointed sub-page; wherein the shopping cart data comprises: the commodity information of the commodity added to the shopping cart.
Further, the above apparatus is further configured to: and acquiring the shopping cart data in the local storage area of the appointed sub-page through the appointed sub-page, and sending the shopping cart data to the first shopping page so that the shopping cart data is displayed in the first shopping page.
Further, the local storage area includes: the localstorage stores objects.
Further, the first shopping page and the designated sub-page communicate through a postMessage interface function.
Further, the designated sub-page is also used for being loaded into a second shopping page, and the local storage area corresponding to the designated sub-page stores commodity information of commodities added to the shopping cart in the second shopping page.
Further, the specified sub-page is loaded in the first shopping page through an iframe tag; the iframe tag is in a hidden display state in the first shopping page.
Further, the storage area local to the current client includes: and the local storage area corresponds to the first shopping page to which the target commodity belongs.
Further, the above apparatus is further configured to: when a current client logs in a server, shopping cart data are acquired from a local storage area of the current client; and sending the shopping cart data to the server so as to store the shopping cart data and the account association of the current client to the server.
The processing request device provided by the embodiment of the invention has the same technical characteristics as the processing request method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
The embodiment also provides an electronic device, which comprises a processor and a memory, wherein the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to realize the request processing method.
Referring to fig. 4, the electronic device includes a processor 100 and a memory 101, where the memory 101 stores machine executable instructions capable of being executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the request processing method.
Further, the electronic device shown in fig. 4 further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.
The Memory 101 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
Processor 100 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 100. The Processor 100 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The present embodiments also provide a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the request processing method described above.
The request processing method, the request processing apparatus, and the computer program product of the electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (13)

1. A method for processing a request, the method comprising:
detecting a login state of a current client in response to a request to add a target commodity to a shopping cart;
and if the current client is not logged in, the commodity information of the target commodity is stored in a local storage area of the current client.
2. The method of claim 1, wherein the memory region local to the current client comprises: and the local storage area corresponding to the appointed sub-page loaded in the first shopping page to which the target commodity belongs.
3. The method of claim 2, wherein the step of detecting the login status of the current client comprises: sending the request to the appointed sub-page so as to detect the login state of the current client through the appointed sub-page;
the step of saving the commodity information of the target commodity to a local storage area of the current client comprises the following steps: updating the commodity information of the target commodity to the shopping cart data stored in the local storage area corresponding to the appointed sub-page through the appointed sub-page; wherein the shopping cart data comprises: the commodity information of the commodity added to the shopping cart.
4. The method of claim 2, wherein after the step of saving the item information of the target item to a storage area local to the current client, the method further comprises:
and acquiring shopping cart data in a local storage area of the appointed sub-page through the appointed sub-page, and sending the shopping cart data to the first shopping page so as to display the shopping cart data in the first shopping page.
5. The method of claim 2, wherein the local storage area comprises: the localstorage stores objects.
6. The method of claim 2, wherein the first shopping page and the designated sub-page communicate through a postMessage interface function.
7. The method of claim 2, wherein the designated subpage is further used for being loaded into a second shopping page, and the local storage area corresponding to the designated subpage stores commodity information of commodities added to the shopping cart in the second shopping page.
8. The method of claim 2, wherein the designated subpage is loaded in the first shopping page via an iframe tag; the iframe tag is in a hidden display state in the first shopping page.
9. The method of claim 1, wherein the memory region local to the current client comprises: and the local storage area corresponds to the first shopping page to which the target commodity belongs.
10. The method of claim 1, wherein after the step of saving the item information of the target item to a storage area local to the current client, the method further comprises:
when the current client logs in a server, acquiring shopping cart data from a local storage area of the current client;
and sending the shopping cart data to the server so as to store the shopping cart data and the account association of the current client to the server.
11. A request processing apparatus, characterized in that the apparatus comprises:
the detection module is used for responding to a request for adding the target commodity to the shopping cart and detecting the login state of the current client;
and the storage module is used for storing the commodity information of the target commodity to a local storage area of the current client if the current client is not logged in.
12. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the request processing method of any one of claims 1 to 10.
13. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the request processing method of any of claims 1-10.
CN202011045221.2A 2020-09-28 2020-09-28 Request processing method and device and electronic equipment Active CN112202876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011045221.2A CN112202876B (en) 2020-09-28 2020-09-28 Request processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011045221.2A CN112202876B (en) 2020-09-28 2020-09-28 Request processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112202876A true CN112202876A (en) 2021-01-08
CN112202876B CN112202876B (en) 2022-05-03

Family

ID=74007792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011045221.2A Active CN112202876B (en) 2020-09-28 2020-09-28 Request processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112202876B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621737A (en) * 2008-06-30 2010-01-06 北京腾瑞万里科技有限公司 Data updating method and system
US20120011014A1 (en) * 2010-07-08 2012-01-12 Microsoft Corporation Media purchase techniques
CN103685514A (en) * 2013-12-13 2014-03-26 北京奇虎科技有限公司 Method for storing page in webpage favorite and browser
CN104615700A (en) * 2015-01-27 2015-05-13 北京奇虎科技有限公司 Method for collecting webpage objects in browser, browser client side and system
CN105808767A (en) * 2016-03-21 2016-07-27 北京小米移动软件有限公司 Data updating method and apparatus
CN108665335A (en) * 2017-04-01 2018-10-16 北京京东尚科信息技术有限公司 The method for handling the shopping cart data of shopping website
CN110162543A (en) * 2019-05-29 2019-08-23 北京奇艺世纪科技有限公司 A kind of information query method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621737A (en) * 2008-06-30 2010-01-06 北京腾瑞万里科技有限公司 Data updating method and system
US20120011014A1 (en) * 2010-07-08 2012-01-12 Microsoft Corporation Media purchase techniques
CN103685514A (en) * 2013-12-13 2014-03-26 北京奇虎科技有限公司 Method for storing page in webpage favorite and browser
CN104615700A (en) * 2015-01-27 2015-05-13 北京奇虎科技有限公司 Method for collecting webpage objects in browser, browser client side and system
CN105808767A (en) * 2016-03-21 2016-07-27 北京小米移动软件有限公司 Data updating method and apparatus
CN108665335A (en) * 2017-04-01 2018-10-16 北京京东尚科信息技术有限公司 The method for handling the shopping cart data of shopping website
CN110162543A (en) * 2019-05-29 2019-08-23 北京奇艺世纪科技有限公司 A kind of information query method and device

Also Published As

Publication number Publication date
CN112202876B (en) 2022-05-03

Similar Documents

Publication Publication Date Title
US20200410185A1 (en) Computer configured to display multimedia content
US9483572B2 (en) Interactivity analyses of web resources based on reload events
CN104065632B (en) The processing method of sharing contents, server, client and system
CN108880921B (en) Webpage monitoring method and device, storage medium and server
CN110020367B (en) Page rendering method and device
US8826122B2 (en) Method, system and device for displaying a web page
EP3528474B1 (en) Webpage advertisement anti-shielding methods and content distribution network
US20150237153A1 (en) Method, device and system for pushing network data
CN108574721B (en) Login method, device, server, user terminal and readable storage medium
CN111107056A (en) Method and device for calling out-link URL (Uniform resource locator) resource and protocol conversion server
WO2014206108A1 (en) Method, apparatus and system for displaying text contents on mobile terminal
KR20140093491A (en) Method, system and computer-readable storage medium storing computer program for handling shortened url
CN111651703A (en) Page jump method and device, electronic equipment and readable storage medium
CN110704771A (en) Page abnormity monitoring method, system, device, electronic equipment and readable medium
US10095791B2 (en) Information search method and apparatus
CN112346944B (en) Method, equipment and storage medium for monitoring operation experience of webpage user
CN112202876B (en) Request processing method and device and electronic equipment
US20150317143A1 (en) Method and apparatus for installing webpage application
CN112187622A (en) Instant message display method and device and server
CN111767481A (en) Access processing method, device, equipment and storage medium
CN109951549B (en) Network page access method and device and computer readable storage medium
CN111783010A (en) Webpage blank page monitoring method, device, terminal and storage medium
CN115421693A (en) Method and device for realizing micro front-end architecture, computer equipment and storage medium
CN111435516B (en) Order processing method and device, electronic equipment and storage medium
KR100683901B1 (en) Monitoring method of an web contents, computer readable medium storing the same, and monitoring system for the performing the same

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