CN112084217A - Data processing method and related device - Google Patents

Data processing method and related device Download PDF

Info

Publication number
CN112084217A
CN112084217A CN202010981825.1A CN202010981825A CN112084217A CN 112084217 A CN112084217 A CN 112084217A CN 202010981825 A CN202010981825 A CN 202010981825A CN 112084217 A CN112084217 A CN 112084217A
Authority
CN
China
Prior art keywords
target
user
acquisition request
object acquisition
target object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010981825.1A
Other languages
Chinese (zh)
Inventor
汤文亮
何平
范维维
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010981825.1A priority Critical patent/CN112084217A/en
Publication of CN112084217A publication Critical patent/CN112084217A/en
Pending legal-status Critical Current

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/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data processing method and a related device, aiming at a scene of high-concurrency target object acquisition, if an object acquisition request aiming at the target object is acquired, the object acquisition request is written into a message queue in a cache space. When the object acquisition request can be processed, the object acquisition request is taken out from the message queue, so that the asynchronous processing of the object acquisition request is realized. Therefore, the effect of peak clipping and valley filling is realized, and the impact on the database is reduced. Besides the high concurrency of the object acquisition requests in the peak period, a large number of content query requests can also appear in a correlated manner, and the processing result aiming at the object acquisition requests is cached in the cache space, so that the content-based query result can be directly searched in the cache space. And the extra data interaction with the database for storing the processing result is not needed any more, so that the access amount to the database is reduced, the database is effectively protected in a peak period, and the query response efficiency is improved.

Description

