CN110555744A - Service data processing method and system - Google Patents

Service data processing method and system Download PDF

Info

Publication number
CN110555744A
CN110555744A CN201810551927.2A CN201810551927A CN110555744A CN 110555744 A CN110555744 A CN 110555744A CN 201810551927 A CN201810551927 A CN 201810551927A CN 110555744 A CN110555744 A CN 110555744A
Authority
CN
China
Prior art keywords
service data
queue
preset cache
new
survival time
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
CN201810551927.2A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810551927.2A priority Critical patent/CN110555744A/en
Publication of CN110555744A publication Critical patent/CN110555744A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0611Request for offers or quotes

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

the embodiment of the application provides a method and a device for processing service data, wherein the service data are stored in a preset cache, and the preset cache is provided with a corresponding ordered queue, and the method comprises the following steps: reading queue elements from the ordered queue in order; the queue element comprises the survival time corresponding to the service data; judging whether the queue element is about to expire or not according to the survival time; and if the queue element is out of date, updating the service data corresponding to the queue element in the preset cache. According to the embodiment of the application, the validity period of the service data in the preset cache can be monitored, the service data in the preset cache is deleted before the service data is expired, and the cached service data is guaranteed to be unexpired, so that the effective service data can be obtained immediately when the service data is required to be used, and the user experience is improved.

Description

