Disclosure of Invention
The embodiment of the application provides a method, a device, computer equipment and a readable storage medium for page carousel, which at least solve the problem of low carousel page updating efficiency caused by a method for realizing carousel page updating by establishing a new carousel component in the related technology.
In a first aspect, an embodiment of the present application provides a method for page carousel, where the method includes:
acquiring a plurality of to-be-carousel pages, establishing a first carousel sequence, and adding the to-be-carousel pages to different carousel groups in the first carousel sequence according to a first matching instruction under the condition that the first matching instruction is acquired;
in the first carousel sequence, parameter configuration is carried out on the page to be carousel according to the first matching instruction;
and acquiring a carousel group selection instruction, determining a carousel group to be played according to the carousel group selection instruction in the first carousel sequence, and analyzing and carousel pages to be played in the carousel group to be played.
In some embodiments, after the parsing and carousel of the to-be-played carousel pages in the to-be-played carousel group, the method further includes:
establishing a second carousel sequence, acquiring a second matching instruction, and adding the page to be carousel to different carousel groups in the second carousel sequence according to the second matching instruction.
In some embodiments, the parsing and carousel of the to-be-carousel pages in the to-be-played carousel group includes:
dividing the to-be-carousel pages into default carousel pages and conditional carousel pages according to the parameter configuration, and analyzing the default carousel pages;
and under the condition that a default carousel instruction is acquired, carousel is carried out on the default carousel page according to the parameter configuration of the default carousel page, wherein the default carousel instruction meets the parameter configuration condition of the default carousel page.
In some of these embodiments, after the carousel of the default carousel page, the method further comprises:
acquiring a conditional carousel instruction, and carousel the conditional carousel page according to the parameter configuration of the conditional carousel page, wherein the conditional carousel instruction meets the parameter configuration condition of the conditional carousel page.
In some of these embodiments, after said carousel of said conditional carousel pages, the method further comprises one of:
continuing to perform the carousel of the default carousel page after the carousel of the conditional carousel page is finished;
and acquiring a carousel instruction, and performing carousel according to the carousel instruction, wherein the carousel instruction comprises the default carousel instruction and the conditional carousel instruction.
In some embodiments, after the parsing and carousel of the to-be-played carousel pages in the to-be-played carousel group, the method further includes:
and under the condition that a pause carousel instruction is received, pausing the carousel.
In some of these embodiments, after the suspending the carousel, the method further comprises:
and resuming the carousel when the duration of the pause is longer than a preset time period and no operation instruction is acquired in the pause period.
In a second aspect, an embodiment of the present application provides a device for page carousel, where the device includes: the system comprises a carousel group configuration module, a page configuration module and an analysis module:
the carousel group configuration module is used for acquiring a plurality of to-be-carousel pages, establishing a first carousel sequence, and adding the to-be-carousel pages to different carousel groups in the first carousel sequence according to a first matching instruction under the condition that the first matching instruction is acquired;
the page configuration module is used for carrying out parameter configuration on the page to be carousel according to the first matching instruction in the first carousel sequence;
the analyzing module is configured to obtain a carousel group selection instruction, determine a carousel group to be played according to the carousel group selection instruction in the first carousel sequence, and analyze and carousel a carousel page to be played in the carousel group.
In some embodiments, the carousel group configuration module is further configured to establish a second carousel sequence, obtain a second matching instruction, and add the page to be carousel to different carousel groups in the second carousel sequence according to the second matching instruction.
In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements any of the methods described above when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which when executed by a processor performs any of the methods described above.
Compared with the related art, the method for page carousel provided by the embodiment of the application has the advantages that the plurality of pages to be carousel are obtained, the first carousel sequence is established, under the condition that the first matching instruction is obtained, the pages to be carousel are added to different carousel groups in the first carousel sequence according to the first matching instruction, in the first carousel sequence, the parameters of the pages to be carousel are configured according to the first matching instruction, the carousel group selection instruction is obtained, in the first carousel sequence, the carousel group to be played is determined according to the carousel group selection instruction, the pages to be carousel in the carousel group to be played are analyzed and carousel, the problem that the carousel page update efficiency is low due to the method for realizing carousel page update by establishing a new carousel component in the related art is solved, the repeated use of the pages to be carousel is realized, the code repetition rate is reduced, and the record page update efficiency is improved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by a person of ordinary skill in the art based on the embodiments provided by the present application without making any inventive effort, are intended to fall within the scope of the present application.
It is apparent that the drawings in the following description are only some examples or embodiments of the present application, and it is possible for those of ordinary skill in the art to apply the present application to other similar situations according to these drawings without inventive effort. Moreover, it should be appreciated that while such a development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as having the benefit of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by those of ordinary skill in the art that the described embodiments of the application can be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," and similar referents in the context of the application are not to be construed as limiting the quantity, but rather as singular or plural. The terms "comprising," "including," "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in connection with the present application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The terms "first," "second," "third," and the like, as used herein, are merely distinguishing between similar objects and not representing a particular ordering of objects.
The method for page carousel provided by the application can be applied to an application environment shown in fig. 1, and fig. 1 is a schematic diagram of the application environment of the method for page carousel according to the embodiment of the application, as shown in fig. 1. The user sets a page carousel in the server 104 through the terminal 102, the terminal 102 is in communication connection with the server 104, the user can set a plurality of to-be-carousel pages through the terminal 102, the server 104 establishes a first carousel sequence according to a user instruction, and adds the to-be-carousel pages to different carousel groups in the first carousel sequence according to a first matching instruction of the user. The user sets parameters of the page in the first matching instruction through the terminal 102, the server 104 sets the to-be-carousel page according to the parameter configuration, and under the condition that the terminal obtains the carousel group selection instruction of the user, the to-be-carousel group is determined in the first carousel sequence, and the to-be-carousel page in the to-be-carousel group is analyzed and carousel. The terminal may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
The embodiment provides a method for page carousel, fig. 2 is a flowchart of a method for page carousel according to an embodiment of the present application, as shown in fig. 2, the method includes the following steps:
step S201, a plurality of to-be-carousel pages are obtained, a first carousel sequence is established, and under the condition that a first matching instruction is obtained, the to-be-carousel pages are added to different carousel groups in the first carousel sequence according to the first matching instruction.
The carousel pages are pages which can be played in a carousel mode, for example, after one page is displayed for a period of time, the pages are automatically replaced by another page, and the number of pages for carousel and the time for displaying each page can be set according to the requirements of users. The content of the carousel page may be a picture, an animation, a video, or the like. The first carousel sequence in this embodiment includes a plurality of carousel groups, the carousel groups in the first carousel sequence only include name information of the carousel groups, the first matching instruction is an instruction for matching between the carousel groups and the to-be-carousel pages by the user, and according to the first matching instruction, it can be determined which to include the to-be-carousel pages in one carousel group. In this embodiment, the same to-be-carousel page may be repeatedly matched to different carousel groups.
Step S202, in the first carousel sequence, parameter configuration is performed on the page to be carousel according to the first matching instruction.
The parameter configuration comprises configuration information such as the carousel sequence of a plurality of carousel pages to be carousel, the carousel time length of a single carousel page to be carousel, page types and the like in one carousel group. The carousel duration of a single carousel page refers to the time period for displaying the page under the condition that the carousel group performs carousel; the page type comprises an internal application page and an external link page, wherein the internal application page is a user-defined page, the whole page is required to be submitted in the process of submitting the internal application page by a user, the external link page is a third-party software page required to be set by the user, and the user only needs to submit the link of the page in the process of submitting the external link page. The types of the to-be-carousel pages are distinguished, so that the analysis is conducted on different page types, and the carousel pages can be displayed efficiently.
Step S203, a carousel group selection instruction is obtained, in the first carousel sequence, a carousel group to be played is determined according to the carousel group selection instruction, and the carousel pages to be played in the carousel group to be played are analyzed and carousel.
The carousel group selection instruction is issued by a user, and the server can determine which carousel group in the first carousel sequence is carousel according to the instruction. The page carousel in this embodiment is mainly implemented based on an iframe, which is an HTML tag, and an iframe element can create an inline frame containing another document. The server analyzes the to-be-carousel pages according to the page types of the to-be-carousel pages, the analyzed to-be-carousel pages are placed into an iframe component, carousel is carried out according to carousel sequences and carousel time lengths, carousel starting instructions are obtained after the server is connected with websockets, and page carousel is started under the condition that the carousel starting instructions meet parameter configuration conditions of the to-be-carousel pages. websocket is a protocol for full duplex communication over a single transmission control protocol (Transmission Control Protocol, abbreviated TCP) connection for polling between a terminal and a server.
In the steps S201 to S203, the first carousel sequence is established, and the acquired to-be-carousel pages are matched with the carousel groups in the first carousel sequence, so that the to-be-carousel pages can be reused, dynamic adjustment of the carousel sequence and the carousel time length of the to-be-carousel pages can be achieved by adjusting the parameter configuration of the to-be-carousel pages, and by the method of page carousel in the embodiment, a user does not need to write all to-be-carousel page information in all carousel groups under the condition that a plurality of carousel groups are needed, so that the problem of low carousel page update efficiency caused by the method of realizing carousel page update by establishing new carousel components in the related art is solved, the repeated use of the to-be-carousel pages is realized, the code repetition rate is reduced, and the update efficiency of recorded carousel pages is improved.
In some embodiments, after parsing and carousel the to-be-carousel pages in the to-be-played carousel group, the method for carousel pages further includes: establishing a second carousel sequence, acquiring a second matching instruction, and adding the page to be carousel to different carousel groups in the second carousel sequence according to the second matching instruction. The second carousel sequence may include name information of a plurality of carousel groups, and when a user needs to add a new carousel group, a second matching instruction may be issued, the server may add a selected to-be-carousel page for the carousel group in the second carousel sequence according to the second matching instruction, the to-be-carousel page may be an existing to-be-carousel page in the server, and the user may implement a page carousel by only establishing a matching relationship between the selected to-be-carousel page and the carousel group, without re-writing data parameter information of the carousel group and the to-be-carousel page, thereby avoiding repeated work caused by code redundancy and improving updating efficiency of the page carousel.
In some of these embodiments, fig. 3 is a flowchart of a method of page carousel and parsing according to an embodiment of the present application, as shown in fig. 3, the method comprising the steps of:
step S301, dividing the to-be-carousel pages into default carousel pages and conditional carousel pages according to parameter configuration, analyzing the default carousel pages, and eliminating the conditional carousel pages.
The parameter configuration further comprises a triggering mode of the to-be-carousel pages, the triggering mode comprises default triggering and conditional triggering, and the server determines that the to-be-carousel pages are default carousel pages or conditional carousel pages according to the triggering mode and determines that the carousel mode is default carousel or conditional carousel. The default carousel page refers to that carousel is sequentially performed on the pages to be carousel in the carousel group according to the carousel sequence and the carousel duration in parameter configuration under the condition that other triggering conditions are not available; the conditional carousel page refers to that the page cannot appear in a carousel queue of a carousel group under the condition of normal carousel, and the conditional carousel page is displayed immediately after conditional trigger information in websocket is received.
Step S302, under the condition that a default carousel instruction is obtained, carousel is carried out on the default carousel page according to the parameter configuration of the default carousel page, wherein the default carousel instruction meets the parameter configuration condition of the default carousel page.
Through the step S301 and the step S302, the to-be-carousel pages are classified into the default carousel pages and the conditional carousel pages, and the user can customize the carousel types of the pages, and under the condition of normal carousel, only the to-be-carousel pages with higher attention are played, so that the page carousel is more various and flexible.
In some embodiments, after the default carousel page is carousel, the method of carousel the page further includes: acquiring a conditional carousel instruction, and carousel the conditional carousel page according to the parameter configuration of the conditional carousel page, wherein the conditional carousel page refers to a carousel queue in which the page cannot appear in a carousel group under the condition of normal carousel, and the conditional carousel page is immediately displayed after receiving the condition triggering information in websocket, wherein the conditional carousel instruction meets the parameter configuration condition of the conditional carousel page. The websocket enables data exchange between the terminal and the server to be simpler, and the websocket allows the server to actively push data to the terminal. In the application program interface of websocket, the terminal and the server only need to complete one handshake, and can directly establish persistent connection between the terminal and the server and perform bidirectional data transmission. Through the page carousel method in the embodiment, a user can break the original page carousel state by issuing the conditional carousel instruction, and the conditional carousel page starts carousel, so that the page carousel method can be applied to scenes such as alarm or timing tasks, and the like, and the page carousel mode is more flexible and diversified.
In some embodiments, the rotation of the default rotation page continues after the rotation of the conditional rotation page ends. Judging whether the conditional carousel is finished according to the carousel time length of the conditional carousel page, for example, if the carousel time length of a certain conditional carousel page is 30s, and if the carousel time length of the conditional carousel page does not reach 30s, judging that the conditional carousel is not finished, and continuing to carousel the conditional carousel page; and under the condition that the time length of the conditional carousel page carousel reaches 30s, judging that the conditional carousel is finished, continuing to carousel a default carousel page before the conditional carousel, for example, a carousel group comprises 5 carousel pages with numbers 1 to 5 respectively, and if the conditional carousel breaks the carousel of the default carousel page 2 in the carousel group, continuing to carousel the default carousel page 2 after the carousel of the conditional carousel page is finished.
In some embodiments, in the process of conditional carousel, if a carousel instruction is acquired, carousel is performed according to the carousel instruction, where the carousel instruction includes the default carousel instruction and the conditional carousel instruction. And under the condition that the carousel page is not carousel ended, a carousel instruction can be acquired, and at the moment, the conditional carousel is interrupted, and the page carousel is performed according to the carousel instruction.
In this embodiment, by regularly setting the conditional carousel process, the page carousel can be switched between the default carousel and the conditional carousel, thereby further improving the flexibility of the page carousel.
In some embodiments, after parsing and carousel the to-be-carousel pages in the to-be-played carousel group, the method for carousel the pages further includes: and under the condition that a pause carousel command is received, pausing the carousel. The user can issue a pause carousel command in the carousel process of the page, pause the carousel process of the page, and carry out modification or update operation.
In some embodiments, after pausing the carousel, the method of page carousel further comprises: and resuming the carousel when the duration of the pause is longer than a preset time period and no operation instruction is acquired during the pause. The preset time period is set by the user and can be 30s, 1min or other time values, the preset time period is a time threshold for recovering the carousel of the carousel group, and in the preset time period, under the condition that any operation instruction is not acquired, the user is considered to be away, the carousel before the pause is recovered, and the problem that the page carousel is paused due to misoperation of the user is avoided by setting the preset time period.
It should be noted that the steps illustrated in the above-described flow or flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment also provides a device for page carousel, which is used for implementing the above embodiment and the preferred embodiment, and is not described in detail. As used below, the terms "module," "unit," "sub-unit," and the like may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
In some embodiments, fig. 4 is a block diagram of a device for page carousel according to an embodiment of the present application, and as shown in fig. 4, the device includes a carousel group configuration module 41, a page configuration module 42, and a parsing module 43:
the carousel group configuration module 41 is configured to obtain a plurality of to-be-carousel pages, establish a first carousel sequence, and add the to-be-carousel pages to different carousel groups in the first carousel sequence according to the first matching instruction when the first matching instruction is obtained, wherein the plurality of carousel groups in the first carousel sequence have unique authentication identifiers (Identity document, abbreviated as IDs); the page configuration module 42 is configured to perform parameter configuration on the to-be-carousel page according to the first matching instruction in the first carousel sequence; the parsing module 43 is configured to obtain a carousel group selection instruction, determine a carousel group to be played according to the carousel group selection instruction in the first carousel sequence, and parse and carousel a carousel page to be played in the carousel group.
The carousel group configuration module 41 may configure different carousel groups in the first carousel sequence according to different user requirements, the page configuration module 42 may perform parameter configuration on a to-be-carousel page in the carousel group, and the parsing module 43 may obtain carousel data corresponding to the carousel group according to the obtained ID of the carousel group, and parse the carousel data according to a certain rule. The device for the page carousel in the embodiment realizes the configuration of a plurality of carousel groups of single application by simply and rapidly configuring the carousel groups, reduces repeated writing codes of developers, reduces useless codes, improves the code multiplexing rate, solves the problem of low carousel page updating efficiency caused by a method for realizing carousel page updating by establishing a new carousel component in the related technology, reflects the diversity and flexibility of the page carousel, and enables users to dynamically configure and adjust carousel pages according to needs.
In some embodiments, the carousel group configuration module 41 is further configured to establish a second carousel sequence, obtain a second matching instruction, and add the page to be carousel to different carousel groups in the second carousel sequence according to the second matching instruction. Under the condition that a user needs to update the carousel pages, the page carousel can be realized by only establishing a matching relation between the selected carousel pages to be carousel and the carousel group, and the carousel group and the data parameter information of the carousel pages to be carousel do not need to be rewritten, so that repeated work caused by code redundancy is avoided, and the updating efficiency of the page carousel is improved.
In some embodiments, the apparatus for page carousel further includes a carousel container configuration module, where the carousel container configuration module is configured to store the first carousel sequence or the second carousel sequence, and a user may perform parameter configuration on a carousel group through the carousel container configuration module according to different service requirements and application situations. The carousel container configuration module can configure an ID for a carousel group so as to facilitate the carousel container to acquire carousel data.
The above-described respective modules may be functional modules or program modules, and may be implemented by software or hardware. For modules implemented in hardware, the various modules described above may be located in the same processor; or the above modules may be located in different processors in any combination.
In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of page carousel. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
In one embodiment, fig. 5 is a schematic diagram of an internal structure of a computer device according to an embodiment of the present application, and as shown in fig. 5, a computer device is provided, which may be a server, and an internal structure diagram thereof may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of page carousel.
It will be appreciated by those skilled in the art that the structure shown in FIG. 5 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps in the method for page carousel provided in the above embodiments when the computer program is executed.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps in the method of page carousel provided by the above embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.