Data processing method and related device
Technical Field
The present application relates to the field of data processing, and in particular, to a data processing method and a related apparatus.
Background
With the development of internet technology, a user can conveniently and rapidly obtain a required object through an internet platform, wherein the object can be a product, a virtual article, a service and the like.
In some scenarios, there may be a large number of users that have strong acquisition requirements for certain objects, such as when there are specific public environmental issues, and when certain objects are very popular. In such a case, the internet platform providing such objects may obtain a large amount of user requests for such objects in a short time, and such a high concurrency condition is very likely to cause a server of the internet platform to be down.
Therefore, how to deal with the high concurrency situation is an urgent problem to be solved by the internet platform.
Disclosure of Invention
In order to solve the technical problem, the application provides a data processing method and a related device, which are used for dealing with the high concurrency condition of an internet platform.
The embodiment of the application discloses the following technical scheme:
in one aspect, an embodiment of the present application provides a data processing method, where the method includes:
acquiring an object acquisition request aiming at a target object;
writing the object acquisition request into a message queue in a cache space;
taking out the object acquisition request from the message queue to perform corresponding processing, and caching an obtained processing result in the cache space;
and inquiring a target processing result in the cache space according to the content inquiry request aiming at the target object.
On the other hand, an embodiment of the present application provides a data processing apparatus, where the apparatus includes an obtaining unit, a writing unit, a first processing unit, and a second processing unit:
the acquisition unit is used for acquiring an object acquisition request aiming at a target object;
the writing unit is used for writing the object acquisition request into a message queue in a cache space;
the first processing unit is configured to take out the object acquisition request from the message queue to perform corresponding processing, and cache an obtained processing result in the cache space;
and the second processing unit is used for inquiring a target processing result in the cache space according to the content inquiry request aiming at the target object.
In another aspect, an embodiment of the present application provides an apparatus for data processing, where the apparatus includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the method of the above aspect according to instructions in the program code.
In another aspect, the present application provides a computer-readable storage medium for storing a computer program for executing the method of the above aspect.
In another aspect, embodiments of the present application provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method of the above aspect.
According to the technical scheme, for the scene of high-concurrency target object acquisition, if the object acquisition request for the target object is acquired, whether the target object is provided or not is not synchronously processed, and the object acquisition request is written into the message queue in the cache space. When the object acquisition request can be processed, the object acquisition request is taken out from the message queue, so that the asynchronous processing of the object acquisition request is realized. Therefore, the asynchronous processing mechanism can realize the peak clipping effect even in the peak period of receiving the object acquisition request, reduce the impact on the database, and can continue to process the object acquisition request remained in the message queue even if the object acquisition request received after the peak period is suddenly reduced, thereby realizing the valley filling effect. Besides the high concurrency of the object acquisition requests in the peak period, a large number of content query requests can also appear in a correlated manner, and the processing result aiming at the object acquisition requests is cached in the cache space, so that the content-based query result can be directly searched in the cache space. And the extra data interaction with the database for storing the processing result is not needed any more, so that the access amount to the database is reduced, the database is effectively protected in a peak period, and the query response efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic view of a data processing method according to an embodiment of the present application;
fig. 2 is a flowchart of a data processing method according to an embodiment of the present application;
FIG. 3 is a diagram of a server hierarchy provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a first mode provided by the embodiments of the present application;
FIG. 5 is a flowchart of a method in a first mode according to an embodiment of the present application;
FIG. 6 is a flowchart of a method in a first mode according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a number shaking method provided in real time of the present application;
FIG. 8 is a schematic diagram of a number shaking method provided in real time in the present application;
FIG. 9 is a schematic diagram of a number shaking method provided in real time of the present application;
fig. 10 is a schematic diagram of a switching mode according to an embodiment of the present application;
fig. 11 is a flowchart illustrating a process of purchasing a mask through a small program according to an embodiment of the present disclosure;
fig. 12 is a schematic diagram of an applet page provided in an embodiment of the application;
fig. 13 is a schematic diagram of an applet page provided in an embodiment of the application;
fig. 14 is a flowchart of a data processing method according to an embodiment of the present application;
FIG. 15 is a schematic diagram of an applet page provided in an embodiment of the application;
FIG. 16 is a schematic diagram of an applet page provided in an embodiment of the application;
fig. 17 is a schematic diagram of an applet page provided in an embodiment of the application;
FIG. 18 is a schematic diagram of an applet page provided in an embodiment of the application;
FIG. 19 is a schematic diagram of an applet page provided in an embodiment of the application;
FIG. 20 is a schematic diagram of an applet page provided in an embodiment of the application;
fig. 21 is a schematic diagram of an applet page provided in an embodiment of the application;
FIG. 22 is a schematic diagram of an applet page provided in an embodiment of the application;
fig. 23 is a schematic flow chart of a first-aid purchase mode according to an embodiment of the present application;
FIG. 24 is a schematic flow chart of a number shaking mode provided in an embodiment of the present application;
fig. 25 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 26 is a schematic structural diagram of a server according to an embodiment of the present application;
fig. 27 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings.
The development of internet technology provides convenience for people's life, and users can obtain self-required objects, such as clothes, game equipment, article touch-up services and the like, through an internet platform. However, under some high concurrency scenes such as a mask for emergency purchase, a second-killing popular goods, and a ticket for emergency purchase during an epidemic situation, the corresponding internet platform not only has a large number of object acquisition requests of the user for the target object in a short time, but also enables the user to access the corresponding internet platform for multiple times in a short time to acquire a content query result associated with the target object, so that the high concurrency reasons are diversified.
In order to solve the above technical problem, the present application provides a data processing method, which not only can asynchronously process a large number of user acquisition requests for a target object based on a message queue, but also can cache corresponding processing results in a cache space, so that a user can directly acquire corresponding processing results from the cache space, and reduce the number of times of accessing a database, thereby dealing with a target object acquisition scenario with diversified high concurrency reasons.
The data processing method provided by the embodiment of the application can be applied to processing equipment with data processing capacity, for example, terminal equipment or a server with a data processing function. The method can be independently executed through the terminal equipment or the server, can also be applied to a network scene of communication between the terminal equipment and the server, and is executed through the cooperation of the terminal equipment and the server. The terminal device may be a smart phone, a notebook computer, a desktop computer, a Personal Digital Assistant (PDA for short), a tablet computer, or the like. The server may be understood as an application server, or may also be a Web server, and in actual deployment, the server may be an independent physical server, or a server cluster or distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
In addition, the technical scheme provided by the application also relates to the technical field of cloud, such as the fields of cloud computing, databases and the like.
Cloud computing (cloud computing) refers to a delivery and use mode of an IT infrastructure, and refers to obtaining required resources in an on-demand and easily-extensible manner through a network; the generalized cloud computing refers to a delivery and use mode of a service, and refers to obtaining a required service in an on-demand and easily-extensible manner through a network. Such services may be IT and software, internet related, or other services. Cloud Computing is a product of development and fusion of traditional computers and Network Technologies, such as Grid Computing (Grid Computing), distributed Computing (distributed Computing), Parallel Computing (Parallel Computing), Utility Computing (Utility Computing), Network Storage (Network Storage Technologies), Virtualization (Virtualization), Load balancing (Load Balance), and the like.
With the development of diversification of internet, real-time data stream and connecting equipment and the promotion of demands of search service, social network, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Different from the prior parallel distributed computing, the generation of cloud computing can promote the revolutionary change of the whole internet mode and the enterprise management mode in concept.
Database (Database), which can be regarded as an electronic file cabinet in short, a place for storing electronic files, a user can add, query, update, delete, etc. to data in files. A "database" is a collection of data that is stored together in a manner that can be shared by multiple users, has as little redundancy as possible, and is independent of the application.
A Database Management System (DBMS) is a computer software System designed for managing a Database, and generally has basic functions of storage, interception, security assurance, backup, and the like. The database management system may classify the database according to the database model it supports, such as relational, XML (Extensible Markup Language); or classified according to the type of computer supported, e.g., server cluster, mobile phone; or sorted according to the Query Language used, such as SQL (Structured Query Language), XQuery, or sorted according to performance impulse emphasis, such as max size, maximum operating speed, or other sorting.
In the embodiment of the application, the object acquisition request, the content query request and the like are acquired and processed through the cloud computing technology, and the corresponding processing result is stored through the database.
In order to facilitate understanding of the technical solution of the present application, a data processing method provided in the embodiments of the present application will be described below with reference to an actual application scenario.
Referring to fig. 1, fig. 1 is a schematic view of a scene of a data processing method according to an embodiment of the present application. The practical application scene can be a scene that a large number of users rush to buy the mask through the electronic equipment. The electronic device can be a smart phone, a tablet computer, a notebook computer, a desktop computer and the like. In this scenario, the aforementioned processing device is a server 110, and the server 110 may be a Content Delivery Network (CDN) server.
The server 110 includes at least a front-end service process 111, a buffer space 112 configured with a message queue, a back-end service process 113, and a database 114. The front-end service process 111 is configured to interact with the electronic device, the back-end service process 113 is configured to interact with the database 114, and the cache space 112 is configured to connect the front-end service process 111 and the back-end service process 113. By way of example, in the embodiment of the application, a scene of a robbery mask is described by representing a large number of users by two users. Wherein, user A buys the mask through smart phone 121, and user B buys the mask through smart phone 122.
When the front-end service process 111 of the server 110 sends the object acquisition requests for the mask to the smart phone 121 and the smart phone 122, the object acquisition requests are not immediately processed, but the object acquisition request I of the user a and the object acquisition request II of the user B are written into the message queue in the buffer space 112. The back-end service process 113 may respectively extract the object acquisition request I and the object acquisition request II from the message queue according to a certain mechanism, such as a first-in first-out mechanism, and respectively process the object acquisition request I and the object acquisition request II correspondingly, so that the back-end service process 113 may process object acquisition requests sent by different users through the electronic device in batches within a capacity range, that is, asynchronously process a large number of object acquisition requests.
Therefore, the peak clipping effect can be realized through an asynchronous processing mechanism in the peak period of the object acquisition request, the unprocessed object acquisition request in the peak period is continuously processed in the valley period of the subsequent object acquisition request, and the valley filling effect is realized, so that the processing pressure of the server 110 can be reduced, and the response speed of the server 110 is improved. Meanwhile, the front-end service process 111 and the back-end service process 113 can be decoupled through the cache space 112, so that the front-end service process 111 and the back-end service process 113 can be maintained independently.
The user not only sends an object acquisition request for the mask to the server 110 through the electronic device, but also sends a content inquiry request for the mask to the server 110 through the electronic device, for example, inquiring whether the mask is successfully purchased or not. The same user may access the server 110 through the electronic device for multiple times in a short time, and when the number of users increases dramatically, that is, a large number of electronic devices access the server 110 multiple times in a short time, the number of accesses of the server 110 increases in a geometric progression in a short time, which causes the server 110 to be down. That is, the reason for the high concurrency is related not only to the drastic increase in the number of users but also to the multiple accesses of the internet platform by the users in a short time.
Based on this, the backend service process 113 stores the obtained processing result I and the processing result II in the database 114, but stores the processing result I and the processing result II in the database 114 and also caches the processing result I and the processing result II in the cache space 112, so that the user B can directly obtain the processing result II in the cache space 112 after sending the content query request for the mask through the smartphone 122, and can also return the content query response corresponding to the smartphone 122. Therefore, additional data interaction with the database 114 is not required, the access times to the database 114 are reduced, the database 114 is effectively protected during the peak period of the object acquisition request, the query response efficiency is improved, and the load of the server 110 is reduced.
The data processing method provided by the embodiment of the present application is described below with reference to the application scenario shown in fig. 1. Referring to fig. 2, the figure is a flowchart of a data processing method according to an embodiment of the present application. In the method shown in fig. 2, the following steps are included:
s201: an object acquisition request for a target object is acquired.
The mass users generate strong acquisition demands for some objects, which can lead to the situation of short supply and short demand. When the objects are supplied to the user through the internet platform, the user continuously sends an object acquisition request for the target object to the server of the internet platform through the electronic equipment in a short time when the corresponding internet platform starts to supply the objects, so that the load of the server is increased, and even the server is down.
In order to deal with the highly concurrent scenario, that is, to deal with a scenario in which an object acquisition request for a target object acquired in a short time is increased sharply, reference is made to fig. 3, which is a server hierarchical architecture diagram provided in an embodiment of the present application. The server is designed to at least include a front-end service process (front servers) 111, a cache space 112, a back-end service process (zoorder servers) 113, and a database 114. The front-end service process 111 is configured to interact with a client, and the client sends an object acquisition request for a target object to the front-end service process 111 through a Gateway (Gateway)301, for example, a Rio Gateway. Backend service processes 113 are used to interact with database 114. The cache space 112 is used to connect the front-end service process 111 and the back-end service process 113, and may adopt technologies such as Remote Dictionary service (Redis), card (Kafka), and the like. For example, the front-end service process 111 writes an operation for modifying a class, such as an object get request, into kafka, and an operation for querying a class is fetched from Redis. The back-end service process 112 takes out the object acquisition request from the kafka, interacts with Redis, and can decouple the front-end service process and the back-end service process through the cache space, so that the front-end service process and the back-end service process can be maintained independently. The database 114 is used for storing the processing result of the backend service process, and may adopt a MySQL database.
The front-end service process receives an object acquisition request aiming at a target object from a client. For example, an interface is provided for services such as registration and query results submitted by a client, and a front-end service process does not directly interact with a database, so that the database query under the condition of ultrahigh concurrency can be avoided, and the load of a server is reduced.
S202: and writing the object acquisition request into a message queue in a buffer space.
In the related art, after an object acquisition request for a target object is acquired, the object acquisition request is immediately processed, so that the speed of acquiring a subsequent object acquisition request is slower and slower, and even a server is down.
In order to ensure the response speed of acquiring the object acquisition request, in the application, the front-end service process does not immediately process the acquired object acquisition request, but writes the object acquisition request into the message queue, the message queue is in the cache space, and can temporarily store the object acquisition request from the front-end service process in the form of the message queue, so that the back-end service process can conveniently take the object acquisition request out of the message queue, thereby realizing asynchronous processing of the object acquisition request, and ensuring that the server can respond to a large number of object acquisition requests without downtime.
The message queue can be constructed in a form of middleware in a buffer space, and can also be constructed by adopting other algorithm technologies for realizing first-in first-out.
The number of front-end service processes is not specifically limited in this application. For example, in fig. 3, the front-end service process 111 uses 16 Virtual Machines (VMs). In order to ensure the response speed of the object acquisition request, the horizontal capacity expansion can be realized by not only increasing the number of VMs, but also dispersing data to different fragments (partitions) by using a fragmentation technique (such as Kafka's Partition, Redis's cluster), so as to configure different numbers of server resources according to the concurrency amount.
S203: and taking out the object acquisition request from the message queue to perform corresponding processing, and caching the obtained processing result in the cache space.
No matter the front-end service process is in the peak period or the low-valley period of acquiring the object acquisition request, the back-end service process can take out the object acquisition request from the message queue according to the processing capacity of the back-end service process to process, and therefore asynchronous processing is achieved. Therefore, the asynchronous processing mechanism can realize the peak clipping effect even in the peak period of the object acquisition request, and the object acquisition request acquired after the peak period is reduced rapidly, so that the object acquisition request remained in the message queue can be continuously processed, the valley filling function is realized, and the response speed of the server is further ensured.
The back-end service process can take out the object acquisition request from the message queue in a mode of subscribing the message queue to perform corresponding processing, and cache the obtained processing result in the cache space so as to facilitate the front-end service process to directly search in the cache space. Therefore, concurrent query operation of the database is reduced, and query speed in a high concurrent state is guaranteed. The back-end service process can also configure the required amount of server resources according to the processing time limit requirement of the object acquisition request and the pressure of the database. For example, in FIG. 3, the backend service process 113 uses 4 VMs.
And the back-end service process not only caches the obtained processing result in the cache space, but also stores the obtained processing result in a corresponding database. For example, after the back-end service process takes out the object acquisition request for the mask from the message queue, the back-end service process performs corresponding processing and then stores the processing result of each list, such as mask acquisition success or mask acquisition failure, in the database and caches the processing result in the cache space. When a user wants to inquire whether the own order is successful, the client sends an inquiry request of the mask order to the front-end service process, and the front-end service process can directly find the corresponding processing result in the cache space and return the processing result to the corresponding client. In order to improve the speed of writing the processing result into the database, the obtained processing results can be sequentially updated into the database corresponding to the target object according to the processing sequence, and due to the adoption of the mode of sequentially inserting the processing results, the database does not need to modify and delete the processing results while storing the processing results, so that the speed of writing the processing results into the database can be maximally ensured.
S204: and inquiring a target processing result in the cache space according to the content inquiry request aiming at the target object.
In a peak period of acquiring the object acquisition request, not only a large number of object acquisition requests for the target object are acquired, but also a large number of content query requests for the target object are associated in a short time, for example, whether the object acquisition requests are successful or not, a current processing state, and the like are queried, so that the reasons for high concurrence are diversified.
In order to deal with diversification of high concurrency reasons, after the back-end service process takes out the object acquisition request from the message queue and carries out corresponding processing, the obtained processing result is cached in the cache space, so that the front-end service process can directly inquire the corresponding target processing result in the cache space. Therefore, the object acquisition request needing to be processed is written into the message queue, the content query request associated with the object acquisition request is taken out from the cache, extra data interaction with the database storing the processing result is not needed, the bottleneck of the database under the condition of ultrahigh concurrency can be avoided, the concurrent query operation of the database is reduced, and the query speed under the high concurrency state is ensured.
After the content query request aiming at the target object is obtained, the corresponding target processing result can be queried in the cache space according to the content query request, and the corresponding content query response can be returned based on the target processing result, so that the content query requester can obtain the corresponding content query response result, the content query request is not sent for many times, and the pressure of the server is reduced.
According to the technical scheme, for the scene of high-concurrency target object acquisition, if the object acquisition request for the target object is acquired, whether the target object is provided or not is not synchronously processed, and the object acquisition request is written into the message queue in the cache space. When the object acquisition request can be processed, the object acquisition request is taken out from the message queue, so that the asynchronous processing of the object acquisition request is realized. Therefore, the asynchronous processing mechanism can realize the peak clipping effect even in the peak period of receiving the object acquisition request, reduce the impact on the database, and can continue to process the object acquisition request remained in the message queue even if the object acquisition request received after the peak period is suddenly reduced, thereby realizing the valley filling effect. In addition to the situation that the object acquisition request is highly concurrent in the peak period, a large number of content query requests are associated, and the processing result aiming at the object acquisition request is cached in the cache space, so that the content query result can be directly searched and returned in the cache space. And the extra data interaction with the database for storing the processing result is not needed any more, so that the access amount to the database is reduced, the database is effectively protected in a peak period, and the query response efficiency is improved.
Since the user generally adopts a mode of reducing the stock according to the sequence when obtaining the target object, a large number of users can continuously send object obtaining requests or content query requests to the server of the internet platform in a short time when the target object starts to be supplied on the internet platform, and the processing pressure of the server is increased. In order to reduce the burden of the server, the application also provides a first mode, so that the user can not obtain the target object at hand-spelling speed any more, but can obtain the target object by number-shaking in a mode of being supervised by a television station or a notarization department after reservation, so that the signed user (namely, the user selected by number-shaking) sends an object acquisition request to the server, the number of the object acquisition requests or content query requests sent by the user to the server is reduced, and the pressure of the server is reduced. The first mode will be described below with reference to fig. 4.
Referring to fig. 4, a schematic diagram of a first mode provided in the embodiment of the present application is shown.
The first mode is a subscription mode, where the user needs to register his identity before shaking the number, e.g. by filling in a registration form through the client in fig. 4. It should be noted that other ways may be used to perform the identity registration. The registration list is sent to the front-end service process in the form of an object acquisition request, and after the front-end service process acquires the filled registration list, the registration list is put into a message queue so that the back-end service process can process the registration list. In order to quickly screen out the medium sign-on users among a large number of users, the application provides a first mode for quickly screening the medium sign-on users by adopting a twice number shaking mode. The first shake is described below with reference to fig. 5, and the second shake is described below with reference to fig. 6.
Referring to fig. 5, a flowchart of a method in a first mode is provided according to an embodiment of the present application.
S501: and allocating a first shaking number value to the user identifier carried by the object acquisition request.
When the back-end service process obtains the object obtaining request from the message queue, the first number shaking is carried out on the user identification carried by the object obtaining request, and a first number shaking value is distributed. The object acquisition request carries the user identification of the corresponding user, so that the user of the registration list is determined through the user identification.
The present application does not specifically limit the interval of the first rocker number value. For example, the first rocker value may range from 0 to 1023, with each user identification being randomly assigned any integer from 0 to 1023.
If the number of the object obtaining requests is large, the object obtaining requests can be written into a message queue in the cache space through the front-end service process, so that the back-end service process can take the object obtaining requests out of the message queue during number shaking conveniently, and first number shaking data is distributed to user identifications carried by the object obtaining requests.
S502: and dividing the object acquisition request into a plurality of user sets based on the first shaking number value.
And dividing the object acquisition requests with the same first shaking number value into the same user set based on the first shaking number value of each user identifier in the object acquisition requests. The total number of the determined user sets may be equal to the integer value number of the interval in which the first rocker number value is located. Taking the interval of the first shaking number value as 0-1023 as an example, the object acquisition request can be divided into 1024 user sets.
S503: and when the actual acquisition user of the target object is determined, selecting a first target user set corresponding to the target value from the plurality of user sets according to the target value determined from the first shaking number values.
When the actual acquisition user of the target object is determined, the number shaking (second number shaking) is not selected from all users, but one number shaking value is determined from a plurality of first number shaking values to serve as a target value, and then the number shaking is selected from a user set corresponding to the target value, namely the first target user set, so that the number of users for number shaking is reduced, and the number shaking efficiency is improved. For example, ten million users make a reservation for registration, the numerical interval length of the first number shaking is 100, the object acquisition requests of the ten million users are averagely divided into 100 user sets, and when the target numerical value is determined to be 1, the number shaking is performed by using the first user set instead of all users, so that the number of the number shaking users is reduced from ten million to one hundred thousand, and the number shaking efficiency is improved.
The target object may be a collection of objects of a type or a collection of models of the type. For example, the target object may be a mask, and may be an N95 model mask among masks.
The first set of target users may be determined not only according to the target value, but also according to conditions such as the store identification, the model of the target object, and whether the user is subject to allocation.
S504: and determining the assignable numerical value of the target object in the shop corresponding to the shop identification according to the shop identification providing the target object.
When the internet platform works out the distribution of all target objects uniformly, for example, during an epidemic situation, the internet platform collects the masks of a plurality of shops together and distributes uniformly. And then, the numbers are shaken one by one according to the sequence of the shops, and the assignable number of the target objects in the shop is determined according to the shop identifications of the target objects, so that the number of the target objects supplied to the user can be ensured not to exceed the actual stock quantity of the shop.
S505: and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set according to the assignable numerical value.
And according to the assignable numerical value, determining an actual acquisition user from the first target user set selected randomly before, wherein the actual acquisition user can acquire the target object in the shop. For example, if the number of target objects in the store is 100, it is specified that each user can acquire 1 target object, and thus the assignable value can be set to 100, that is, 100 actual acquiring users are determined in the first target set. If the number of the target objects in the store is 100, it is specified that each user can acquire 5 target objects, so that the assignable value can be set to 20, that is, 20 actual acquiring users are determined in the first target set.
The method for actually acquiring the target object by the user is not particularly limited. For example, the target object may be ordered online via an internet platform, and the target object may be obtained in an offline physical store after the ordering is successful. For another example, the target object can be predetermined online through an internet platform and obtained through network mailing.
A method for selecting an actual acquisition user in the first target set by using a number shaking manner is described below with reference to fig. 6, that is, the method shown in fig. 6 is one manner in S505.
In order to further improve the number shaking efficiency, with reference to fig. 4, the actual obtaining users are determined by the number shaking method from the inventory table according to the allocable numbers of all the target objects in one store, and then the actual obtaining users are determined according to the allocable numbers of all the target objects in the next store until the allocable numbers of all the target objects are completely distributed.
Even after the actual obtaining users are determined one by one according to the distributable number of the first model target objects in one shop, the actual obtaining users are determined one by one according to the distributable number of the next model target objects until the distributable number of all the model target objects in the shop is completely distributed. The number shaking is performed one by one according to each model of the target object and/or the sequence of each shop, and the number shaking efficiency is improved without repeating the number shaking.
Referring to fig. 6, a flowchart of a method in a first mode is provided according to an embodiment of the present application.
S601: and if the total number of the target objects requested by the object acquisition request in the first target user set is larger than the distributable numerical value, determining the actual acquisition user from the first target user set by re-shaking the user identification in the first target user set.
And if the total number of the target objects requested by the object acquisition request in the first target user set is greater than the distributable numerical value, which indicates that the target objects can be completely distributed by the users in the first target user set, performing number shaking again, namely, performing number shaking again on the user identifications in the first target user set, and determining the actual acquisition users from the first target user set through the number shaking for the second time. With continued reference to FIG. 4, the second run number value may be recorded in the Roll Point record Table. For example, according to the numerical value of the second shaking number, the users in the first target user set are put into the number group to be shaken in sequence, and then are matched one by one from front to back according to the sequence of the number group until the distributable numerical value is distributed completely.
S602: and if the total number of the target objects requested by the object acquisition request in the first target user set is smaller than the distributable numerical value, acquiring a second target user set from the plurality of user sets by adjusting the target numerical value.
If the total number of the target objects requested by the object acquisition request in the first target user set is smaller than the allocable value, which indicates that the target objects cannot be completely allocated by the users in the first target user set, the number of the users needs to be increased so that all the target objects can be completely allocated. Therefore, the target object does not need to be subjected to shaking number distribution for many times, and the shaking number efficiency is improved.
As a way of expanding the number of object acquisition requests in the user set, a target value may be adjusted, and a second target user set may be acquired from the plurality of user sets according to the adjusted target value. The second target user set may be a plurality of user sets, so as to ensure that the total number of object obtaining requests in the first target number set and the second target user set is greater than the allocable value, and thus all target objects can be allocated completely.
As another way to expand the number of object acquisition requests in the user set, after randomly allocating any integer from 0 to 1023 to each user identifier, the integer is stored in a form of quaternary system into a character string with a fixed length of 5, such as 20121, 00230, etc. When the number of object acquisition requests in the user set is enlarged, the left side of the character string is shifted by one bit for matching, such as: it is 31231 to left shift one bit is 3123% of the ambiguous query and 312% of the left shift two bits. Until the number is larger than or equal to the assignable value, all the target objects can be assigned.
S603: and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set and the second target user set according to the assignable numerical value.
With continued reference to fig. 4, the actually obtained user may be written into the shaking number result table and stored in the cache space, so that the front-end service process may query the result.
Sign user in can screening fast in a large amount of users through the mode of shaking the number twice to improve the efficiency of shaking the number. Referring to fig. 7-9, a schematic diagram of a number shaking manner provided in the present application is shown. Fig. 7 is a schematic diagram of preparing a starting shaking number, fig. 8 is a schematic diagram of a shaking number being performed, fig. 9 is a schematic diagram of a shaking number completion, and a download of a mid-signed list can also be provided.
In order to deal with high concurrency scenes, the application provides two modes of acquiring the target object, namely a first mode and a second mode, wherein the first mode and the second mode adopt different object acquisition modes, for example, the first mode acquires an object acquisition request by a mode of randomly extracting random numbers (such as a shaking number mode), and the second mode acquires the object acquisition request by a mode of synchronously purchasing at the same time (such as a robbery mode) so as to reduce the pressure of a server. Referring to fig. 10, the diagram is a schematic diagram of a switching mode according to an embodiment of the present application. In order to meet different requirements by switching the two modes, the two modes are written into a configuration file capable of identifying rule parameters of the target object, and by acquiring the configuration file for the target object, if a mode switching request is acquired, the mode of acquiring the target object can be switched to be the first mode or the second mode according to the configuration file.
If the target object is short of supply and demand, if the rule parameters of the target object are obtained by updating the version of the client, the updating speed is slow, so that the user is influenced to obtain the target object in time. Because the client needs to go through the auditing process, the auditing process takes a lot of time, and a user does not necessarily use the latest version of the client immediately after the client is updated. Therefore, some rule parameters that may change, such as the target object's file, control switch, time variable, winning probability, etc., are written into the configuration file and distributed to the server. When a rule parameter updating request from a client is obtained, the version of the client is not required to be changed, and the configuration file is updated according to the rule parameter updating request indication, so that the online of related functions influenced by the updating of the client version is reduced, and the updating speed is increased.
If the user views the related information of the target object through the client, the server can continuously obtain the content query request from the client for the target object, so that the load of the server is increased. In order to reduce the number of interactions between the client and the server, the configuration file may be sent to the client after the file acquisition request sent by the client is acquired, so that the configuration file can be cached in the local first predetermined time of the client. Therefore, when the user checks the relevant information for the target object again within the first preset time, the client does not send a content query request for the target object to the server, but reads the configuration file cached in the local to display the relevant information for the target object, so that the interaction times between the client and the server are reduced, and the load of the server is reduced.
In order to reduce the burden of the server aggravated by continuously refreshing the query result through the client after the user acquires the corresponding content query response, the content query response can be cached in the local second preset time of the client, so that the server is not required to acquire the query response request any more but the target processing result is acquired in the local cache of the client and displayed to the user within the second preset time after the client acquires the content query response request for the first time, thereby reducing the interaction times between the client and the server and reducing the burden of the server.
In order to further reduce the burden of the server, the client is optimized, so that the client can control the batch random sending of the object acquisition requests aiming at the target objects to the server, and the pressure of the server is reduced. The following description will be made in detail with reference to fig. 11 by taking an example of purchasing a mask through a small program.
Referring to fig. 11, it is a flowchart of a process for purchasing a mask through a small program according to an embodiment of the present disclosure.
The applet will go through three pages, a home page, a description page and a registry page, before sending an object acquisition request for the target object.
In the home page, when a user starts to purchase the mask, the configuration file for the mask is acquired through the applet and is cached in the local part of the applet, so that the interaction times of the applet and the server are reduced, and the pressure of the server is relieved. As shown in fig. 12, on the top page, after the configuration file for the mask is acquired, the rule parameters such as the pharmacy, the model number, and the purchase quantity of the mask can be selected. Meanwhile, the stock verification is not performed any more when the regular parameters such as a pharmacy, a mask model and the purchase quantity are selected, so that the pressure of the server is reduced.
And filling in the personal health declaration as a precondition for pre-robbing the mask on the description page, so that more users can report health data in time, a supervision mechanism is helped to monitor the epidemic situation, specifically, whether the users carry out self-check reporting during the epidemic situation is set, and if the users do not carry out self-check reporting, the users are guided to carry out self-check reporting. The part of users is shunted, so that the number of users who deal with the mask is reduced, and the pressure of the server is further reduced. If the user reports the self-check, the user is guided to judge whether the user meets the purchasing ability, if the user does not meet the condition, the user pops the box to prompt the reason, and if the user meets the condition, the user jumps to a registration form page.
In the registration form page, the information rapid filling (autofil) capability of the applet can be used for storing the information filled by the user last time, so that the user can select the information such as the identity card and the name filled by the user last time, the effect of rapid filling is achieved, and the user experience is improved. And when the user finishes inputting all information and submits the information, realizing the lossy service by a strategy of batch random release. Specifically, in the configuration file, the success probability of submitting the user information is set. For example, the success probability is set to be 0-100%, so that the user can submit the form data to the server according to a certain probability. If the submission does not have a success probability, the applet will prompt the user to try again after a period of time. For example, when the success probability is set to 40%, 100 users send object acquisition requests for the target object through the applet, only 40 users can successfully send the object acquisition requests, and the applet prompts the remaining 60 users to try again after a certain period of time. As shown in fig. 13. Therefore, the applet does not send the object acquisition request aiming at the mask to the server, and the number of times of interaction between the client and the server is reduced under the condition of a large number of users, so that the load of the server is reduced. If the server pressure in the current time period is reduced, the success probability can be adjusted to 100%, so that the client can send all the object acquisition requests for the target object to the server.
Next, a data processing method provided in the embodiment of the present application will be described with reference to a specific scene, where a user buys a mask in a rush mode through a small program. The first mode is a number shaking mode, and the second mode is a number robbing mode.
See table below, provide the user with the functionality of the applet to facilitate the user to shop for a mask.
Figure BDA0002687790140000161
Figure BDA0002687790140000171
Figure BDA0002687790140000181
Figure BDA0002687790140000191
The following describes a flow of obtaining a mask through a small program by a user with reference to the drawings.
Referring to fig. 14, a flowchart of data processing provided in an embodiment of the present application is shown.
S1401: entering a small procedure of a first-aid-purchase mask.
Referring to fig. 15, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. The applet can have options of my health code, health reporting self-check, epidemic situation clue reporting, mask appointment purchasing and the like.
S1402: and sending an object acquisition request aiming at the target object to a front-end service process.
Referring to fig. 16, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. And guiding the user to fill in related information such as the area, the type of the mask, the number of the masks, mailing information and the like, and clicking and submitting the information after the information is successfully filled.
Referring to fig. 17, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. After the user submits the relevant information, the user can select whether to send a mask appointment result notification or not, so that the user can know the robbery result in time.
S1403: the front end verifies the relevant information of the user.
S1404: if the verification fails or the storage message queue fails, the applet returns to display the reserved purchase result.
S1405: and if the verification is successful, sending an object acquisition request to a message queue in the buffer space.
S1406: and the back-end service process takes out the object to be processed from the message queue in the buffer space according to a first-in first-out mechanism to obtain a request.
S1407: and the back-end service process acquires the request corresponding to the processing object to obtain a corresponding processing result.
Referring to fig. 18, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. When the back-end service process asynchronously processes the object get request, the applet can display the interface in the queue.
Referring to fig. 19, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. If the number shaking mode is the number shaking mode, the number shaking result can be displayed to the user after the number shaking is finished, and information such as the user signed the number.
Referring to fig. 20, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. If the current robbery mode is the robbery mode, the user can display the robbery result after the end of the robbery, such as the information that the user has finished the robbery. The differences between the number shaking mode and the robbery mode will be described in detail later with reference to fig. 23 and 24, and will not be described again here.
Two ways of obtaining a mask by a user will be described below with reference to fig. 21 and 22.
Referring to fig. 21, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. After the user signs, the user can select a mailing mode to obtain the mask, and at the moment, the user needs to pay in a 'my reservation' interface and check information such as a mailing address.
Referring to fig. 22, the figure is a schematic diagram of an applet page provided in an embodiment of the present application. After the user signs, the user can select a mailing mode to obtain the mask, and at the moment, the user needs to obtain the appointment code after payment operation is performed in a 'my appointment' interface, so that the user can get out of a pharmacy on line through the appointment code to obtain the mask. The applet may also provide relevant information such as point-to-point navigation to facilitate access to the mask by the user.
S1408: and the back-end service process respectively stores the corresponding processing results in the cache space and the database.
Therefore, mask appointment and purchase functions are provided for a large number of users in an epidemic situation period through the small programs. On one hand, the on-line mask appointment and purchase service is opened to meet the requirement of the mask materials of the user, meanwhile, the service of mailing to home is added on the basis of supporting the user to purchase in a pharmacy, and epidemic risks brought by queuing to buy masks can be effectively avoided; on the other hand, the health state of the user is generally checked through the reservation, purchase and collection of the mask, and relevant services are arranged by a support supervision mechanism according to specific symptoms according to conditions, so that the health safety of the user is guaranteed. The difference between the two types of the mask for the emergency purchase through the small procedure will be described with reference to fig. 23 and 24.
Referring to fig. 23, the figure is a schematic flow chart of a first-aid purchase mode according to an embodiment of the present application.
On the applet side:
user registration: if the user registers for the first time, the mobile phone number of the user can be obtained by calling the WeChat; this step may be skipped if the user is not first registered.
And entering an applet: 1. first look at the description of the emergency purchase. 2. Before the point X of the emergency purchase time, the emergency purchase button is set to be gray, and the user cannot click the emergency purchase button. When the time is X, the user can click the shopping button. 3. And judging whether the user fills in the personal health declaration within Y days, and if not, guiding the user to submit the personal health declaration.
Acquiring a configuration file: 1. in the step, the inventory verification is not carried out, and the user can select the mask with any model. 2. The option "receive random assignment of other models if the selected model is in short stock" is provided.
Sending an object acquisition request: distributing random release: 1. let go at the ratio of XX%, XX can be dynamically configured. 2. If the current user is not released, prompting that the current user is frequently purchased and the user needs to try again later; and the button is set with grey within 5 seconds and cannot be clicked, and the button displays countdown, please try again after (5) seconds.
On the server side:
emergency purchase: 1: and the background returns whether the robbery is started or not, and if not, returns the information of not starting. 2. And returning whether the robbery is finished or not by the background. One of the following two conditions is satisfied: a. the robbery inventory is exhausted. b. The set finishing time of the emergency purchase is reached. 3. If the appointment is finished, directly displaying an appointment finishing page; if not, the method is submitted to the next step.
Finishing the first-aid purchase registration: informing that the registration of the robbery is finished, the system is queuing for processing, and the result of the robbery is published after half an hour, please check in the robbery of the personal center.
And (3) queuing treatment: and preferentially arranging the model selected by the user, and if the model selected by the user is insufficient and the user selects 'receiving distribution', sequentially distributing other models to the user according to the quantity of the stock.
And returning the result to the user: the user looks at "personal center-" my deal ".
Referring to fig. 24, the figure is a schematic flow chart of a number shaking mode provided in the embodiment of the present application.
On the applet side:
user registration: if the user registers for the first time, the mobile phone number of the user can be obtained by calling the WeChat; this step may be skipped if the user is not first registered.
And entering an applet: 1. the reservation purchase instruction is viewed. 2. The button is not grayed in the reserved time, and the button can be clicked in the reserved time.
Acquiring a configuration file: 1. in the step, the inventory verification is not carried out, and the user can select the mask with any model. 2. The option "receive random assignment of other models if the selected model is in short stock" is provided. 3. The choice of whether to reach payment or post (for the order) is increased. 4. If the user selects to post, the post address is added with the judgment of the local city, and the non-local city can not submit. Sending an object acquisition request: and (4) distribution and release: 1. let go at the ratio of XX%, XX can be dynamically configured. 2. The user must be allowed to receive notifications, otherwise they cannot submit them; if the user chooses that no notification reception confirmation box has occurred, the submission is passed.
On the server side:
emergency purchase: 1. and returning whether the reservation is started or not by the background, and if not, returning non-start information. 2. If the appointment is finished, directly displaying an appointment finishing page; if not, then the process is committed to the next step.
Finishing the first-aid purchase registration: and informing that the emergency purchase registration is finished, and repeatedly submitting reservation within X days. Every day XX: XX publishes the shaking number result, please see in "personal center-" my appointment ".
And (3) queuing treatment: 1. the number shaking is performed using the public number shaking algorithm. 2. Signed users must not repeat the shake number within X days (including over XX years). 3. Reserved and untagged are submitted within X days without repeated submission. 4. Users older than XX need to submit once and the record is effective all the time. 5. And providing the shaking number web for the notarization department to use.
And returning the result to the user: and the user is informed to push through subscription, and web background trigger needs to be provided. 2. And displaying the result in the personal center, adjusting the file and adding the appointment code.
The mailing selection is divided into mailing for the user and user to store pickup (to store pickup by my reservation information).
And providing a management background modification state which can be modified into a mailed or picked state.
The status is updated synchronously in my subscription.
Based on the data processing method provided by the foregoing embodiment, a related apparatus provided by the embodiment of the present application is introduced.
The present embodiment provides a data processing apparatus 2500, referring to fig. 25, the apparatus 2500 includes an acquisition unit 2501, a writing unit 2502, a first processing unit 2503, and a second processing unit 2504:
the acquiring unit 2501, configured to acquire an object acquisition request for a target object;
the writing unit 2502 is configured to write the object obtaining request into a message queue in a buffer space;
the first processing unit 2503 is configured to take out the object acquisition request from the message queue to perform corresponding processing, and cache an obtained processing result in the cache space;
the second processing unit 2504 is configured to query a target processing result in the cache space according to a content query request for the target object.
In a possible implementation manner, the writing unit 2502 is specifically configured to sequentially update the obtained processing results to the database corresponding to the target object according to the processing order.
In a possible implementation manner, if the object acquisition request is acquired through a first mode, the apparatus further includes a number shaking unit, specifically configured to allocate a first number shaking value to the user identifier carried by the object acquisition request; dividing the object acquisition request into a plurality of user sets based on the first rocker number value; when actual obtaining users of the target object are determined, according to the target value determined from the first shaking number values, selecting a first target user set corresponding to the target value from the plurality of user sets; determining an allocable numerical value of the target object in a shop corresponding to the shop identification according to the shop identification providing the target object; and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set according to the assignable numerical value.
In a possible implementation manner, the number shaking unit is further configured to determine the actual obtaining user from the first target user set by shaking the number again for the user identifier in the first target user set if the total value of the target objects requested by the object obtaining request in the first target user set is greater than the allocable value; if the total number of target objects requested by the object acquisition request in the first target user set is smaller than the distributable numerical value, acquiring a second target user set from the plurality of user sets by adjusting the target numerical value; and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set and the second target user set according to the assignable numerical value.
In a possible implementation manner, the apparatus further includes a configuration file unit, configured to obtain a configuration file for the target object, where the configuration file identifies rule parameters for obtaining the target object; and if a mode switching request is acquired, switching the mode of acquiring the target object according to the configuration file, wherein the mode comprises a first mode or a second mode.
In a possible implementation manner, the configuration file unit is further configured to obtain a rule parameter update request from a client; and updating the configuration file according to the indication of the rule parameter updating request.
In a possible implementation manner, the configuration file unit is further configured to obtain a file obtaining request sent by a client; and sending the configuration file to the client for indicating the client to cache the configuration file for a first preset time length locally.
In a possible implementation manner, the content query response is further configured to instruct the client that obtains the content query response to locally cache the target processing result for a second predetermined time.
In a possible implementation manner, the apparatus further includes a probability indicating unit, configured to send probability indicating information to the client before the object obtaining request for the target object is obtained, where the probability indicating information is used to indicate a success probability of submitting the object obtaining request by the client.
In the data processing apparatus provided in the foregoing embodiment, for a scene with a high concurrency of the target object, if the object obtaining request for the target object is obtained, processing of whether to provide the target object is not performed synchronously, but the object obtaining request is written into the message queue in the buffer space. When the object acquisition request can be processed, the object acquisition request is taken out from the message queue, so that the asynchronous processing of the object acquisition request is realized. Therefore, the asynchronous processing mechanism can realize the peak clipping effect even in the peak period of receiving the object acquisition request, reduce the impact on the database, and can continue to process the object acquisition request remained in the message queue even if the object acquisition request received after the peak period is suddenly reduced, thereby realizing the valley filling effect. In addition to the situation that the object acquisition request is highly concurrent in the peak period, a large number of content query requests are associated, and the processing result aiming at the object acquisition request is cached in the cache space, so that the content query result can be directly searched and returned in the cache space. And the extra data interaction with the database for storing the processing result is not needed any more, so that the access amount to the database is reduced, the database is effectively protected in a peak period, and the query response efficiency is improved.
The embodiment of the present application further provides an apparatus for data processing, and the apparatus for data processing provided in the embodiment of the present application will be described below from the perspective of hardware implementation.
Referring to fig. 26, fig. 26 is a schematic diagram of a server 1400 according to an embodiment of the present application, where the server 1400 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1422 (e.g., one or more processors) and a memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for storing applications 1442 or data 1444. Memory 1432 and storage media 1430, among other things, may be transient or persistent storage. The program stored on storage medium 1430 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a server. Still further, a central processor 1422 may be disposed in communication with storage medium 1430 for executing a series of instruction operations on storage medium 1430 on server 1400.
The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input-output interfaces 1458, and/or one or more operating systems 1441, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The steps performed by the server in the above embodiment may be based on the server structure shown in fig. 26.
The CPU 1422 is configured to perform the following steps:
acquiring an object acquisition request aiming at a target object;
writing the object acquisition request into a message queue in a cache space;
taking out the object acquisition request from the message queue to perform corresponding processing, and caching an obtained processing result in the cache space;
and inquiring a target processing result in the cache space according to the content inquiry request aiming at the target object.
Optionally, the CPU 1422 may further execute method steps of any specific implementation manner of the data processing method in the embodiment of the present application.
For the data processing method described above, the present application further provides a terminal device for data processing, so that the data processing method described above is implemented and applied in practice.
Referring to fig. 27, fig. 27 is a schematic structural diagram of a terminal device according to an embodiment of the present application. For convenience of explanation, only the parts related to the embodiments of the present application are shown, and details of the specific technology are not disclosed. The terminal device may be any terminal device including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA for short), and the like, taking the terminal device as the mobile phone as an example:
fig. 27 is a block diagram illustrating a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Referring to fig. 27, the cellular phone includes: a Radio Frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art will appreciate that the handset configuration shown in fig. 27 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 27:
the RF circuit 1510 may be configured to receive and transmit signals during information transmission and reception or during a call, and in particular, receive downlink information of a base station and then process the received downlink information to the processor 1580; in addition, the data for designing uplink is transmitted to the base station. In general, RF circuit 1510 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuit 1510 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The memory 1520 may be used to store software programs and modules, and the processor 1580 implements various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 1520. The memory 1520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 1520 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 1530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also referred to as a touch screen, can collect touch operations of a user (e.g., operations of the user on or near the touch panel 1531 using any suitable object or accessory such as a finger or a stylus) and drive corresponding connection devices according to a preset program. Alternatively, the touch panel 1531 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1580, and can receive and execute commands sent by the processor 1580. In addition, the touch panel 1531 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 1530 may include other input devices 1532 in addition to the touch panel 1531. In particular, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The Display unit 1540 may include a Display panel 1541, and optionally, the Display panel 1541 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1531 may cover the display panel 1541, and when the touch panel 1531 detects a touch operation on or near the touch panel 1531, the touch operation is transmitted to the processor 1580 to determine the type of the touch event, and then the processor 1580 provides a corresponding visual output on the display panel 1541 according to the type of the touch event. Although in fig. 27 the touch panel 1531 and the display panel 1541 are two separate components to implement the input and output functions of the mobile phone, in some embodiments the touch panel 1531 and the display panel 1541 may be integrated to implement the input and output functions of the mobile phone.
The handset can also include at least one sensor 1550, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 1541 according to the brightness of ambient light and a proximity sensor that turns off the display panel 1541 and/or the backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuitry 1560, speaker 1561, and microphone 1562 may provide an audio interface between a user and a cell phone. The audio circuit 1560 may transmit the electrical signal converted from the received audio data to the speaker 1561, and convert the electrical signal into an audio signal by the speaker 1561 and output the audio signal; on the other hand, the microphone 1562 converts collected sound signals into electrical signals, which are received by the audio circuit 1560 and converted into audio data, which are processed by the audio data output processor 1580 and then passed through the RF circuit 1510 for transmission to, for example, another cellular phone, or for output to the memory 1520 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through a WiFi module 1570, and provides wireless broadband internet access for the user. Although fig. 27 shows WiFi module 1570, it is understood that it does not belong to the essential constitution of the handset and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1580 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1520 and calling data stored in the memory 1520, thereby integrally monitoring the mobile phone. Optionally, the processor 1580 may include one or more processing units; preferably, the processor 1580 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, and the like, and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor may not be integrated into the processor 1580.
The handset also includes a power supply 1590 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1580 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In an embodiment of the present application, the handset includes a memory 1520 that can store program code and transmit the program code to the processor.
The processor 1580 included in the mobile phone may execute the data processing method provided in the foregoing embodiments according to the instructions in the program code.
The embodiment of the present application further provides a computer-readable storage medium for storing a computer program, where the computer program is used to execute the data processing method provided by the foregoing embodiment.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the data processing method provided in the various alternative implementations of the above aspects.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium may be at least one of the following media: various media that can store program codes, such as read-only memory (ROM), RAM, magnetic disk, or optical disk.
It should be noted that, in the present specification, all the embodiments are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A method of data processing, the method comprising:
acquiring an object acquisition request aiming at a target object;
writing the object acquisition request into a message queue in a cache space;
taking out the object acquisition request from the message queue to perform corresponding processing, and caching an obtained processing result in the cache space;
and inquiring a target processing result in the cache space according to the content inquiry request aiming at the target object.
2. The method of claim 1, further comprising:
and sequentially updating the obtained processing results to a database corresponding to the target object according to the processing sequence.
3. The method of claim 1, wherein if the object acquisition request is acquired via a first mode, the method further comprises:
allocating a first shaking number value to the user identifier carried by the object acquisition request;
dividing the object acquisition request into a plurality of user sets based on the first rocker number value;
when actual obtaining users of the target object are determined, according to the target value determined from the first shaking number values, selecting a first target user set corresponding to the target value from the plurality of user sets;
determining an allocable numerical value of the target object in a shop corresponding to the shop identification according to the shop identification providing the target object;
and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set according to the assignable numerical value.
4. The method according to claim 3, wherein the determining an actual acquiring user from the first set of target users to acquire the target object provided by the shop according to the assignable value comprises:
if the total number of the target objects requested by the object acquisition request in the first target user set is larger than the distributable numerical value, determining the actual acquisition user from the first target user set by shaking the user identification in the first target user set again;
if the total number of target objects requested by the object acquisition request in the first target user set is smaller than the distributable numerical value, acquiring a second target user set from the plurality of user sets by adjusting the target numerical value;
and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set and the second target user set according to the assignable numerical value.
5. The method according to any one of claims 1-4, further comprising:
acquiring a configuration file aiming at the target object, wherein the configuration file identifies rule parameters for acquiring the target object;
and if a mode switching request is acquired, switching the mode of acquiring the target object according to the configuration file, wherein the mode comprises a first mode or a second mode, and the first mode and the second mode adopt different object acquisition modes.
6. The method of claim 5, further comprising:
acquiring a rule parameter updating request from a client;
and updating the configuration file according to the indication of the rule parameter updating request.
7. The method of claim 5, further comprising:
acquiring a file acquisition request sent by a client;
and sending the configuration file to the client for indicating the client to cache the configuration file for a first preset time length locally.
8. The method according to any one of claims 1 to 4, wherein the content query response is further used to instruct the client that obtained the content query response to cache the target processing result locally for a second predetermined time.
9. The method of claim 1, wherein prior to the obtaining the object acquisition request for the target object, the method further comprises:
and sending probability indication information to the client, wherein the probability indication information is used for indicating the success probability of submitting the object acquisition request by the client.
10. A data processing apparatus, characterized in that the apparatus comprises an acquisition unit, a writing unit, a first processing unit and a second processing unit:
the acquisition unit is used for acquiring an object acquisition request aiming at a target object;
the writing unit is used for writing the object acquisition request into a message queue in a cache space;
the first processing unit is configured to take out the object acquisition request from the message queue to perform corresponding processing, and cache an obtained processing result in the cache space;
and the second processing unit is used for inquiring a target processing result in the cache space according to the content inquiry request aiming at the target object.
11. The apparatus of claim 10, wherein the write unit is specifically configured to:
and sequentially updating the obtained processing results to a database corresponding to the target object according to the processing sequence.
12. The apparatus according to claim 10, wherein if the object acquisition request is acquired through the first mode, the apparatus further comprises a shaking unit, specifically configured to:
allocating a first shaking number value to the user identifier carried by the object acquisition request;
dividing the object acquisition request into a plurality of user sets based on the first rocker number value;
when actual obtaining users of the target object are determined, according to the target value determined from the first shaking number values, selecting a first target user set corresponding to the target value from the plurality of user sets;
determining an allocable numerical value of the target object in a shop corresponding to the shop identification according to the shop identification providing the target object;
and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set according to the assignable numerical value.
13. The apparatus of claim 12, wherein the rocker unit is further configured to:
if the total number of the target objects requested by the object acquisition request in the first target user set is larger than the distributable numerical value, determining the actual acquisition user from the first target user set by shaking the user identification in the first target user set again;
if the total number of target objects requested by the object acquisition request in the first target user set is smaller than the distributable numerical value, acquiring a second target user set from the plurality of user sets by adjusting the target numerical value;
and determining an actual acquisition user for acquiring the target object provided by the shop from the first target user set and the second target user set according to the assignable numerical value.
14. An apparatus for data processing, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the method of any of claims 1-9 according to instructions in the program code.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program for performing the method of any of claims 1-9.
CN202010981825.1A 2020-09-17 2020-09-17 Data processing method and related device Pending CN112084217A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010981825.1A CN112084217A (en) 2020-09-17 2020-09-17 Data processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010981825.1A CN112084217A (en) 2020-09-17 2020-09-17 Data processing method and related device