service data processing method and system
Technical Field
the present application relates to the field of data processing technologies, and in particular, to a method and a system for processing service data.
background
With the development of internet technology and the popularization of mobile terminals, it is possible to implement desired functions for users by installing various apps on the mobile terminals. For example, currently only a trip needs to be input on an app of the trip navigation class, and the app automatically searches for a trip route and a ticket quote for the user.
the air ticket quotation changes frequently, but the quotation interface provided externally has the limitation of access amount and concurrency, so a layer of cache is generally added on a platform. The quotation cache can quickly respond when a user searches, so that the user experience is improved, but in order to ensure the quotation accuracy, the quotation cache sets an effective time, and the quotation cache needs to be updated after the effective time expires.
the existing popular quotation cache updating method depends on user search triggering, namely, after a platform finds that a cache is over during user search, an empty quotation is returned first, and then an external interface is asynchronously called to update the cache. Therefore, a user who triggers the updating operation cannot see the quoted prices in time, and particularly on international air tickets or some domestic cold airlines, the user cannot see the air ticket quoted prices in time during each search easily due to small search amount and long intervals.
disclosure of Invention
in view of the above problems, embodiments of the present application are proposed to provide a service data processing method and a corresponding service data processing apparatus, which overcome or at least partially solve the above problems.
in order to solve the above problem, the present application discloses a method for processing service data, where the service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the method includes:
Reading queue elements from the ordered queue in order; the queue element comprises the survival time corresponding to the service data;
Judging whether the queue element is about to expire or not according to the survival time;
And if the queue element is out of date, updating the service data corresponding to the queue element in the preset cache.
Preferably, the updating the service data corresponding to the queue element in the preset buffer includes:
acquiring a search condition;
Acquiring corresponding new service data from an external server according to the search condition;
Determining a new survival time of the new service data; and updating by adopting the search condition, the new service data and the new survival time in the ordered queue and the preset cache.
Preferably, the updating in the ordered queue and the preset buffer by using the search condition, the new service data, and the new survival time includes:
Updating the corresponding prior service data by adopting the new service data in the preset cache;
combining the search condition corresponding to the new service data and the new survival time into a queue element;
and saving the queue element in the ordered queue according to the new survival time.
Preferably, after the determining whether the queue element is about to expire according to the survival time, the method further includes:
if the queue element is not about to expire, returning to the step of reading the queue element in order from the ordered queue.
Preferably, before said reading queue elements in order from said ordered queue, further comprising:
Acquiring a search condition, and searching corresponding service data in a preset cache by adopting the search condition;
when the service data exist in the preset cache, feeding back the service data to a user;
And when the service data does not exist in the preset cache, feeding back search failure prompt information to a user.
Preferably, the method further comprises the following steps:
and when the service data does not exist in the preset cache, acquiring the corresponding service data from an external server according to the search condition.
The embodiment of the present application further discloses a system for processing service data, where the service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the system includes:
a queue element reading module, configured to read queue elements from the ordered queue in order; the queue element comprises the survival time corresponding to the service data;
The survival time judging module is used for judging whether the queue element is about to expire or not according to the survival time;
and the service data updating module is used for updating the service data corresponding to the queue element in the preset cache if the queue element is out of date.
Preferably, the method further comprises the following steps:
the search condition acquisition module is used for acquiring search conditions;
the service data searching module is used for acquiring corresponding new service data from an external server according to the searching condition;
the survival time determining module is used for determining the new survival time of the new service data;
and the data updating module is used for updating by adopting the searching condition, the new service data and the new survival time in the ordered queue and the preset cache.
preferably, the data update module includes:
A service data updating submodule, configured to update, in the preset cache, corresponding previous service data with the new service data;
the queue element combination submodule is used for updating corresponding prior business data by adopting the new business data in the preset cache;
And the queue element storage submodule is used for storing the queue elements in the ordered queue according to the new survival time.
Preferably, the method further comprises the following steps:
And the calling module is used for calling the queue element reading module if the queue element is not about to expire soon.
Preferably, the method further comprises the following steps:
the searching condition obtaining module is used for obtaining searching conditions and searching corresponding service data in a preset cache by adopting the searching conditions;
the service data feedback module is used for feeding back the service data to a user when the service data exists in the preset cache;
And the search failure prompt module is used for feeding back search failure prompt information to a user when the service data does not exist in the preset cache.
Preferably, the method further comprises the following steps:
and the external data acquisition module is used for acquiring corresponding service data from an external server according to the search condition when the service data does not exist in the preset cache.
the application also discloses a device, includes: one or more processors; and one or more machine readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform a method as described above.
The present application also discloses one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause an apparatus to perform the methods as described above.
the embodiment of the application has the following advantages:
according to the method and the device, the queue elements are read from the ordered queue in sequence, whether the queue elements are about to expire or not is determined according to the survival time of the queue elements, if the queue elements are about to expire, the service data corresponding to the queue elements stored in the preset cache are updated, so that the validity period of the service data in the preset cache can be monitored, the service data in the preset cache are deleted before the expiration, the cached service data are guaranteed not to expire, and therefore the effective service data can be obtained immediately when the service data need to be used, and user experience is improved.
drawings
fig. 1 is a flowchart of steps of embodiment 1 of a service data processing method according to the present application;
fig. 2 is a flowchart of steps of embodiment 2 of a service data processing method according to the present application;
FIG. 3 is a block diagram of a ticket quote caching system of the present application;
FIG. 4 is a flow chart of the steps of an active refresh of a ticket quote cache of the present application;
Fig. 5 is a block diagram of a service data processing system according to an embodiment of the present application.
Detailed Description
in order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Referring to fig. 1, a flowchart of steps of embodiment 1 of a method for processing service data according to the present application is shown, where service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the method specifically includes the following steps:
Step 101, reading queue elements in order from the ordered queue.
it should be noted that, in the embodiment of the present application, the service data refers to specific things in different service fields on each platform, for example, quoted price data of an air ticket. In order to make the embodiment of the present application better understood by those skilled in the art, in the present specification, description is mainly made by taking quote data of an air ticket as an example of business data.
In a specific implementation, the business data may refer to quote data of the air ticket, and the quote data may specifically include other data such as an airline, time, starting point, ending point, and price.
In the embodiment of the present application, the service data is stored in the preset cache, and the preset cache is provided with a corresponding ordered queue, where one or more queue elements may be stored in the ordered queue and correspond to the service data one to one. Specifically, in the present application, the service data is stored in a key-value pair manner, where one key corresponds to one value, the key refers to a queue element, and the value refers to corresponding service data.
The queue element includes a time-to-live corresponding to the traffic data. And queue elements in the ordered queue are stored in a certain order, for example, according to the time of writing into the queue.
the survival time refers to the effective time of the service data after the service data is stored in the preset cache from the beginning, and if the time stored in the preset cache exceeds the survival time, the service data may have failed.
And 102, judging whether the queue element is about to expire or not according to the survival time.
according to the embodiment of the application, whether the service data is about to expire or not can be determined in advance according to the survival time corresponding to the service data, and if the service data is determined to expire, the service data can be removed from the ordered queue.
In practical application, whether the queue element is expired can be determined by comparing the current time minus the write time with the survival time through the write time of the queue element written into the ordered queue and the current time. Of course, the above-mentioned manner of determining whether the queue element is expired according to the survival time is only an example, and it may also be determined whether the queue element is valid through other manners when the embodiment of the present application is executed in real time, which is not limited in this embodiment of the present application.
step 103, if the queue element is about to expire, updating the service data corresponding to the queue element in the preset cache. As can be seen from the foregoing, the queue element has corresponding service data in the preset buffer, and therefore, if it is determined that the queue element is about to expire, the corresponding service data in the preset buffer is updated.
according to the method and the device, the queue elements are read from the ordered queue in sequence, whether the queue elements are about to expire or not is determined according to the survival time of the queue elements, if the queue elements are about to expire, the service data corresponding to the queue elements stored in the preset cache are updated, so that the validity period of the service data in the preset cache can be monitored, the service data in the preset cache are deleted before the expiration, the cached service data are guaranteed not to expire, and therefore the effective service data can be obtained immediately when the service data need to be used, and user experience is improved.
referring to fig. 2, a flowchart of steps of embodiment 2 of a method for processing service data according to the present application is shown, where service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the method specifically includes the following steps:
step 201, reading queue elements from the ordered queue in sequence; the queue element includes a corresponding time to live for the traffic data.
In the embodiment of the application, the queue elements can be read from the ordered queue in order according to the time sequence.
step 202, determining whether the queue element is about to expire according to the survival time.
after the queue element is read, extracting the survival time from the queue element, and determining whether the queue element is about to expire based on the survival time, that is, determining whether the service data corresponding to the queue element is about to expire based on the survival time.
Step 203, if the queue element is about to expire, obtaining a search condition.
if the queue element is about to expire, the service data found in the preset cache by the user using the search condition may not be valid data, so in the embodiment of the present application, the queue element about to expire and the service data corresponding to the queue element are deleted, and the search is performed based on the search condition in the queue element again to obtain new service data and store the new service data in the preset cache.
and 204, acquiring corresponding new service data from the external server according to the search condition.
in the embodiment of the present application, the service data stored in the preset cache is data obtained according to a certain search condition. Taking the service data as the quoted price data of the air ticket as an example, the searching condition in the ordered queue is 'Shanghai to hong Kong 2017-11-11', and the searching condition stores the corresponding air ticket quoted price data in a preset cache.
when new service data is obtained again, an external interface can be called, and the service data corresponding to the search condition is obtained from an external server.
step 205, determining a new survival time of the new service data.
when new service data is acquired, the new survival time of the new service data is calculated first. Wherein the survival time can be calculated according to specific practice. Taking the quoted data of the air ticket as an example, the survival time is calculated by manually setting a cache survival time according to the length of the departure date, the rank of the airline searching amount, the days before and after the holiday, and the quoted data can be calculated according to the conditions and the corresponding configuration after being returned. Of course, this is merely an example of the survival time, and other ways of calculating the survival time may be used in practice.
And step 206, updating the ordered queue and the preset cache by adopting the search condition, the new service data and the new survival time.
after the new survival time of the new service data is obtained through calculation, the new survival time can be updated and stored in the ordered queue and the preset cache correspondingly.
in a preferred embodiment of the present application, the step 206 may comprise the following sub-steps:
substep S11, updating the corresponding previous service data with the new service data in the preset cache;
Substep S12, combining the search condition and the new survival time corresponding to the new service data into a queue element;
Sub-step S13, saving said queue element in said ordered queue according to said new time-to-live.
after the new service data and the new survival time thereof are obtained through calculation, the new service data can be stored in a preset cache, and meanwhile, the new survival time and the search condition corresponding to the new service data are stored in the ordered queue as a group of queue elements.
In a preferred embodiment of the present application, the method may further comprise the steps of:
acquiring a search condition, and searching corresponding service data in a preset cache by adopting the search condition;
when the service data exist in the preset cache, feeding back the service data to a user;
And when the service data does not exist in the preset cache, feeding back search failure prompt information to a user.
In practice, when a user searches, the user may input a search condition to query for required service data, and after obtaining the search condition of the user, the user may search for the service data in a preset cache according to the search condition.
According to the embodiment of the application, the service data obtained based on a certain search condition is pre-stored in the preset cache, so that a user can quickly search the cache when searching data based on the search condition, such as quotation data of an air ticket. And the system can actively request the external interface to refresh the business data which is about to expire according to the searching condition so as to ensure that the business data which is not expired is always in the cache.
When searching for service data in the preset cache according to the search condition, the corresponding service data may be found, or the corresponding service data may not be found. When the corresponding service data is found in the preset cache, the service data can be fed back to the user, and when the corresponding service data cannot be found in the preset cache, the prompt information of the search failure can be fed back to the user, or the user is prompted to search again.
in a preferred embodiment of the present application, when the service data does not exist in the preset cache, the method may further include the following steps:
And acquiring corresponding service data from an external server according to the search condition.
In practical application, if the service data does not exist in the preset cache, the service data corresponding to the search condition is searched from the external server through the external interface, and then the data is fed back to the user. In this case, although the required service data can be fed back to the user, the service data needs to be obtained from the external server through the external interface, that is, the third-party data platform needs to be called.
By applying the embodiment of the application, when a user searches by using the search condition, whether the service data corresponding to the search condition exists is firstly searched in the preset cache, and if the service data exists, the service data is fed back to the user.
In order to make the embodiment of the present application better understood by those skilled in the art, the following description will be made of a specific example of a process for implementing an air ticket quotation.
referring to fig. 3, which is a block diagram of a ticket quotation caching system according to an embodiment of the present application, as shown in the figure, a search condition and a survival time of service data are written into an ordered queue memory through an I/O interface by a processor, and then a first queue element of the ordered queue is cyclically obtained by the processor and calculated to determine whether the queue element is about to expire, and if the queue element is about to expire, an interface call is triggered through the I/O interface.
referring to fig. 4, a flowchart illustrating steps of actively refreshing an air ticket quotation cache according to an embodiment of the present application is shown, which may specifically include the following steps:
1. The user searches for air ticket quotations, such as searching for departure from Shanghai to hong Kong 2017-11-11;
2. the system reads quotation data in a preset cache according to the search condition;
3. Judging whether quotation data corresponding to the user searching conditions exist in the cache;
4. If there is quotation data, return it to step 2, if there is no quotation data, return the empty quotation;
5. Asynchronously calling an external interface, and acquiring quoted price data corresponding to a user search condition from an external server;
6. Calculating the survival time of the returned quoted data;
7. updating the quotation data in a preset cache;
8. Writing the survival time corresponding to the quotation data into an ordered queue (such as a redis ordered set), wherein queue elements of the queue are the search condition and the survival time corresponding to the search condition, and the survival time is used as the priority to be ordered from small to large according to the priority;
9. the system starts a thread to read the first element of the ordered queue all the time;
10. Whether the queue element is about to expire or not is determined, for example, by the following method: (current time-expiration time point) < expiration threshold (such as 60 seconds), where the expiration threshold is configurable;
11. if the condition of being expired is met, removing the queue element from the ordered queue and calling an external interface to update quotation data;
12. if the condition of imminent expiration is not met, the first queue element of the ordered queue is read and step 10 is repeated.
by applying the embodiment of the application, the system actively detects and triggers the refreshing of the air ticket quotation cache, and can also store the survival time of the quotation data through the ordered queue, so that the data stored in the cache are effective and unexpired, and a user can quickly obtain the effective quotation data when searching the quotation data by using the search condition. Therefore, the problem that the quotation data cannot be actively updated after the quotation data of the prior air ticket is expired in the cache, so that the quotation data cannot be timely returned when a user searches after the quotation cache is expired is solved.
it should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Referring to fig. 5, a block diagram of a structure of an embodiment of a service data processing system according to the present application is shown, where service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the system may specifically include the following modules:
a queue element reading module 301, configured to read queue elements from the ordered queue in order; the queue element comprises the survival time corresponding to the service data;
A survival time determining module 302, configured to determine whether the queue element is about to expire according to the survival time;
A service data updating module 303, configured to update the service data corresponding to the queue element in the preset cache if the queue element is about to expire.
in a preferred embodiment of the present application, the system may further include the following modules:
The search condition acquisition module is used for acquiring search conditions;
the service data searching module is used for acquiring corresponding new service data from an external server according to the searching condition;
the survival time determining module is used for determining the new survival time of the new service data;
and the data updating module is used for updating by adopting the searching condition, the new service data and the new survival time in the ordered queue and the preset cache.
In a preferred embodiment of the present application, the data update module may include the following sub-modules:
a service data updating submodule, configured to update, in the preset cache, corresponding previous service data with the new service data;
the queue element combination submodule is used for updating corresponding prior business data by adopting the new business data in the preset cache;
And the queue element storage submodule is used for storing the queue elements in the ordered queue according to the new survival time.
In a preferred embodiment of the present application, the system may further include the following modules:
And the calling module is used for calling the queue element reading module if the queue element is not about to expire soon.
In a preferred embodiment of the present application, the system may further include the following modules:
the searching condition obtaining module is used for obtaining searching conditions and searching corresponding service data in a preset cache by adopting the searching conditions;
The service data feedback module is used for feeding back the service data to a user when the service data exists in the preset cache;
and the search failure prompt module is used for feeding back search failure prompt information to a user when the service data does not exist in the preset cache.
In a preferred embodiment of the present application, the system may further include the following modules:
And the external data acquisition module is used for acquiring corresponding service data from an external server according to the search condition when the service data does not exist in the preset cache.
For the system embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present application further provides an apparatus, including:
One or more processors; and
One or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform methods as described in embodiments of the present application.
Embodiments of the present application also provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause an apparatus to perform the methods described in embodiments of the present application.
the embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (fransitory media), such as modulated data signals and carrier waves.
embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction system which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
these computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
while preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The foregoing describes in detail a service data processing method and a service data processing system provided by the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing examples are only used to help understand the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (12)

