CN114513558B - User request processing method and device - Google Patents

User request processing method and device Download PDF

Info

Publication number
CN114513558B
CN114513558B CN202210111807.7A CN202210111807A CN114513558B CN 114513558 B CN114513558 B CN 114513558B CN 202210111807 A CN202210111807 A CN 202210111807A CN 114513558 B CN114513558 B CN 114513558B
Authority
CN
China
Prior art keywords
target
session data
user
storage
user request
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
CN202210111807.7A
Other languages
Chinese (zh)
Other versions
CN114513558A (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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202210111807.7A priority Critical patent/CN114513558B/en
Publication of CN114513558A publication Critical patent/CN114513558A/en
Application granted granted Critical
Publication of CN114513558B publication Critical patent/CN114513558B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a user request processing method and device, and relates to the technical field of data processing. One embodiment of the method comprises the following steps: receiving a user request of a target user for a target event; determining whether a time window of the target event is longer than a preset duration to obtain a judging result; determining a target storage according to the judging result, and further acquiring relevant session data of the target user aiming at the target event from the target storage; writing the session data requested by the user into the related session data to generate updated session data; and processing the user request according to the updated session data. The implementation reduces the memory consumption required by the system and reduces the risk of system breakdown.

Description

User request processing method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for processing a user request.
Background
Current financial systems require that the full amount of historical data for unexpired transaction event sessions be stored in server memory when processing transaction events. The data volume of the whole historical data of the transaction event session is huge, and without a good distributed algorithm, the system cannot directly process the large data, so that the memory is insufficient to cause the system to crash.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for processing a user request, which can reduce the memory consumption required by a system, thereby reducing the risk of system crash.
In a first aspect, an embodiment of the present invention provides a method for processing a user request, including:
receiving a user request of a target user for a target event;
determining whether a time window of the target event is longer than a preset duration to obtain a judging result;
determining a target storage according to the judging result, and further acquiring relevant session data of the target user aiming at the target event from the target storage;
writing the session data requested by the user into the related session data to generate updated session data;
and processing the user request according to the updated session data.
Optionally, the determining the target storage according to the determination result includes:
and under the condition that the time window of the judging result representing the target event is larger than the preset duration, determining the target storage as persistent storage.
Optionally, the persisting storage comprises: database and/or disk files.
Optionally, the determining the target storage according to the determination result includes:
and under the condition that the time window of the judging result representing the target event is not more than the preset duration, determining that the target is stored as a server memory.
Optionally, the processing the user request according to the updated session data includes:
determining whether the updated session data meets a preset rule;
and under the condition that the updated session data meets the preset rule, performing response processing aiming at the preset rule on the updated session data.
Optionally, the response processing for the preset rule includes at least one of the following: wind control interception, marketing reminding and equipment fault reminding.
Optionally, after the processing the user request according to the updated session data, the method further includes:
deleting the related session data from the target store;
writing the updated session data in the target storage.
Optionally, the acquiring, from the target storage, relevant session data of the target user for the target event includes:
acquiring a user identification of the target user from the user request;
determining a target rule engine component corresponding to the user identifier;
and routing the user request to the target rule engine component, and acquiring relevant session data of the target user for the target event from the target storage by utilizing the target rule engine component.
Optionally, before the acquiring, from the target storage, the relevant session data of the target user for the target event, the method further includes:
determining whether the relevant session data is stored in the target storage;
and under the condition that the relevant session data is not stored in the target storage, establishing the session data of the target user aiming at the target event according to the request information of the user request.
In a second aspect, an embodiment of the present invention provides a processing apparatus for a user request, including:
the request receiving module is used for receiving a user request of a target user for a target event;
the judging module is used for determining whether the time window of the target event is larger than a preset duration so as to obtain a judging result;
the data acquisition module is used for determining a target storage according to the judging result, and further acquiring relevant session data of the target user aiming at the target event from the target storage;
the updating module is used for writing the session data requested by the user into the related session data to generate updated session data;
and the processing module is used for processing the user request according to the updated session data.
Optionally, the data acquisition module is specifically configured to:
and under the condition that the time window of the judging result representing the target event is larger than the preset duration, determining the target storage as persistent storage.
Optionally, the persisting storage comprises: database and/or disk files.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the methods of any of the embodiments described above.
In a fourth aspect, embodiments of the present invention provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the above embodiments.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising a computer program which, when executed by a processor, implements a method as described in any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: and determining whether the time window of the target event is longer than a preset duration to obtain a judging result. And determining target storage according to the judging result. The preset time length and the target storage can be set according to the needs. For example, in the case where the time window of the target event is long, the target storage is determined to be persistent storage, and the relevant session data is acquired from the persistent storage. And under the condition that the time window of the target event is short, determining that the target is stored as a server memory, and acquiring related session data from the server memory. Compared with the mode that the whole session data are put into the memory of the server, the memory consumption required by the system can be reduced, and the risk of system breakdown is further reduced.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a flow chart of a method for processing a user request according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for processing a user request according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a method for processing a user request according to a third embodiment of the present invention;
FIG. 4 is a schematic architecture diagram of a processing system for user requests according to a fourth embodiment of the present invention;
FIG. 5 is a schematic diagram of a device for processing a user request according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The data acquisition, storage, use, processing and the like in the technical scheme meet the relevant regulations of national laws and regulations.
In order to facilitate understanding of the technical solution of the embodiments of the present application, some professional data related to the embodiments of the present application are explained:
transaction: a user initiated request in a financial system.
Long-acting: long term validity is commonly used to describe data and events with validity periods on the order of more than one day.
Running water: transaction behavior records of users on the system.
Rule engine: by a specific configuration, detection of a transaction combination of a given rule is achieved.
Complex event processing: an analysis technique based on dynamic environmental event streams.
A session: a set of intermediate states for complex event detection in a complex event processing engine.
Fig. 1 is a flow chart of a method for processing a user request according to a first embodiment of the present invention, as shown in fig. 1, the method includes:
step 101: a user request for a target event is received by a target user.
The target event corresponds to a series of related interactions performed by the user with the system. For example: after a user initiates a transaction request in a financial system, a series of interactions between the user and the system may be regarded as a target event.
Step 102: and determining whether the time window of the target event is longer than a preset duration to obtain a judging result.
The event window is the effective duration of the target event. The time window may be set according to the event type and specific requirements. The time types of the target events are different, and the time windows of the target events can also be different.
The preset time period can be set according to specific requirements. For example, the preset duration may be: 6 hours, 12 hours, 24 hours, etc. By setting the preset duration, session data of events with different time windows can be stored in different target stores, so that the memory of a server consumed by processing the events is saved.
Step 103: and determining a target storage according to the judging result, and further acquiring the relevant session data of the target user aiming at the target event from the target storage.
The target store is to store session data for the target event. The target store may include: persistent storage, server memory, etc. Persistent storage may include: databases, disk files, XML data files, etc.
The relevant session data is session data related to a target event, and may be generated based on relevant session data requested by a previous user of the target event. The previous user request is a user request that occurs before the current user request.
In one embodiment of the present invention, it may be determined whether the relevant session data is stored in the target storage; and under the condition that the relevant session data is not stored in the target storage, establishing the session data of the target user aiming at the target event according to the request information of the user request. And under the condition that the relevant session data of the target user aiming at the target event does not exist in the target storage, creating the session data corresponding to the current user request as the relevant session data of the target user aiming at the target event.
In one embodiment of the present invention, the user identifier of the target user may be obtained from the user request; determining a target rule engine component corresponding to the user identifier; and routing the user request to the target rule engine component, and acquiring relevant session data of the target user for the target event from the target storage by utilizing the target rule engine component.
And determining the target rule engine component by using a preset algorithm or random according to the user identification. The preset algorithm may include: taking the modulus, obtaining the remainder, and the like. And the user request is routed to the examples of different rule engine components, so that on one hand, the efficiency of processing the user request is improved. On the other hand, it is also necessary to ensure that the requests of each target user are processed on one server at the same time, so as to reduce the occurrence of inconsistent transaction data processing for the same user.
Step 104: and writing the session data requested by the user into the related session data to generate updated session data.
The updated session data stores the complete session data of the target user aiming at the target event. Relevant processing of the user request may be performed based on the updated session data.
Step 105: and processing the user request according to the updated session data.
At least one preset rule can be set according to specific requirements. The preset rule may include: preset algorithms and/or keyword expressions, etc. The preset method can comprise the following steps: accurate recognition algorithms, regular expression recognition algorithms, etc. The keyword expression includes at least one keyword, and the keyword expression may further include: and, or, non-equal logic operators, combining at least one keyword through the logic operators to obtain a keyword expression.
Determining whether the updated session data meets a preset rule by using a preset algorithm or a keyword expression and the like; and under the condition that the updated session data meets the preset rule, performing response processing aiming at the preset rule on the updated session data. The response processing for the preset rule may include at least one of: wind control interception, marketing reminding and equipment fault reminding. Through setting up the rule of predetermineeing, can in time discover risk or business opportunity that probably exists in the transaction process, accomplish functions such as wind control interception, marketing warning, and user request that can release is submitted to core transaction subassembly again finally.
In the embodiment of the invention, whether the time window of the target event is larger than the preset duration is determined so as to obtain a judging result. And determining target storage according to the judging result. The preset time length and the target storage can be set according to the needs. For example, in the case where the time window of the target event is long, the target storage is determined to be persistent storage, and the relevant session data is acquired from the persistent storage. And under the condition that the time window of the target event is short, determining that the target is stored as a server memory, and acquiring related session data from the server memory. Compared with the mode that the historical data of the whole session are put into the memory of the server, the memory consumption required by the system can be reduced, and the risk of system breakdown is further reduced.
Fig. 2 is a flow chart of a method for processing a user request according to a second embodiment of the present invention, as shown in fig. 2, the method includes:
step 201: a user request for a target event is received by a target user.
Step 202: and determining whether the time window of the target event is longer than a preset duration to obtain a judging result.
The preset time period can be set according to specific requirements. By setting the preset duration, session data of events with different time windows can be stored in different target stores, so that the memory of a server consumed by processing the events is saved.
Step 203: and under the condition that the time window of the judging result representing the target event is larger than the preset duration, determining the target storage as persistent storage.
Persistent storage may include: databases, disk files, XML data files, etc. Relevant session data for the target event with the longer time window is stored in the persistent storage. And in the process of processing the user request of the target event, reading the related session data of the target event from the persistent storage to the memory of the server for processing.
Step 204: relevant session data of the target user for the target event is obtained from the persistent storage.
Step 205: and writing the session data requested by the user into the related session data to generate updated session data.
Step 206: and processing the user request according to the updated session data.
Step 207: and deleting the related session data from the persistent storage.
Step 208: writing the updated session data in the persistent storage.
And deleting the related session data from the persistent storage, and then writing the updated session data to ensure that the complete session data of the target user aiming at the target event is stored in the persistent storage.
In an embodiment of the invention, relevant session data of a target event with a longer time window is stored in a persistent storage. And in the process of processing the user request of the target event, reading the related session data of the target event from the persistent storage to the memory of the server for processing. On the one hand, the problem of memory overflow possibly caused in the memory where mass data reside is avoided through a persistence technology. On the other hand, the database is used for replacing the memory, so that the storage of a large amount of data is realized. The reliability of the distributed database is far higher than that of the distributed memory under the same condition. The scheme of the embodiment of the invention can support the time processing of a larger-scale data set and a longer-acting time window while reducing the memory consumption of the server.
Fig. 3 is a flow chart of a method for processing a user request according to a third embodiment of the present invention, as shown in fig. 3, the method includes:
step 301: a user request for a target event is received by a target user.
Step 302: and determining whether the time window of the target event is longer than a preset duration to obtain a judging result.
The preset time period can be set according to specific requirements. By setting the preset duration, session data of events with different time windows can be stored in different target stores, so that the memory of a server consumed by processing the events is saved.
Step 303: and under the condition that the time window of the judging result representing the target event is not more than the preset duration, determining that the target is stored as a server memory.
And storing the related session data of the target event with the shorter time window in the memory of the server. In the process of processing the user request of the target event, the relevant session record of the target event is directly read from the memory of the server for processing.
Step 304: and acquiring the relevant session data of the target user aiming at the target event from the memory of the server.
Step 305: and writing the session data requested by the user into the related session data to generate updated session data.
Step 306: and processing the user request according to the updated session data.
Step 307: and deleting the related session data from the memory of the server.
Step 308: and writing the updated session data into the memory of the server.
And deleting the related session data from the service memory, and then writing the updated session data to ensure that the complete session data of the target user aiming at the target event is stored in the server memory.
In the embodiment of the invention, the related session data of the target event with a shorter time window is stored in the memory of the server. In the process of processing the user request of the target event, the relevant session record of the target event is directly read from the memory of the server for processing. Because the time window of the target event is shorter, if the relevant session data of the target time is stored in the persistent storage, the data interaction between the memory of the server and the persistent storage is likely to be performed frequently in a shorter time, so that the system performance is adversely affected.
Fig. 4 is a schematic architecture diagram of a processing system for user requests according to a fourth embodiment of the present invention. As shown in fig. 4, the architecture includes: transaction system and rule engine cluster. The user sends a user request to the transaction system, which receives the user request through the transaction preprocessing component and routes the user request to the data access component in the rules engine cluster. The data access component invokes the rules engine component to process the user request. The rule engine component invokes the persistence component that reads the user-related session from the persistence store and if there is no user-related session in the persistence component, creates the user-related session. The rule engine component inserts the newly received user request into the relevant session of the user, judges whether the user request meets the corresponding rule or not, obtains a detection result, and writes the new session back into the persistent storage through the persistence component. The rules engine component then invokes the complex event record to record the relevant information for the user request in a log or database.
The rule engine component returns the detection result to the data preprocessing component, and the event response component in the transaction system responds in a correlated manner according to the detection result, so that the functions of wind control interception, marketing reminding and the like are completed. And submitting the user request to a core transaction component for subsequent processing under the condition that the detection result characterizes that the detection is passed. The processing system is based on the persistence technology of the session, except for initializing the new complex event session, reads the related session from the persistence storage every time the new related event is processed, inserts the session information of the new event into the related session, and generates new session information. And carrying out rule judgment according to the new session information. And after the processing is finished, the new session is restored in the persistent storage, and the memory is released. Thus, memory overflow caused by excessive effective events can be avoided. The problems of high availability and data concentration can be effectively solved through the prior art of database-level distribution and database-splitting.
The embodiment of the invention also provides a processing method of the user request. The method can be used in a system architecture as shown in fig. 4, the method comprising:
step S01: after the transaction system is requested by the user, the data is first delivered to the data access component in the rule engine cluster.
Step S02: the data access component routes data to instances of different rule engine components based on user ID, ensuring that each user's request is handled on one machine at the same time.
Step S03: the rule engine firstly reads the session related to the user from the persistence storage, if not, one is newly built, a new user request is inserted into the session, whether the corresponding rule is met or not is judged, and after the judgment is finished, the new session is written back to the persistence storage through the persistence component.
Step S04: for the event which meets a certain rule, firstly, the event is recorded for data analysis, then the result is returned to the data preprocessing component, the transaction system responds in a related manner according to the detection result, the functions of wind control interception, marketing reminding and the like are completed, and finally, the released transaction is submitted to the core transaction component.
According to the scheme provided by the embodiment of the invention, the problem of memory overflow possibly caused in the memory where mass data reside is avoided through a persistence technology. And a database is used for replacing a memory, so that the storage of a large amount of data is realized. The reliability of the distributed database is far higher than that of the distributed memory under the same condition. Not only is the memory consumption low, but also a larger scale data set and a longer time window can be supported.
Fig. 5 is a schematic structural diagram of a processing apparatus for user request according to an embodiment of the present invention, as shown in fig. 5, the apparatus includes:
a request receiving module 501, configured to receive a user request of a target user for a target event;
a determining module 502, configured to determine whether a time window of the target event is greater than a preset duration, so as to obtain a determination result;
a data obtaining module 503, configured to determine a target storage according to the determination result, and further obtain, from the target storage, relevant session data of the target user for the target event;
an updating module 504, configured to write the session data requested by the user into the relevant session data, and generate updated session data;
and the processing module 505 is configured to process the user request according to the updated session data.
Optionally, the data acquisition module 503 is specifically configured to:
and under the condition that the time window of the judging result representing the target event is larger than the preset duration, determining the target storage as persistent storage.
Optionally, the persisting storage comprises: database and/or disk files.
Optionally, the data acquisition module 503 is specifically configured to:
and under the condition that the time window of the judging result representing the target event is not more than the preset duration, determining that the target is stored as a server memory.
Optionally, the processing module 505 is specifically configured to:
determining whether the updated session data meets a preset rule;
and under the condition that the updated session data meets the preset rule, performing response processing aiming at the preset rule on the updated session data.
Optionally, the response processing for the preset rule includes at least one of the following: wind control interception, marketing reminding and equipment fault reminding.
Optionally, the method further comprises:
an updating module 506, configured to delete the relevant session data from the target storage;
writing the updated session data in the target storage.
Optionally, the data acquisition module 503 is specifically configured to:
acquiring a user identification of the target user from the user request;
determining a target rule engine component corresponding to the user identifier;
and routing the user request to the target rule engine component, and acquiring relevant session data of the target user for the target event from the target storage by utilizing the target rule engine component.
Optionally, the method further comprises:
a creation module 507, configured to determine whether the relevant session data is stored in the target storage;
and under the condition that the relevant session data is not stored in the target storage, establishing the session data of the target user aiming at the target event according to the request information of the user request.
The embodiment of the invention provides electronic equipment, which comprises:
one or more processors;
storage means for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the methods of any of the embodiments described above.
An embodiment of the invention provides a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the above embodiments of the invention.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: the device comprises a request receiving module, a judging module, a data acquisition module, an updating module and a processing module. The names of these modules do not constitute a limitation on the module itself in some cases, and for example, the request receiving module may also be described as "a module that receives a user request of a target user for a target event".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include:
receiving a user request of a target user for a target event;
determining whether a time window of the target event is longer than a preset duration to obtain a judging result;
determining a target storage according to the judging result, and further acquiring relevant session data of the target user aiming at the target event from the target storage;
writing the session data requested by the user into the related session data to generate updated session data;
and processing the user request according to the updated session data.
According to the technical scheme of the embodiment of the invention, whether the time window of the target event is larger than the preset duration is determined so as to obtain a judging result. And determining target storage according to the judging result. The preset time length and the target storage can be set according to the needs. For example, in the case where the time window of the target event is long, the target storage is determined to be persistent storage, and the relevant session data is acquired from the persistent storage. And under the condition that the time window of the target event is short, determining that the target is stored as a server memory, and acquiring related session data from the server memory. Compared with the mode that the historical data of the whole session are put into the memory of the server, the memory consumption required by the system can be reduced, and the risk of system breakdown is further reduced.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for processing a user request, comprising:
receiving a user request of a target user for a target event;
determining whether a time window of the target event is larger than a preset duration to obtain a judging result, wherein the time window refers to the effective duration of the target event;
determining a target storage according to the judging result, and further acquiring relevant session data of the target user aiming at the target event from the target storage;
writing the session data requested by the user into the related session data to generate updated session data;
processing the user request according to the updated session data; and determining target storage according to the judging result, wherein the method comprises the following steps:
determining that the target storage is persistent storage under the condition that the time window of the judging result representing the target event is larger than the preset duration;
determining that the target is stored as a server memory under the condition that the time window of the judging result representing the target event is not more than the preset duration;
the obtaining, from the target storage, relevant session data of the target user for the target event includes:
acquiring a user identification of the target user from the user request;
determining a target rule engine component corresponding to the user identifier;
and routing the user request to the target rule engine component, and acquiring relevant session data of the target user for the target event from the target storage by utilizing the target rule engine component.
2. The method of claim 1, wherein the persistent storage comprises: database and/or disk files.
3. The method of claim 1, wherein said processing said user request based on said updated session data comprises:
determining whether the updated session data meets a preset rule;
and under the condition that the updated session data meets the preset rule, performing response processing aiming at the preset rule on the updated session data.
4. A method according to claim 3, wherein the response processing for the preset rule comprises at least one of: wind control interception, marketing reminding and equipment fault reminding.
5. The method of claim 1, wherein said processing said user request based on said updated session data further comprises:
deleting the related session data from the target store;
writing the updated session data in the target storage.
6. The method of claim 1, wherein prior to the retrieving from the target store the relevant session data for the target user for the target event, further comprising:
determining whether the relevant session data is stored in the target storage;
and under the condition that the relevant session data is not stored in the target storage, establishing the session data of the target user aiming at the target event according to the request information of the user request.
7. A user request processing apparatus, comprising:
the request receiving module is used for receiving a user request of a target user for a target event;
the judging module is used for determining whether a time window of the target event is larger than a preset duration to obtain a judging result, wherein the time window refers to the effective duration of the target event;
the data acquisition module is used for determining a target storage according to the judging result, and further acquiring relevant session data of the target user aiming at the target event from the target storage;
the updating module is used for writing the session data requested by the user into the related session data to generate updated session data;
the processing module is used for processing the user request according to the updated session data;
the data acquisition module is specifically configured to:
determining that the target storage is persistent storage under the condition that the time window of the judging result representing the target event is larger than the preset duration;
determining that the target is stored as a server memory under the condition that the time window of the judging result representing the target event is not more than the preset duration;
the data acquisition module is specifically configured to:
acquiring a user identification of the target user from the user request;
determining a target rule engine component corresponding to the user identifier;
and routing the user request to the target rule engine component, and acquiring relevant session data of the target user for the target event from the target storage by utilizing the target rule engine component.
8. The apparatus of claim 7, wherein the persistent storage comprises: database and/or disk files.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202210111807.7A 2022-01-29 2022-01-29 User request processing method and device Active CN114513558B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210111807.7A CN114513558B (en) 2022-01-29 2022-01-29 User request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210111807.7A CN114513558B (en) 2022-01-29 2022-01-29 User request processing method and device

Publications (2)

Publication Number Publication Date
CN114513558A CN114513558A (en) 2022-05-17
CN114513558B true CN114513558B (en) 2023-06-16

Family

ID=81552486

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210111807.7A Active CN114513558B (en) 2022-01-29 2022-01-29 User request processing method and device

Country Status (1)

Country Link
CN (1) CN114513558B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787349A (en) * 2020-05-19 2020-10-16 视联动力信息技术股份有限公司 Data caching method, device, equipment and medium
CN112532732A (en) * 2020-12-03 2021-03-19 郑州阿帕斯数云信息科技有限公司 HTTPS-based session processing method and device
CN113010115A (en) * 2021-03-18 2021-06-22 腾讯科技(深圳)有限公司 Data processing method in block chain node and related equipment
CN113076220A (en) * 2020-01-06 2021-07-06 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer readable medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076220A (en) * 2020-01-06 2021-07-06 阿里巴巴集团控股有限公司 Data processing method and device, electronic equipment and computer readable medium
CN111787349A (en) * 2020-05-19 2020-10-16 视联动力信息技术股份有限公司 Data caching method, device, equipment and medium
CN112532732A (en) * 2020-12-03 2021-03-19 郑州阿帕斯数云信息科技有限公司 HTTPS-based session processing method and device
CN113010115A (en) * 2021-03-18 2021-06-22 腾讯科技(深圳)有限公司 Data processing method in block chain node and related equipment

Also Published As

Publication number Publication date
CN114513558A (en) 2022-05-17

Similar Documents

Publication Publication Date Title
CN111414389B (en) Data processing method and device, electronic equipment and storage medium
CN110262807B (en) Cluster creation progress log acquisition system, method and device
CN109508326B (en) Method, device and system for processing data
CN107688626B (en) Slow query log processing method and device and electronic equipment
CN102780603B (en) Web traffic control method and device
CN110019367B (en) Method and device for counting data characteristics
CN113094434A (en) Database synchronization method, system, device, electronic equipment and medium
CN111125106B (en) Batch running task execution method, device, server and storage medium
CN112860706A (en) Service processing method, device, equipment and storage medium
CN112052120B (en) Database deleted data recovery method and device
CN110955640A (en) Cross-system data file processing method, device, server and storage medium
CN114035748A (en) Data file access method and system
CN112613964A (en) Account checking method, account checking device, account checking equipment and storage medium
CN115114232A (en) Method, device and medium for enumerating historical version objects
CN113256355B (en) Method, device, medium, equipment and system for determining integral rights and interests in real time
CN114513558B (en) User request processing method and device
CN112884181A (en) Quota information processing method and device
CN111209311B (en) Method and device for processing data
CN109634868B (en) Processing method and device for automatic test result of financial data analysis system
CN114065727A (en) Information duplication eliminating method, apparatus and computer readable medium
CN113641633A (en) File processing method, file processing device, electronic equipment, medium and computer program
CN112767042B (en) Group generation method and device, electronic equipment and storage medium
CN116151981A (en) Transaction processing request processing method and device
CN118520001A (en) Method, system, terminal and storage medium for verifying idempotency of method operation
CN114430395A (en) Flow control method, device and equipment and intelligent traffic management equipment

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