Publications (1)

Publication Number Publication Date
CN112084217A true CN112084217A (en) 2020-12-15

Family

ID=73736605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010981825.1A Pending CN112084217A (en) 2020-09-17 2020-09-17 Data processing method and related device

Country Status (1)

Country Link
CN (1) CN112084217A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667681A (en) * 2020-12-21 2021-04-16 北京字跳网络技术有限公司 Data caching method and device and storage medium
CN112801753A (en) * 2021-02-09 2021-05-14 深圳市富途网络科技有限公司 Page display method, device and medium
CN112925578A (en) * 2021-01-28 2021-06-08 北京达佳互联信息技术有限公司 Task processing method and device and storage medium
CN113568939A (en) * 2021-08-05 2021-10-29 宁畅信息产业(北京)有限公司 Energy consumption monitoring method and device, server and computer readable storage medium
CN113886494A (en) * 2021-09-30 2022-01-04 完美世界(北京)软件科技发展有限公司 Message storage method, device, equipment and computer readable medium for instant messaging
CN113961595A (en) * 2021-10-19 2022-01-21 奇安信科技集团股份有限公司 Data query method and device, computer equipment and storage medium
CN114022250A (en) * 2021-11-09 2022-02-08 北京沃东天骏信息技术有限公司 Componentized drawing method, system, electronic equipment and computer readable medium
CN115952202A (en) * 2023-02-24 2023-04-11 北京锐服信科技有限公司 Query method

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667681A (en) * 2020-12-21 2021-04-16 北京字跳网络技术有限公司 Data caching method and device and storage medium
CN112925578A (en) * 2021-01-28 2021-06-08 北京达佳互联信息技术有限公司 Task processing method and device and storage medium
CN112925578B (en) * 2021-01-28 2024-01-30 北京达佳互联信息技术有限公司 Task processing method, device and storage medium
CN112801753A (en) * 2021-02-09 2021-05-14 深圳市富途网络科技有限公司 Page display method, device and medium
CN112801753B (en) * 2021-02-09 2024-04-23 深圳市富途网络科技有限公司 Page display method, device and medium
CN113568939A (en) * 2021-08-05 2021-10-29 宁畅信息产业(北京)有限公司 Energy consumption monitoring method and device, server and computer readable storage medium
CN113568939B (en) * 2021-08-05 2024-05-24 宁畅信息产业(北京)有限公司 Energy consumption monitoring method, device, server and computer readable storage medium
CN113886494A (en) * 2021-09-30 2022-01-04 完美世界(北京)软件科技发展有限公司 Message storage method, device, equipment and computer readable medium for instant messaging
CN113961595A (en) * 2021-10-19 2022-01-21 奇安信科技集团股份有限公司 Data query method and device, computer equipment and storage medium
CN114022250A (en) * 2021-11-09 2022-02-08 北京沃东天骏信息技术有限公司 Componentized drawing method, system, electronic equipment and computer readable medium
CN115952202A (en) * 2023-02-24 2023-04-11 北京锐服信科技有限公司 Query method
CN115952202B (en) * 2023-02-24 2023-08-22 北京锐服信科技有限公司 Big data fragment query method based on cache