1. A method for processing service data is characterized in that the service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the method comprises the following steps:
reading queue elements from the ordered queue in order; the queue element comprises the survival time corresponding to the service data;
Judging whether the queue element is about to expire or not according to the survival time;
And if the queue element is out of date, updating the service data corresponding to the queue element in the preset cache.
2. The method according to claim 1, wherein the updating the service data corresponding to the queue element in the preset buffer includes:
acquiring a search condition;
acquiring corresponding new service data from an external server according to the search condition;
Determining a new survival time of the new service data; and updating by adopting the search condition, the new service data and the new survival time in the ordered queue and the preset cache.
3. the method of claim 2, wherein the updating in the ordered queue and the preset buffer by using the search condition, the new service data and the new time-to-live comprises:
Updating the corresponding prior service data by adopting the new service data in the preset cache;
combining the search condition corresponding to the new service data and the new survival time into a queue element;
and saving the queue element in the ordered queue according to the new survival time.
4. The method of claim 1, further comprising, after said determining whether the queue element is about to expire based on the time-to-live:
If the queue element is not about to expire, returning to the step of reading the queue element in order from the ordered queue.
5. the method of claim 1, further comprising, prior to said reading queue elements in order from said ordered queue:
Acquiring a search condition, and searching corresponding service data in a preset cache by adopting the search condition;
when the service data exist in the preset cache, feeding back the service data to a user;
And when the service data does not exist in the preset cache, feeding back search failure prompt information to a user.
6. the method of claim 5, further comprising:
And when the service data does not exist in the preset cache, acquiring the corresponding service data from an external server according to the search condition.
7. A system for processing service data is characterized in that the service data is stored in a preset cache, and the preset cache has a corresponding ordered queue, and the system comprises:
a queue element reading module, configured to read queue elements from the ordered queue in order; the queue element comprises the survival time corresponding to the service data;
The survival time judging module is used for judging whether the queue element is about to expire or not according to the survival time;
And the service data updating module is used for updating the service data corresponding to the queue element in the preset cache if the queue element is out of date.
8. The system of claim 7, further comprising:
the search condition acquisition module is used for acquiring search conditions;
The service data searching module is used for acquiring corresponding new service data from an external server according to the searching condition;
The survival time determining module is used for determining the new survival time of the new service data;
and the data updating module is used for updating by adopting the searching condition, the new service data and the new survival time in the ordered queue and the preset cache.
9. The system of claim 7, wherein the data update module comprises:
A service data updating submodule, configured to update, in the preset cache, corresponding previous service data with the new service data;
The queue element combination submodule is used for updating corresponding prior business data by adopting the new business data in the preset cache;
and the queue element storage submodule is used for storing the queue elements in the ordered queue according to the new survival time.
10. The system of claim 7, further comprising:
And the calling module is used for calling the queue element reading module if the queue element is not about to expire soon.
11. the system of claim 7, further comprising:
the searching condition obtaining module is used for obtaining searching conditions and searching corresponding service data in a preset cache by adopting the searching conditions;
the service data feedback module is used for feeding back the service data to a user when the service data exists in the preset cache;
and the search failure prompt module is used for feeding back search failure prompt information to a user when the service data does not exist in the preset cache.
12. The system of claim 11, further comprising:
And the external data acquisition module is used for acquiring corresponding service data from an external server according to the search condition when the service data does not exist in the preset cache.
CN201810551927.2A 2018-05-31 2018-05-31 Service data processing method and system Pending CN110555744A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810551927.2A CN110555744A (en) 2018-05-31 2018-05-31 Service data processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810551927.2A CN110555744A (en) 2018-05-31 2018-05-31 Service data processing method and system

