A method and system for publishing page data
Through the back-end system, the front-end system obtains page data from the storage system, solving the problems of server pressure and page delay, realizing the timely page effectiveness and simplicity of data query.
Patent Information
- Application Number
- CN201911083092.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-07
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2039-11-07
AI Technical Summary
In the prior art, a large number of page timed publishing tasks are concentrated at the same time point, resulting in a surge in server pressure, a longer task execution time, and a delay in page performance.
The back-end system executes page tasks in advance and saves data to the storage system. When receiving access requests, the front-end system obtains the currently effective page data from the storage system and sends it to the terminal to avoid instantaneous pressure on the server and ensures that the page takes effect immediately.
By dispersing page tasks, avoiding instantaneous pressure on the server, ensuring that the page can take effect immediately, reducing the page's effectiveness time, and simplifying the data query process.
Smart Images

Figure CN112784195B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a page data publishing method and system. Background Art
[0002] In various business scenarios, there are usually many pages that need to be published on a scheduled basis. These pages usually have the following two characteristics: first, the business logic of the page is complex and the execution time is long (usually hundreds of milliseconds); second, the page is concentrated at a certain time point, such as 0 o'clock. In the prior art, when a user submits a page task for scheduled publishing, the page task is directly stored in the publishing task list. The front end scans the publishing task list in real time. When a page task that needs to be published (i.e., the scheduled time is reached) is scanned, the corresponding page publishing business logic is directly executed, the corresponding page is generated, and the page is made visible to the terminal user.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] The page publishing business logic will only start to execute after the scheduled time arrives. When a large number of pages are scheduled at the same or similar time points, a large number of page publishing tasks will need to be executed simultaneously near the time point, causing the server pressure to surge, the task execution time to become longer (from hundreds of milliseconds to seconds), and the page delay to take effect. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a page data publishing method and system, in which the back-end system executes the page task in advance and saves the page data to the storage system. After receiving the page access request, the front-end system directly obtains the page data of the currently effective target page from the storage system and sends it to the terminal device for display, so that the page task can be executed in a decentralized manner, avoiding instantaneous pressure on the server, and the target page can take effect immediately.
[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for publishing page data is provided.
[0007] A page data publishing method according to an embodiment of the present invention comprises: receiving page generation information from a back-end system, and obtaining page metadata from the page generation information; wherein the page metadata comprises a page identifier, a storage identifier and a page effective time; when a page access request is received, selecting a currently effective target page from the page metadata according to the page identifier and current time information in the page access request; obtaining corresponding page data from a storage system according to the storage identifier of the target page, so as to return the page data to a terminal device for display; wherein the page data is generated and saved to the storage system after the back-end system receives a page task to be published and executes the page task.
[0008] Optionally, based on the page identifier and current time information in the page access request, selecting the currently effective target page from the page metadata includes: based on the page identifier in the page access request, obtaining a data record with the same page identifier from the page metadata; based on the current time information, filtering out data records whose page effective time includes the current time information from the data records, and the page corresponding to the filtered data record is the target page.
[0009] Optionally, the page generation information is generated by the backend system after the execution of the page task is completed, and then written into a message queue and sent through the message queue.
[0010] Optionally, the storage system is a Key-Value type database system, Key is a storage identifier of the page data, and Value is the page data.
[0011] Optionally, the page task is a task corresponding to a scheduled publishing page.
[0012] To achieve the above objective, according to another aspect of an embodiment of the present invention, a page data publishing method is provided.
[0013] A page data publishing method according to an embodiment of the present invention includes: receiving a page task to be published, executing the page task to generate corresponding page data, and saving the page data to a storage system; when a page access request is received, selecting a currently effective target page from page metadata according to a page identifier and current time information in the page access request; wherein the page metadata includes the page identifier, storage identifier and page effective time; and obtaining corresponding page data from the storage system according to the storage identifier of the target page, so as to return the obtained page data to a terminal device for display.
[0014] To achieve the above objective, according to another aspect of an embodiment of the present invention, a page data publishing system is provided.
[0015] A page data publishing system according to an embodiment of the present invention includes: an acquisition module, which is used to receive page generation information from a back-end system and obtain page metadata from the page generation information; wherein the page metadata includes a page identifier, a storage identifier and a page effective time; a selection module, which is used to select a currently effective target page from the page metadata according to the page identifier and current time information in the page access request when a page access request is received; and a publishing module, which is used to obtain corresponding page data from a storage system according to the storage identifier of the target page, so as to return the page data to a terminal device for display; wherein the page data is generated and saved to the storage system after the back-end system receives a page task to be published and executes the page task.
[0016] Optionally, the selection module is also used to: obtain data records with the same page identifier from the page metadata according to the page identifier in the page access request; and filter out data records whose page effective time contains the current time information from the data records according to the current time information, and the page corresponding to the filtered data record is the target page.
[0017] To achieve the above objective, according to another aspect of an embodiment of the present invention, a page data publishing system is provided.
[0018] A page data publishing system according to an embodiment of the present invention includes: a front-end system and a back-end system, wherein the back-end system is used to receive a page task to be published, execute the page task to generate corresponding page data, and save the page data to a storage system; the front-end system is used to, when receiving a page access request, select a currently effective target page from page metadata according to a page identifier and current time information in the page access request; wherein the page metadata includes the page identifier, storage identifier and page effective time; the front-end system is also used to obtain corresponding page data from the storage system according to the storage identifier of the target page, so as to return the obtained page data to a terminal device for display.
[0019] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0020] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement a page data publishing method according to an embodiment of the present invention.
[0021] To achieve the above objective, according to another aspect of the embodiments of the present invention, a computer readable medium is provided.
[0022] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a page data publishing method according to an embodiment of the present invention is implemented.
[0023] An embodiment of the above invention has the following advantages or beneficial effects: the back-end system executes the page task in advance and saves the page data to the storage system. After receiving the page access request, the front-end system directly obtains the page data of the currently effective target page from the storage system and sends it to the terminal device for display, so that the page task can be executed in a decentralized manner, avoiding instantaneous pressure on the server, and the target page can take effect immediately; based on the page identifier and the current time information, the data records with the same page identifier and the page effective time containing the current time information are quickly filtered out from the page metadata, and then the currently effective target page is determined, further reducing the page effective time; the back-end system and the front-end system communicate through message queues without the need for a dedicated connection for linking; the page data is saved in the form of key-value pairs, which is convenient for subsequent rapid query of the page data of the target page from the storage system, and the implementation is simple; for page tasks that need to be generated at a certain time point on a regular basis, the present application can make them executed in a decentralized manner, the server will not have instantaneous pressure, the task execution time will not be prolonged, and the page can take effect immediately.
[0024] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0026] Figure 1 is a schematic diagram of the main steps of the page data publishing method according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of the implementation principle of the page data publishing method according to an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of the main flow of a method for publishing page data according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of main modules of a page data publishing system according to an embodiment of the present invention;
[0030] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0031] Figure 6 It is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0033] Figure 1 FIG. 1 is a schematic diagram of the main steps of the method for publishing page data according to an embodiment of the present invention. Figure 1 As shown, the page data publishing method of the embodiment of the present invention mainly includes the following steps:
[0034] Step S101: Receive page generation information from the backend system, and obtain page metadata from the page generation information. The page metadata includes a page ID, a storage ID, and a page effective time. After the backend system receives the page task to be published, it executes the page task to generate page data, saves the page data to the storage system, and then generates a page generation information, which includes page metadata and sends it to the front-end system. After the front-end system receives the page generation information sent by the back-end system, it obtains the page metadata contained therein from the page generation information. The storage ID here is used to query the corresponding page data from the storage system later.
[0035] Step S102: When a page access request is received, the currently effective target page is selected from the page metadata according to the page identifier and current time information in the page access request. When the front-end system receives a page access request, it obtains data records with the same page identifier from the page metadata according to the page identifier in the page access request; then, according to the current time information, it filters out data records whose page effective time contains the current time information from the data records, and the page corresponding to the filtered data record is the target page.
[0036] Step S103: According to the storage identifier of the target page, the corresponding page data is obtained from the storage system to return the page data to the terminal device for display. The storage system stores the storage identifier and the corresponding page data. The front-end system obtains the corresponding page data from the storage system according to the storage identifier of the filtered target page and sends the page data to the terminal device. The terminal device displays the page data on its interface so that the target page is visible to the user. The publishing of the page data is thus realized.
[0037] Figure 2 FIG. 1 is a schematic diagram showing the implementation principle of the method for publishing page data according to an embodiment of the present invention. Figure 2 As shown, the page data publishing method in the embodiment of the present invention is implemented by the front-end system, the back-end system and the storage system. After receiving the page task to be published, the back-end system submits the page task to the task publishing queue, then immediately executes the page task to generate page data, saves the page data to the storage system, and then sends the page generation information to the front-end system through the message queue to notify the front-end system that new page data has been generated.
[0038] The front-end system obtains page metadata from the page generation information and records the page metadata. When receiving a user's page access request, the current effective target page is selected from the page metadata according to the page identifier and current time information in the page access request, and then the page data of the target page is obtained from the storage system and returned to the terminal device for display.
[0039] In an optional embodiment, the functions of the front-end system and the back-end system can be implemented on the server side, that is, the page data publishing method of the embodiment of the present invention is completed by the server side and the storage system, and the specific implementation process is: receiving the page task to be published, executing the page task to generate the corresponding page data, and saving the page data to the storage system; when a page access request is received, according to the page identifier and current time information in the page access request, selecting the currently effective target page from the page metadata; according to the storage identifier of the target page, obtaining the corresponding page data from the storage system, and returning the obtained page data to the terminal device for display.
[0040] Figure 3 FIG. 1 is a schematic diagram of the main flow of the method for publishing page data according to an embodiment of the present invention. Figure 3 As shown, the page data publishing method of the embodiment of the present invention mainly includes the following steps:
[0041] Step S301: The backend system receives the scheduled page task to be published and saves it to the task publishing queue. The scheduled publishing page is a page that needs to be generated at a certain time point and becomes visible to the terminal user. The scheduled page task is the task corresponding to the scheduled publishing page, including: page content identifier (id), page basic parameters and page effective time. The page content identifier is used to uniquely identify the page; the page basic parameters are the relevant parameters used for page generation, such as: name, other relevant business parameters, etc.
[0042] Step S302: The back-end system executes the scheduled page tasks in the task publishing queue to generate corresponding page data, saves the page data to the storage system, and sends page generation information to the front-end system. The back-end system executes the scheduled page tasks in the task publishing queue in real time in the thread pool to generate corresponding page data, which is the text content displayed to the end user. The thread pool is a form of multi-threaded processing. During the processing, tasks are added to the queue, and then these tasks are automatically started after the thread is created. The threads of the thread pool are all background threads. Each thread uses the default stack size, runs at the default priority, and is in a multi-threaded unit.
[0043] The implementation process of generating page data is: according to the basic parameters of the page in the scheduled page task, execute specific business logic, and finally obtain a page data. Different businesses generally have different implementation logics, and the format of page data varies according to business needs, which can be HTML (HyperText Markup Language), JSON (JavaScript Object Notation, a lightweight data exchange format), XML (Extensible Markup Language), etc.
[0044] In an optional embodiment, the storage system is a Key-Value type database system, such as a Redis cache system. The backend system saves the generated page data in the form of Key-Value to the Redis cache system. Among them, Key is the storage identifier and Value is the page data. Redis is a Key-Value storage system that supports the storage of string, linked list, set, ordered set and hash type data.
[0045] In an optional embodiment, the backend system generates a page generation information, which is then written into a message queue (MQ), which sends the page generation information to the frontend system to notify the frontend system that a new scheduled page is generated. MQ is an application-to-application communication method, where applications communicate by writing and retrieving data (messages) for the application in and out of a queue.
[0046] The page generation information includes page metadata, which includes page effective time, storage identifier and page identifier. The page identifier is a page content identifier, or a page content identifier and a page type identifier. The page type identifier is used to identify different page types. For example, pages belonging to the same merchant are classified into one category, in which case the page type identifier is the merchant identifier; for another example, pages belonging to the same type of product are classified into one category, in which case the page type identifier is the product identifier.
[0047] Step S303: After receiving the page generation information, the front-end system records the page metadata.
[0048] In an embodiment, the page metadata can be saved to a storage system. The page metadata includes the page effective time, storage identifier, and page content identifier, as shown in Table 1; the page metadata includes the page effective time, storage identifier, page content identifier, and page content identifier, as shown in Table 2.
[0049] Table 1 shows the recording result of page metadata according to an embodiment of the present invention.
[0050]
[0051] Table 2 shows the recording result of page metadata of another embodiment of the present invention
[0052]
[0053] Step S304: After receiving the page access request, the front-end system searches for the target page according to the recorded page metadata. The user sends a page access request to the front-end system through a terminal device, and the page access request carries a page identifier and the current system time. The front-end system obtains data records with the same page identifier from the page metadata according to the page identifier in the page access request; then, the data records whose page effective time includes the current system time are filtered out from the data records, and the page corresponding to the filtered data record is the target page. The following is an example.
[0054] Take the page metadata including the page effective time, storage identifier and page content identifier as an example. At this time, the page access request carries the page content identifier, assuming that the page content identifiers are page1 and page2, and the current system time is 9:00 on November 3, 2018. Then, the data records of page1 and page2 can be obtained from the page metadata, that is, the first and second data records in Table 1. Then, the data record containing the current system time is filtered out from these two data records, that is, the second data record, and the target page is page2.
[0055] Take the page metadata including page effective time, storage identifier, page content identifier and page content identifier as an example. At this time, the page access request carries the page type identifier. Assuming that the page type identifier is merchant 2 and the current system time is 8:00 on June 13, 2018, the data record containing merchant 2 can be obtained from the page metadata, that is, the third and fourth data records in Table 2. Then, the data record containing the current system time is filtered out from these two data records, that is, the third data record, and the target page is page 1 of merchant 2.
[0056] Step S305: The front-end system obtains the corresponding page data from the storage system according to the storage identifier of the target page, and returns the page data to the terminal device for display. In the embodiment, the front-end system obtains the corresponding Value (i.e., page data) from the Redis cache system according to the Key of the target page, and then returns the page data to the terminal device for display.
[0057] This embodiment ensures that the business logic of the published page is executed in a decentralized manner by having the back-end system execute the business logic of the scheduled page task in advance (putting it into the task publishing queue for execution when the scheduled page task is submitted), and the server will not have instantaneous pressure and will not affect other businesses. At the same time, the front-end system directly obtains the page data from the cache, and the scheduled page takes effect immediately without delay. This solves the problem in the prior art that a large number of scheduled publishing page tasks are executed at the same time point, resulting in an instantaneous surge in server pressure, longer business execution time, and delayed effectiveness of the published page task.
[0058] In another preferred embodiment, the page metadata is also stored in the cache system. After the front-end system receives the user access request, it obtains the page metadata from the cache system and obtains the key of the target page. Then, the page data of the target page is obtained from the Redis cache through the key. Since all the data of the entire operation (page metadata and page data) are in the cache system, the entire operation process is extremely fast and the end user will not feel any delay.
[0059] It can be seen from the page data publishing method of the embodiment of the present invention that the back-end system executes the page task in advance and saves the page data to the storage system. After receiving the page access request, the front-end system directly obtains the page data of the currently effective target page from the storage system and sends it to the terminal device for display, so that the page task can be executed in a decentralized manner to avoid instantaneous pressure on the server, and the target page can take effect immediately; based on the page identifier and the current time information, data records with the same page identifier and the page effective time containing the current time information are quickly screened out from the page metadata, and then the currently effective target page is determined, further reducing the page effective time; the back-end system and the front-end system communicate through message queues without the need for a dedicated connection for linking; the page data is saved in the form of key-value pairs, which is convenient for subsequent rapid query of the page data of the target page from the storage system, and the implementation is simple; for page tasks that need to be generated at a certain time point on a regular basis, the present application can enable them to be executed in a decentralized manner, the server will not have instantaneous pressure, the task execution time will not be prolonged, and the page can take effect immediately.
[0060] Figure 4 FIG. 1 is a schematic diagram of the main modules of the page data publishing system according to an embodiment of the present invention. Figure 4 As shown, the page data publishing system 400 (i.e., the front-end system) of the embodiment of the present invention mainly includes:
[0061] The acquisition module 401 is used to receive the page generation information from the back-end system and obtain the page metadata from the page generation information. The page metadata includes the page identifier, storage identifier and page effective time; after the back-end system receives the page task to be published, it executes the page task to generate page data, saves the page data to the storage system, and then generates a page generation information, which contains the page metadata and is sent to the front-end system. After the front-end system receives the page generation information sent by the back-end system, it obtains the page metadata contained in the page generation information. The storage identifier here is used to query the corresponding page data from the storage system later.
[0062] The selection module 402 is used to select the currently effective target page from the page metadata according to the page identifier and current time information in the page access request when receiving the page access request. When the front-end system receives the page access request, it obtains the data record with the same page identifier from the page metadata according to the page identifier in the page access request; then, according to the current time information, it filters out the data records whose page effective time contains the current time information from the data records, and the page corresponding to the filtered data record is the target page.
[0063] The publishing module 403 is used to obtain the corresponding page data from the storage system according to the storage identifier of the target page, so as to return the page data to the terminal device for display. The storage system stores the storage identifier and the corresponding page data. The front-end system obtains the corresponding page data from the storage system according to the storage identifier of the filtered target page, and sends the page data to the terminal device. The terminal device displays the page data on its interface so that the target page is visible to the user. The publishing of the page data is thus realized.
[0064] From the above description, it can be seen that the back-end system executes the page task in advance and saves the page data to the storage system. After receiving the page access request, the front-end system directly obtains the page data of the currently effective target page from the storage system and sends it to the terminal device for display, so that the page task can be executed in a decentralized manner, avoiding instantaneous pressure on the server, and the target page can take effect immediately; based on the page identifier and the current time information, the data records with the same page identifier and the page effectiveness time containing the current time information are quickly filtered out from the page metadata, and then the currently effective target page is determined, further reducing the page effectiveness time; the back-end system and the front-end system communicate through message queues without the need for a dedicated connection for linking; the page data is saved in the form of key-value pairs, which is convenient for subsequent rapid query of the target page data from the storage system, and the implementation is simple; for page tasks that need to be generated at a certain time point on a regular basis, the present application can enable them to be executed in a decentralized manner, the server will not have instantaneous pressure, the task execution time will not be prolonged, and the page can take effect immediately.
[0065] Figure 5 An exemplary system architecture 500 is shown to which the page data publishing method or page data publishing system according to the embodiment of the present invention can be applied.
[0066] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0067] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0068] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0069] The server 505 may be a server that provides various services, such as a background management server that processes page access requests sent by users using the terminal devices 501, 502, and 503. The background management server may select a target page, obtain corresponding page data, and process the page based on the page identifier and current time information in the page access request, and feed back the processing result (e.g., page data of the target page) to the terminal device.
[0070] It should be noted that the page data publishing method provided in the embodiment of the present application is generally executed by the server 505 , and accordingly, the page data publishing system is generally set in the server 505 .
[0071] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0072] According to an embodiment of the present invention, the present invention also provides an electronic device and a computer-readable medium.
[0073] The electronic device of the present invention comprises: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement a page data publishing method of an embodiment of the present invention.
[0074] The computer-readable medium of the present invention stores a computer program, and when the program is executed by a processor, a page data publishing method of an embodiment of the present invention is implemented.
[0075] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 suitable for implementing an electronic device of an embodiment of the present invention. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0076] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0077] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0078] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the main step diagram. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0079] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0080] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0081] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module, a selection module and a publishing module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the acquisition module may also be described as "a module that receives page generation information from a backend system and obtains page metadata from the page generation information".
[0082] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: receiving page generation information from a backend system, and obtaining page metadata from the page generation information; wherein the page metadata includes a page identifier, a storage identifier, and a page effective time; when a page access request is received, according to the page identifier and current time information in the page access request, the currently effective target page is selected from the page metadata; according to the storage identifier of the target page, the corresponding page data is obtained from the storage system to return the page data to the terminal device for display; wherein the page data is generated and saved to the storage system after the backend system receives the page task to be published and executes the page task.
[0083] From the above description, it can be seen that the back-end system executes the page task in advance and saves the page data to the storage system. After receiving the page access request, the front-end system directly obtains the page data of the currently effective target page from the storage system and sends it to the terminal device for display, so that the page task can be executed in a decentralized manner, avoiding instantaneous pressure on the server, and the target page can take effect immediately.
[0084] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0085] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for publishing page data, It is characterized in that include: Receiving page generation information from a backend system, and acquiring page metadata from the page generation information; wherein the page metadata includes a page identifier, a storage identifier, and a page effective time, and the page identifier is a page content identifier, or a page content identifier and a page type identifier; When a page access request is received, according to the page identifier and current time information in the page access request, a currently effective target page is selected from the page metadata, including: according to the page identifier in the page access request, obtaining a data record with the same page identifier from the page metadata; according to the current time information, filtering out data records whose page effective time includes the current time information from the data records, and the page corresponding to the filtered data record is the target page; According to the storage identifier of the target page, the corresponding page data is obtained from the storage system to return the page data to the terminal device for display; wherein the page data is generated and saved to the storage system after the back-end system receives the page task to be published and executes the page task.
2. The method according to claim 1, It is characterized in that The page generation information is generated by the backend system after the execution of the page task is completed, and then written into the message queue and sent through the message queue.
3. The method according to claim 1, It is characterized in that The storage system is a Key-Value type database system, where Key is the storage identifier of the page data and Value is the page data.
4. The method according to claim 1, It is characterized in that The page task is a task corresponding to a scheduled publishing page.
5. A method for publishing page data, It is characterized in that include: Receiving a page task to be published, executing the page task to generate corresponding page data, and saving the page data to a storage system; When a page access request is received, according to the page identifier and current time information in the page access request, a currently effective target page is selected from the page metadata, including: according to the page identifier in the page access request, a data record with the same page identifier is obtained from the page metadata; according to the current time information, a data record whose page effective time includes the current time information is filtered out from the data records, and the page corresponding to the filtered data record is the target page; wherein the page metadata includes the page identifier, the storage identifier and the page effective time, and the page identifier is a page content identifier, or a page content identifier and a page type identifier; According to the storage identifier of the target page, corresponding page data is obtained from the storage system, so as to return the obtained page data to the terminal device for display.
6. A page data publishing system, It is characterized in that include: An acquisition module, used to receive page generation information from a backend system, and acquire page metadata from the page generation information; wherein the page metadata includes a page identifier, a storage identifier, and a page effective time, and the page identifier is a page content identifier, or a page content identifier and a page type identifier; The selection module is used to select the currently effective target page from the page metadata according to the page identifier and current time information in the page access request when receiving the page access request, including: obtaining data records with the same page identifier from the page metadata according to the page identifier in the page access request; filtering out data records whose page effective time includes the current time information from the data records according to the current time information, and the page corresponding to the filtered data record is the target page; A publishing module is used to obtain corresponding page data from a storage system according to the storage identifier of the target page, so as to return the page data to a terminal device for display; wherein the page data is generated and saved to the storage system after the back-end system receives a page task to be published and executes the page task.
7. A page data publishing system, It is characterized in that include: Front-end system and back-end system, among which, The backend system is used to receive the page task to be published, execute the page task to generate corresponding page data, and save the page data to the storage system; The front-end system is used to select a currently effective target page from page metadata when receiving a page access request according to a page identifier and current time information in the page access request, including: obtaining a data record with the same page identifier from the page metadata according to the page identifier in the page access request; filtering out data records whose page effective time includes the current time information from the data records according to the current time information, and the page corresponding to the filtered data record is the target page; wherein the page metadata includes the page identifier, storage identifier and page effective time, and the page identifier is a page content identifier, or a page content identifier and a page type identifier; The front-end system is further used to obtain corresponding page data from the storage system according to the storage identifier of the target page, so as to return the obtained page data to the terminal device for display.
8. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
9. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
