CN112989250B - Web service response method and device and electronic equipment - Google Patents

Web service response method and device and electronic equipment Download PDF

Info

Publication number
CN112989250B
CN112989250B CN202110268060.1A CN202110268060A CN112989250B CN 112989250 B CN112989250 B CN 112989250B CN 202110268060 A CN202110268060 A CN 202110268060A CN 112989250 B CN112989250 B CN 112989250B
Authority
CN
China
Prior art keywords
web service
service request
response result
service response
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110268060.1A
Other languages
Chinese (zh)
Other versions
CN112989250A (en
Inventor
崔轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110268060.1A priority Critical patent/CN112989250B/en
Publication of CN112989250A publication Critical patent/CN112989250A/en
Application granted granted Critical
Publication of CN112989250B publication Critical patent/CN112989250B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24539Query rewriting; Transformation using cached or materialised query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Abstract

The disclosure provides a Web service response method and device and electronic equipment, and relates to the technical fields of network communication, web service and the like in computer technology. The specific scheme is as follows: receiving a first Web service request sent by first electronic equipment, wherein the first Web service request comprises a first value of a cache marking parameter; responding to the first Web service request, and returning a first service response result to the first electronic equipment under the condition that the first value is a first preset value and the first service response result corresponding to the first Web service request is queried in the cache. After receiving the first Web service request sent by the first electronic device, if the first value of the cache marking parameter in the first Web service request is a first preset value, a first service response result corresponding to the first Web service request can be queried in the cache, and the first service response result can be returned to the first electronic device under the condition that the first service response result corresponding to the first Web service request is queried in the cache, so that the service response efficiency can be improved.

Description

Web service response method and device and electronic equipment
Technical Field
The present invention relates to the technical fields of network communications and Web services in computer technologies, and in particular, to a Web service response method and apparatus, and an electronic device.
Background
With the development of internet technology, access to Web content by using a Web browser is becoming more and more popular, for example, in Web services, by sending a Web service request to a Web server, the Web server responds to the Web service request, calculates a response result required by the Web service request in an underlying database, and returns the response result, thereby realizing Web service response.
Disclosure of Invention
The application provides a Web service response method and device and electronic equipment.
In a first aspect, an embodiment of the present application provides a Web service response method, including:
receiving a first Web service request sent by first electronic equipment, wherein the first Web service request comprises a first value of a cache marking parameter;
responding to the first Web service request, and returning a first service response result to the first electronic equipment under the condition that the first value is a first preset value and the first service response result corresponding to the first Web service request is queried in a cache.
In this embodiment, after receiving a first Web service request sent by a first electronic device, if a first value of a cache flag parameter in the first Web service request is a first preset value, a first service response result corresponding to the first Web service request may be queried in a cache, and if the first service response result corresponding to the first Web service request is queried in the cache, the first service response result may be returned to the first electronic device. That is, the first service response result may be stored in the cache, and after the first Web service request is received, the first service response result may be queried and returned in the cache under the condition that the first value is the first preset value, so that service response efficiency may be improved.
In a second aspect, one embodiment of the present application provides a Web service response apparatus, the apparatus including:
the first receiving module is used for receiving a first Web service request sent by the first electronic equipment, wherein the first Web service request comprises a first value of a cache marking parameter;
the first return module is configured to respond to the first Web service request, and return a first service response result to the first electronic device when the first value is a first preset value and a first service response result corresponding to the first Web service request is queried in a cache.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
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 Web service response methods provided by the embodiments of the present application.
In a fourth aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the Web service response method provided by the embodiments of the present application.
In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the Web service response method provided by embodiments of the present application.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
FIG. 1 is one of the flow diagrams of a Web service response method of one embodiment provided herein;
FIG. 2 is a second flow chart of a Web service response method according to one embodiment provided herein;
FIG. 3 is a block diagram of a Web service response device of one embodiment provided herein;
fig. 4 is a block diagram of an electronic device for implementing a Web service response method of an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, according to an embodiment of the present application, the present application provides a Web service response method, which includes:
step S101: receiving a first Web service request sent by first electronic equipment, wherein the first Web service request comprises a first value of a cache marking parameter;
the Web service response method can be applied to fourth electronic equipment, the fourth electronic equipment can be a Web server and the like, the first electronic equipment can be first client equipment, for example, the first electronic equipment can be electronic equipment of a user using a Web browser, the user performs related operations in the first electronic equipment, and a first Web service request can be sent to the fourth electronic equipment through the first electronic equipment. The value of the cache tag parameter (cache tag) may be added to the Web service request, and in this embodiment, the first Web service request includes the value of the cache tag parameter as the first value. As one example, the value of the cache tag parameter may be added in the header (header) of the Web service request, i.e., the header of the first Web service request includes the first value of the cache tag parameter. It should be noted that, the first Web service request is used to request a response result of the corresponding Web service, for example, the first Web service request may be used to request a response result of the first Web service, and the first Web service may be understood to be any Web service of the plurality of Web services that may be provided by the Web server.
Step S102: responding to the first Web service request, and returning a first service response result to the first electronic equipment under the condition that the first value is a first preset value and the first service response result corresponding to the first Web service request is queried in the cache.
And under the condition that the first value is a first preset value, the cache can be queried, namely, whether the cache comprises a first service response result required by the first Web service request is queried, and if so, the first service response result queried in the cache is returned to the first electronic equipment. It can be understood that the first service response result corresponding to the first Web service request may be stored in the cache in advance, and after the first Web service request is received, if the first value is a first preset value, the first service response result corresponding to the Web service request stored in the cache in advance may be returned to the first electronic device, so as to improve the response speed of the Web service. And even if the first electronic device accesses the first service response result for the first time, the service response efficiency can be improved by querying the first service response result in the cache and returning the first service response result to the first electronic device. As an example, the first preset value is a preset value, which is not limited in this embodiment, and may be, for example, 2 or the like. In addition, as an example, when the first service response result corresponding to the first Web service request is not queried in the cache, error prompt information is returned to the first electronic device, so as to remind the first Web service request to be an error request.
In this embodiment, after receiving a first Web service request sent by a first electronic device, if a first value of a cache flag parameter in the first Web service request is a first preset value, a first service response result corresponding to the first Web service request may be queried in a cache, and if the first service response result corresponding to the first Web service request is queried in the cache, the first service response result may be returned to the first electronic device. That is, the first service response result may be stored in the cache, and after the first Web service request is received, the first service response result may be queried and returned in the cache under the condition that the first value is the first preset value, so that service response efficiency may be improved.
As shown in fig. 2, in one embodiment, before returning the first service response result to the first electronic device, the method further includes:
step S1011: receiving a second Web service request sent by second electronic equipment, wherein the second Web service request comprises a second value of a cache marking parameter;
step S1012: responding to a second Web service request, and inquiring a second service response result corresponding to the second Web service request in the bottom database under the condition that the second value is a second preset value;
step S1013: and storing a second service response result in the cache, wherein the second service response result comprises the first service response result.
The second electronic device may be a second client device, for example, an electronic device used by a Web service developer, through which a second Web service request may be sent, where the value of the cache tag parameter carried therein is a second value. That is, in this embodiment, before the first service response result is returned to the first electronic device, the second Web service request sent by the second electronic device may be received in advance, where the second value of the cache marking parameter is a second preset value, the second service response result corresponding to the second Web service request is queried in the underlying database and stored in the cache, and the second service response result includes the first service response result, so the first service response result may be stored in the cache in advance, and after the first Web service request is subsequently received, the first service response result may be directly queried in the cache and returned without going to the query result in the underlying database, so the service response efficiency may be improved.
As an example, the second preset value is a preset value, which is not limited in this embodiment, and may be, for example, 3 or the like. In addition, it should be noted that the number of the second Web service requests may be multiple, for each Web service request, as long as the second value of the cache marking parameter carried by the second Web service request is a second preset value, the corresponding second service response result may be queried in the underlying database, so that multiple second service response results may be obtained and stored in the cache, and it may be understood that the first service response result belongs to multiple second service response results, that is, the multiple second service response results include the first service response result. As an example, after querying the underlying database for the second service response result corresponding to the second Web service request, the method further includes: and returning the second service response result to the second electronic equipment so that a user of the second electronic equipment can check the second service response result.
In one embodiment, before returning the first service response result to the first electronic device, the method further includes:
receiving a third Web service request sent by third electronic equipment, wherein the third Web service request comprises a third value of a cache marking parameter;
responding to the third Web service request, inquiring a third service response result corresponding to the third Web service request in the bottom database under the condition that the third value is a third preset value and the third service response result corresponding to the third Web service request is not inquired in the cache, storing the third service response result in the cache, and returning the third service response result to the third electronic equipment.
The third electronic device may be a third client device, for example, an electronic device used by a Web service tester, and the third electronic device may send a third Web service request, where a value of the carried cache tag parameter is a third value. That is, in this embodiment, before the first service response result is returned to the first electronic device, the third Web service request sent by the third electronic device may be received in advance, where the cache may be queried if the third value of the cache flag parameter is a third preset value, and if the third service response result requested by the third Web service request is not queried in the cache, the second service response result corresponding to the second Web service request is queried in the underlying database, and the third service response result is stored in the cache, so as to facilitate the subsequent query efficiency of the third service response result. Therefore, the subsequent user requests the third service response result through the first electronic device, can directly inquire the third service response result in the cache and return the third service response result, and improves the response efficiency of the subsequent response to the third service response result.
As an example, when the third value is a third preset value and a third service response result corresponding to the third Web service request is queried in the cache, the third service response result is returned to the third electronic device, so that service response efficiency is improved.
As an example, the third preset value is a preset value, which is not limited in this embodiment, and may be, for example, 0 or the like.
In one embodiment, after receiving the third Web service request sent by the third electronic device, the method further includes:
responding to the third Web service request, inquiring a third service response result corresponding to the third Web service request in the bottom database and returning the third service response result to the third electronic equipment under the condition that the third value is a fourth preset value and the third service response result corresponding to the third Web service request is not inquired in the cache.
In this embodiment, when the third value is the fourth preset value, the cache may be queried, and if the third service response result requested by the third Web service request is not queried in the cache, the third service response result corresponding to the third Web service request is queried in the underlying database, and the third service response result is returned to the third electronic device, which may not need to be stored in the cache, so as to reduce the storage burden of the cache. It may be understood that, in the case that the values of the cache marking parameters of the third Web service request are different, different cache policies may be used for processing, for example, in the case that the third value is a third preset value and the third service response result corresponding to the third Web service request is not queried in the cache, the third service response result corresponding to the third Web service request is queried in the underlying database, and the third service response result may be stored in the cache and returned to the third electronic device. And under the condition that the third value is a fourth preset value and the third service response result corresponding to the third Web service request is not queried in the cache, querying the third service response result corresponding to the third Web service request in the bottom database, and returning the third service response result to the third electronic equipment without storing the third service response result in the cache. Thus, the flexibility of storing the service response results can be improved.
As an example, when the third value is a fourth preset value and a third service response result corresponding to the third Web service request is queried in the cache, the third service response result is returned to the third electronic device, so that service response efficiency is improved.
As an example, the fourth preset value is a preset value, and is not limited in this embodiment, and for example, 1 or the like may be taken.
In one embodiment, after receiving the third Web service request sent by the third electronic device, the method further includes:
responding to the third Web service request, and under the condition that the third value is a fifth preset value, inquiring a third service response result corresponding to the third Web service request in the bottom database, and returning the third service response result to the third electronic equipment.
That is, in this embodiment, if the third value is the fifth preset value, the bottom database may be directly queried, that is, the third service response result corresponding to the third Web service request may be queried in the bottom database, and returned to the third electronic device. In this embodiment, whether to query the cache or query the underlying database first may be determined according to a third value of the cache tag parameter carried by the third Web service request, if the third value is a fifth preset value, a third service response result corresponding to the third Web service request may be queried in the underlying database, and then the third service response result may be returned to the third electronic device, so as to improve flexibility of service response.
As an example, the fifth preset value is a preset value, and is not limited in this embodiment, and for example, 4 or the like may be taken.
In the process of querying the second service response result or the third service response result in the underlying database, that is, invoking the second Web service corresponding to the second Web service request (which may be understood as a second Web service interface) in the underlying database, calculating the corresponding second service response result, or invoking the third Web service corresponding to the third Web service request (which may be understood as a third Web service interface), and calculating the corresponding third service response result. I.e., calculate the response results required for the request in the underlying database, the response results may be stored in a cache.
The procedure of the service response method described above is specifically described in one embodiment,
firstly, defining a Web service caching strategy, taking a cache tag in a header as a basis of a caching strategy switching mode by a system, adding a value of the cache tag in the header of a request when the request is sent, and configuring a corresponding caching strategy, wherein the corresponding caching strategy is shown in the following table 1.
TABLE 1
In table 1, the sign (∈) indicates that this behavior is present, and the sign indicates that this behavior is not performed in the actual request and is performed sequentially from left to right.
The corresponding caching strategy can be used for responding to different users later.
For example, the service developer: and (3) pre-calculating each pre-defined Web service interface by adopting a strategy 3 (namely, a cache value is 3), firstly inquiring an actual bottom database, and then storing the inquired service response result into a cache.
And (3) a client: the data stored in the cache may be requested using a default policy 2 (i.e., a cache value of 2), and when there is no hit in the cache, this indicates that the client has accessed the unauthorized data, and returns Error hint information (Error Request). When the cache hits, the hit service response result can be returned.
Service tester: the Web service interfaces in different situations can be tested with default policies 0 (i.e., a cachetag value of 0), 1 (i.e., a cachetag value of 1), and 4 (i.e., a cachetag value of 4).
In the embodiment of the application, different caching strategies can be adopted for multiple angles of a developer, a client and a debugging tester in the Web service process to be flexibly used, and finally, data needed by a user is pre-calculated and stored in a database, so that the response speed of the client for accessing the service is accelerated. That is, the embodiment of the application provides a self-defined Web service response method capable of improving response speed, which not only solves the problem of first access acceleration of clients and improves the client request experience effect, but also solves the problem of different cache policy requirements among different users.
As shown in fig. 3, according to an embodiment of the present application, there is further provided a Web service response apparatus 300, which is applicable to a fourth electronic device, the apparatus 300 including:
a first receiving module 301, configured to receive a first Web service request sent by a first electronic device, where the first Web service request includes a first value of a cache tag parameter;
the first return module 302 is configured to respond to the first Web service request, and return a first service response result to the first electronic device when the first value is a first preset value and a first service response result corresponding to the first Web service request is queried in the cache.
In one embodiment, the apparatus 300 further comprises:
the second receiving module is used for receiving a second Web service request sent by the second electronic device before the first returning module returns the first service response result to the first electronic device, wherein the second Web service request comprises a second value of the cache marking parameter;
the first query module is used for responding to the second Web service request, and querying a second service response result corresponding to the second Web service request in the bottom database under the condition that the second value is a second preset value;
the first storage module is used for storing a second service response result in the cache, and the second service response result comprises a first service response result.
In one embodiment, the apparatus 300 further comprises:
the third receiving module is used for receiving a third Web service request sent by the third electronic device before the first returning module returns the first service response result to the first electronic device, wherein the third Web service request comprises a third value of the cache marking parameter;
the second query module is used for responding to the third Web service request, and querying a third service response result corresponding to the third Web service request in the bottom database under the condition that the third value is a third preset value and the third service response result corresponding to the third Web service request is not queried in the cache;
the second storage module is used for storing the third service response result in the cache;
and the third return module is used for returning a third service response result to the third electronic equipment.
In one embodiment, the apparatus 300 further comprises:
the third query module is configured to respond to the third Web service request after the third receiving module executes the third Web service request sent by the third electronic device, and query a third service response result corresponding to the third Web service request in the underlying database if the third value is a fourth preset value and a third service response result corresponding to the third Web service request is not queried in the cache;
and the fourth return module is used for returning a third service response result to the third electronic equipment.
In one embodiment, the apparatus 300 further comprises:
the fourth query module is used for responding to the third Web service request after the third receiving module receives the third Web service request sent by the third electronic device, and querying a third service response result corresponding to the third Web service request in the bottom database under the condition that the third value is a fifth preset value;
and the fifth return module is used for returning a third service response result to the third electronic equipment.
The Web service response device in each embodiment is a device for implementing the Web service response method in each embodiment, and has corresponding technical features and corresponding technical effects, which are not described herein again.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product.
The non-transitory computer-readable storage medium of the embodiment of the present application stores computer instructions for causing a computer to execute the Web service response method provided by the present application.
The computer program product of the embodiments of the present application includes a computer program for causing a computer to execute the Web service response method provided by the embodiments of the present application.
Fig. 4 shows a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present 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 telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In RAM403, various programs and data required for the operation of device 400 may also be stored. The computing unit 401, ROM 402, and RAM403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in electronic device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, etc.; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 401 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized artificial intelligence (I) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the respective methods and processes described above, such as the Web service response method. For example, in some embodiments, the Web service response method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When the computer program is loaded into RAM403 and executed by computing unit 401, one or more steps of the Web service response method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the Web service response method by any other suitable means (e.g., by means of firmware). Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a first electronic device and a server. The first electronic device and the server are generally remote from each other and typically interact through a communication network. The relationship of the first electronic device and server arises by virtue of computer programs running on the respective computers and having a first electronic device-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (10)

1. A Web service response method, the method comprising:
receiving a first Web service request sent by first electronic equipment, wherein the first Web service request comprises a first value of a cache marking parameter;
responding to the first Web service request, and returning a first service response result to the first electronic equipment under the condition that the first value is a first preset value and the first service response result corresponding to the first Web service request is queried in a cache;
wherein before the first service response result is returned to the first electronic device, the method further includes:
receiving a second Web service request sent by second electronic equipment, wherein the second Web service request comprises a second value of a cache marking parameter;
responding to the second Web service request, and inquiring a second service response result corresponding to the second Web service request in a bottom database under the condition that the second value is a second preset value;
and storing the second service response result in the cache, wherein the second service response result comprises the first service response result.
2. The method of claim 1, wherein before the returning the first service response result to the first electronic device, further comprising:
receiving a third Web service request sent by third electronic equipment, wherein the third Web service request comprises a third value of a cache marking parameter;
responding to the third Web service request, inquiring a third service response result corresponding to the third Web service request in a bottom database under the condition that the third value is a third preset value and the third service response result corresponding to the third Web service request is not inquired in a cache, storing the third service response result in the cache, and returning the third service response result to the third electronic equipment.
3. The method of claim 2, wherein after receiving the third Web service request sent by the third electronic device, further comprising:
responding to the third Web service request, inquiring a third service response result corresponding to the third Web service request in a bottom database and returning the third service response result to the third electronic equipment under the condition that the third value is a fourth preset value and the third service response result corresponding to the third Web service request is not inquired in a cache.
4. The method of claim 2, wherein after receiving the third Web service request sent by the third electronic device, further comprising:
and responding to the third Web service request, and inquiring a third service response result corresponding to the third Web service request in a bottom database under the condition that the third value is a fifth preset value, and returning the third service response result to the third electronic equipment.
5. A Web service response apparatus, the apparatus comprising:
the first receiving module is used for receiving a first Web service request sent by the first electronic equipment, wherein the first Web service request comprises a first value of a cache marking parameter;
the first return module is used for responding to the first Web service request, and returning a first service response result to the first electronic device when the first value is a first preset value and the first service response result corresponding to the first Web service request is queried in a cache;
wherein, still include:
the second receiving module is used for receiving a second Web service request sent by second electronic equipment before the first returning module returns the first service response result to the first electronic equipment, wherein the second Web service request comprises a second value of a cache marking parameter;
the first query module is used for responding to the second Web service request, and querying a second service response result corresponding to the second Web service request in a bottom database under the condition that the second value is a second preset value;
and the first storage module is used for storing the second service response result in the cache, and the second service response result comprises the first service response result.
6. The apparatus of claim 5, further comprising:
a third receiving module, configured to receive a third Web service request sent by a third electronic device before the first returning module returns the first service response result to the first electronic device, where the third Web service request includes a third value of a cache tag parameter;
the second query module is used for responding to the third Web service request, and querying a third service response result corresponding to the third Web service request in a bottom database under the condition that the third value is a third preset value and the third service response result corresponding to the third Web service request is not queried in the cache;
the second storage module is used for storing the third service response result in the cache;
and the third return module is used for returning the third service response result to the third electronic equipment.
7. The apparatus of claim 6, further comprising:
the third query module is configured to, after the third receiving module executes receiving a third Web service request sent by a third electronic device, respond to the third Web service request, and query a third service response result corresponding to the third Web service request in a bottom database if the third value is a fourth preset value and a third service response result corresponding to the third Web service request is not queried in a cache;
and the fourth return module is used for returning the third service response result to the third electronic equipment.
8. The apparatus of claim 6, further comprising:
the fourth query module is configured to, after the third receiving module executes receiving a third Web service request sent by a third electronic device, respond to the third Web service request, and query a third service response result corresponding to the third Web service request in a bottom database if the third value is a fifth preset value;
and a fifth return module, configured to return the third service response result to the third electronic device.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions for execution by the at least one processor to enable the at least one processor to perform the Web service response method of any one of claims 1-4.
10. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the Web service response method of any one of claims 1-4.
CN202110268060.1A 2021-03-11 2021-03-11 Web service response method and device and electronic equipment Active CN112989250B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110268060.1A CN112989250B (en) 2021-03-11 2021-03-11 Web service response method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110268060.1A CN112989250B (en) 2021-03-11 2021-03-11 Web service response method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112989250A CN112989250A (en) 2021-06-18
CN112989250B true CN112989250B (en) 2024-01-12

Family

ID=76334600

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110268060.1A Active CN112989250B (en) 2021-03-11 2021-03-11 Web service response method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112989250B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8543554B1 (en) * 2010-08-10 2013-09-24 ScalArc Inc. Method and system for transparent database query caching
CN103593419A (en) * 2013-10-30 2014-02-19 华为技术有限公司 Method, device, server and system for inquiring data
US8763091B1 (en) * 2010-08-24 2014-06-24 ScalArc Inc. Method and system for user authentication offload in a transparent database load balancer
JP2014212480A (en) * 2013-04-19 2014-11-13 Necプラットフォームズ株式会社 Proxy dns server having cache function and dns query response method
JP2015197909A (en) * 2014-04-02 2015-11-09 株式会社 ビーアイマトリックス Online analytical processing method using 2 level query by sql parsing and result cashing for processing large capacity data
WO2015196413A1 (en) * 2014-06-26 2015-12-30 Intel Corporation Memcached systems having local caches
JP2018074395A (en) * 2016-10-28 2018-05-10 学校法人東京電機大学 Data communication system, cache dns device and cyber attack prevention method
CN109145020A (en) * 2018-07-23 2019-01-04 程之琴 Information query method, from server, client and computer readable storage medium
CN109284309A (en) * 2018-10-16 2019-01-29 翟红鹰 Database caches method, terminal and computer readable storage medium
CN110012106A (en) * 2019-04-15 2019-07-12 北京邮电大学 A kind of coordination caching method, apparatus and system based on edge calculations
CN111510480A (en) * 2020-04-08 2020-08-07 北京百度网讯科技有限公司 Request sending method and device and first server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9426249B2 (en) * 2013-08-05 2016-08-23 Salesforce.Com, Inc. Providing an improved web user interface framework for building web applications

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8543554B1 (en) * 2010-08-10 2013-09-24 ScalArc Inc. Method and system for transparent database query caching
US8763091B1 (en) * 2010-08-24 2014-06-24 ScalArc Inc. Method and system for user authentication offload in a transparent database load balancer
JP2014212480A (en) * 2013-04-19 2014-11-13 Necプラットフォームズ株式会社 Proxy dns server having cache function and dns query response method
CN103593419A (en) * 2013-10-30 2014-02-19 华为技术有限公司 Method, device, server and system for inquiring data
JP2015197909A (en) * 2014-04-02 2015-11-09 株式会社 ビーアイマトリックス Online analytical processing method using 2 level query by sql parsing and result cashing for processing large capacity data
WO2015196413A1 (en) * 2014-06-26 2015-12-30 Intel Corporation Memcached systems having local caches
JP2018074395A (en) * 2016-10-28 2018-05-10 学校法人東京電機大学 Data communication system, cache dns device and cyber attack prevention method
CN109145020A (en) * 2018-07-23 2019-01-04 程之琴 Information query method, from server, client and computer readable storage medium
CN109284309A (en) * 2018-10-16 2019-01-29 翟红鹰 Database caches method, terminal and computer readable storage medium
CN110012106A (en) * 2019-04-15 2019-07-12 北京邮电大学 A kind of coordination caching method, apparatus and system based on edge calculations
CN111510480A (en) * 2020-04-08 2020-08-07 北京百度网讯科技有限公司 Request sending method and device and first server

Also Published As

Publication number Publication date
CN112989250A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112866391A (en) Message pushing method and device, electronic equipment and storage medium
CN112671892B (en) Data transmission method, device, electronic equipment and medium
CN112989250B (en) Web service response method and device and electronic equipment
CN113010535A (en) Cache data updating method, device, equipment and storage medium
CN115514718B (en) Data interaction method, control layer and equipment based on data transmission system
CN113986135B (en) Method, device, equipment and storage medium for processing request
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN115599571A (en) Data processing method and device, electronic equipment and storage medium
CN115567602A (en) CDN node back-to-source method, device and computer readable storage medium
CN115145748A (en) Cross-process communication method, device, equipment and storage medium
CN113726885A (en) Method and device for adjusting flow quota
CN117032991B (en) Gray scale publishing method, device and system
CN114793234B (en) Message processing method, device, equipment and storage medium
CN113220282B (en) Development processing method, device and storage medium for applet
CN116225559B (en) Open screen information display method and device, electronic equipment and storage medium
EP3992794A2 (en) Method and apparatus for acquiring information
CN115334040B (en) Method and device for determining Internet Protocol (IP) address of domain name
CN113641428B (en) Method and device for acquiring special effect scene packet, electronic equipment and readable storage medium
CN114428646B (en) Data processing method and device, electronic equipment and storage medium
CN116112441A (en) Service request current limiting method, device, electronic equipment and storage medium
CN112559574B (en) Data processing method, device, electronic equipment and readable storage medium
US20220155087A1 (en) Map data processing method, device, storage medium and program product
CN114647634A (en) Method for creating database, method and device for operating database
CN116578800A (en) Page rendering method and device, electronic equipment and computer readable storage medium
CN114924826A (en) Page fusion method, device and equipment based on different code platforms

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