Publications (1)

Publication Number Publication Date
CN110555744A true CN110555744A (en) 2019-12-10

Family

ID=68734539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810551927.2A Pending CN110555744A (en) 2018-05-31 2018-05-31 Service data processing method and system

Country Status (1)

Country Link
CN (1) CN110555744A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112580098A (en) * 2020-12-23 2021-03-30 光大兴陇信托有限责任公司 Business data comparison method and system
CN117112267A (en) * 2023-10-20 2023-11-24 成都华栖云科技有限公司 Cache maintenance method of application interface

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110295874A1 (en) * 2010-05-27 2011-12-01 International Business Machines Corporation Metadata cache management
CN106021445A (en) * 2016-05-16 2016-10-12 努比亚技术有限公司 Cached data loading method and apparatus
CN106599721A (en) * 2016-12-13 2017-04-26 微梦创科网络科技(中国)有限公司 Cache-based data access method and apparatus
CN106844784A (en) * 2017-03-14 2017-06-13 上海网易小额贷款有限公司 Data cache method, device and computer-readable recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110295874A1 (en) * 2010-05-27 2011-12-01 International Business Machines Corporation Metadata cache management
CN106021445A (en) * 2016-05-16 2016-10-12 努比亚技术有限公司 Cached data loading method and apparatus
CN106599721A (en) * 2016-12-13 2017-04-26 微梦创科网络科技(中国)有限公司 Cache-based data access method and apparatus
CN106844784A (en) * 2017-03-14 2017-06-13 上海网易小额贷款有限公司 Data cache method, device and computer-readable recording medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112580098A (en) * 2020-12-23 2021-03-30 光大兴陇信托有限责任公司 Business data comparison method and system
CN117112267A (en) * 2023-10-20 2023-11-24 成都华栖云科技有限公司 Cache maintenance method of application interface
CN117112267B (en) * 2023-10-20 2024-01-23 成都华栖云科技有限公司 Cache maintenance method of application interface

Similar Documents

Publication Publication Date Title
CN107451181B (en) Page rendering method and device
CN107133234B (en) Method, device and system for updating cache data
US10103994B2 (en) Opportunistic network updates
US10735537B2 (en) Information pushing
CN107590207B (en) Data synchronization method and device and electronic equipment
CN107153644B (en) Data synchronization method and device
CN102780603B (en) Web traffic control method and device
CN111028009B (en) Processing method and device for retrievable business entity
CN112734064A (en) Data processing method, device and storage medium
CN110555744A (en) Service data processing method and system
CN111882350A (en) Service information pushing method and device and electronic equipment
CN106547751B (en) Cache data updating method and device
CN112433921A (en) Method and apparatus for dynamic point burying
CN113821307B (en) Method, device and equipment for quickly importing virtual machine images
CN107220260B (en) Page display method and device
CN113326146A (en) Message processing method and device, electronic equipment and storage medium
CN113553214A (en) Idempotent checking method and device
CN110764930B (en) Request or response processing method and device based on message mode
CN112597151A (en) Data processing method, device, equipment and storage medium
CN107103001B (en) Method, device and system for acquiring target front-end resource file based on browser
US11550768B1 (en) Methods and systems for a fast access database and fast database monitoring
US20160127496A1 (en) Method and system of content caching and transmission
US11023830B2 (en) Processing a request in accordance with original rules and configurations
CN110866206B (en) Data update setting method and device
CN112765503A (en) Static processing method and device for page loading data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191210