Similar Documents

Publication Publication Date Title
CN112084217A (en) Data processing method and related device
CN108073605A (en) A kind of loading of business datum, push, the generation method of interactive information and device
CN113420051B (en) Data query method and device, electronic equipment and storage medium
CN109948090B (en) Webpage loading method and device
CN105303427A (en) Article exchange method and article exchange device
CN111125269A (en) Data management method, blood relationship display method and related device
CN111080429B (en) Virtual resource acquisition method, device and storage medium
CN109936504B (en) Picture display method and device, server equipment and storage medium
CN111625737B (en) Label display method, device, equipment and storage medium
CN111459565A (en) Method and device for rendering client page and mobile terminal
CN106502833A (en) Data back up method and device
CN116976898B (en) Data acquisition method, data visualization method, device and related products
CN112925878A (en) Data processing method and device
CN115509770B (en) Micro-service calling method and device, electronic equipment and readable storage medium
CN110417861A (en) A kind of information-pushing method and relevant apparatus
CN113220718B (en) Data query method and device, electronic equipment and storage medium
CN114764481A (en) User clue query method and related device
CN118059480B (en) Data processing method, device, equipment, medium, program product and system
CN115909186B (en) Image information identification method, device, computer equipment and storage medium
CN115525554B (en) Automatic test method, system and storage medium for model
CN118035567B (en) Model training and data recommending method, device, equipment, medium and program product
CN117666988A (en) Window rendering method, device, equipment and storage medium
CN114020760A (en) Data processing method and related device
CN118860471A (en) Configuration method of activity items, resource consumption management and control method and related products
CN117427341A (en) Virtual object management method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination