CN117725326A - Method, device, medium and equipment for realizing link jump - Google Patents

Method, device, medium and equipment for realizing link jump Download PDF

Info

Publication number
CN117725326A
CN117725326A CN202311664737.9A CN202311664737A CN117725326A CN 117725326 A CN117725326 A CN 117725326A CN 202311664737 A CN202311664737 A CN 202311664737A CN 117725326 A CN117725326 A CN 117725326A
Authority
CN
China
Prior art keywords
link
parameter
compression
parameters
jump
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
CN202311664737.9A
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.)
Beijing Arc Information Technology Co ltd
Original Assignee
Beijing Arc Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Arc Information Technology Co ltd filed Critical Beijing Arc Information Technology Co ltd
Priority to CN202311664737.9A priority Critical patent/CN117725326A/en
Publication of CN117725326A publication Critical patent/CN117725326A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method, a device, a medium and equipment for realizing link jump. The method comprises the following steps: acquiring a link of a page to be skipped; intercepting a parameter link part of the link, and under the condition that the parameter link part is not in a preset threshold range, compressing the parameter link part by using a compression plug-in to generate a compression link parameter; splicing the uncompressed link parameters and the compressed link parameters of the link to generate a compressed jump link, wherein the uncompressed link parameters are domain name path part parameters; and according to the compressed jump link, entering a page to be jumped, decompressing the redirection link parameters, splicing the decompressed parameter connection part with the uncompressed link parameters, and generating a link redirection current page before replacement.

Description

Method, device, medium and equipment for realizing link jump
Technical Field
The present invention relates to the field of link hopping technologies, and in particular, to a method, an apparatus, a medium, and a device for implementing link hopping.
Background
With the development of internet technology and terminal technology, various apps (Application programs) installed in terminal equipment bring good experience to users, and the jump between Application programs can be realized through deep link technology, namely, the user can jump to a certain page inside another Application program (third party Application program) by clicking one link in one Application program of the terminal equipment. In the prior art, the problem that the browser jumps or the WeChat shares the lost parameters because the project URL links are too long exists.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method, a device, a medium and equipment for realizing link skip.
According to one aspect of the present invention, there is provided a method for implementing link hopping, including:
acquiring a link of a page to be skipped;
intercepting a parameter link part of the link, and under the condition that the parameter link part is not in a preset threshold range, compressing the parameter link part by using a compression plug-in to generate a compression link parameter;
splicing the uncompressed link parameters and the compressed link parameters of the link to generate a compressed jump link, wherein the uncompressed link parameters are domain name path part parameters;
and according to the compressed jump link, entering a page to be jumped, decompressing the redirection link parameters, splicing the decompressed parameter connection part with the uncompressed link parameters, and generating a link redirection current page before replacement.
Optionally, the compression plug-in is: LZString or lzutf8.
Optionally, the method further comprises: a judging mark is added for the compression jump link, wherein the judging mark is used for judging whether the compression jump link is the compression link or not.
Optionally, decompressing the redirected linking parameter includes:
and judging whether the redirection link parameter is the compression jump link according to the judgment mark, and decompressing the compression jump link under the condition that the redirection link parameter is the compression jump link.
According to another aspect of the present invention, there is provided an implementation apparatus for link skip, including:
the acquisition module is used for acquiring links of pages to be skipped;
the compression module is used for intercepting the linked parameter link part, and compressing the parameter link part by using the compression plug-in unit under the condition that the parameter link part is not in the preset threshold range, so as to generate a compression link parameter;
the splicing module is used for splicing the uncompressed link parameters and the compressed link parameters of the link to generate a compressed jump link, wherein the uncompressed link parameters are domain name path part parameters;
and the redirection module is used for decompressing the redirection link parameters according to the compressed jump link entering the page to be jumped, splicing the decompressed parameter connection part with the uncompressed link parameters, and generating a link redirection current page before replacement.
According to a further aspect of the present invention there is provided a computer readable storage medium storing a computer program for performing the method according to any one of the above aspects of the present invention.
According to still another aspect of the present invention, there is provided an electronic device including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any of the above aspects of the present invention.
The invention provides a method for realizing link jump, which compresses the parameter link part of the link which needs to jump the software program authorization, changes the parameter link part into a short compressed link, decompresses after the page callback, analyzes the decompressed link into the original link, and then redirects the original link. The technical problem that URL parameters are lost in the jump process due to the long link problem in the prior art is effectively solved.
Drawings
Exemplary embodiments of the present invention may be more completely understood in consideration of the following drawings:
FIG. 1 is a flow chart of a method for implementing link hopping provided by an exemplary embodiment of the present invention;
FIG. 2 is a schematic diagram of an implementation apparatus for link skip according to an exemplary embodiment of the present invention;
fig. 3 is a structure of an electronic device provided in an exemplary embodiment of the present invention.
Detailed Description
Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It should be apparent that the described embodiments are only some embodiments of the present invention and not all embodiments of the present invention, and it should be understood that the present invention is not limited by the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
It will be appreciated by those of skill in the art that the terms "first," "second," etc. in embodiments of the present invention are used merely to distinguish between different steps, devices or modules, etc., and do not represent any particular technical meaning nor necessarily logical order between them.
It should also be understood that in embodiments of the present invention, "plurality" may refer to two or more, and "at least one" may refer to one, two or more.
It should also be appreciated that any component, data, or structure referred to in an embodiment of the invention may be generally understood as one or more without explicit limitation or the contrary in the context.
In addition, the term "and/or" in the present invention is merely an association relationship describing the association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. In the present invention, the character "/" generally indicates that the front and rear related objects are an or relationship.
It should also be understood that the description of the embodiments of the present invention emphasizes the differences between the embodiments, and that the same or similar features may be referred to each other, and for brevity, will not be described in detail.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the techniques, methods, and apparatus should be considered part of the specification.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations with electronic devices, such as terminal devices, computer systems, servers, etc. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with the terminal device, computer system, server, or other electronic device include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments that include any of the foregoing, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server may be implemented in a distributed cloud computing environment in which tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
Exemplary method
Fig. 1 is a flow chart of a method for implementing link skip according to an exemplary embodiment of the present invention. The embodiment may be applied to an electronic device, and as shown in fig. 1, the implementation method 100 of link skip includes the following steps:
step 101, obtaining a link of a page to be skipped;
102, intercepting a parameter link part of a link, and compressing the parameter link part by using a compression plug-in under the condition that the parameter link part is not in a preset threshold range to generate a compression link parameter;
step 103, splicing the uncompressed link parameters and the compressed link parameters of the link to generate a compressed jump link, wherein the uncompressed link parameters are domain name path part parameters;
step 104, according to the compressed jump link, the page to be jumped is entered, the redirection link parameters are decompressed, the decompressed parameter connection part and the uncompressed link parameters are spliced, and the link redirection current page before replacement is generated.
Optionally, the compression plug-in is: LZString or lzutf8.
Optionally, the method further comprises: a judging mark is added for the compression jump link, wherein the judging mark is used for judging whether the compression jump link is the compression link or not.
Optionally, decompressing the redirected linking parameter includes:
and judging whether the redirection link parameter is the compression jump link according to the judgment mark, and decompressing the compression jump link under the condition that the redirection link parameter is the compression jump link.
In particular, the method comprises the steps of,
1. obtaining a current page URL by using js method window.
2. And acquiring the parameter part of the URL link of the current page by using js method window.
3. Examples: and combining js packaging method with the lzutf8.Js library to obtain the compression and splicing of the URL domain name path part and the parameter part.
Firstly, introducing an lzutf8.Js library into a code, and then using a packaging method, combining compression function splicing links provided by the lzutf8, wherein the packaging method is exemplified as follows.
4. The URL length of the splice is reduced compared with the previous URL length, then the link is used as an authorization redirection link parameter when the WeChat authorization page is jumped, and the URL is redirected to the previous compression splice link after authorization is finished, namely, the URL enters the page again after authorization. Repeating the steps 1 and 2, taking out the previously compressed parameter part in the URL, then decompressing the previously compressed character by combining a packaging method by using a method provided by the Lzutf8.Js library, and jumping to the URL spliced after the URL is spliced.
5. And adding a method for executing the fourth packaging when entering the page, splicing the decompressed parameters if the parameters are compressed, and returning the original link parameters if the parameters are uncompressed. The above encapsulated resetUrl method is performed when the page starts to load and then the current page is redirected using the location.
6. An alternative method is supplemented, the step 1-2 is executed first, then the parameter part in the link is fetched by using location. When the authorized link is skipped, only the domain name and the URL path part are spliced, if yes, the splice is taken out, the previous page is redirected by using a location () method, and then the previous local parameter storage is cleared.
The invention provides a method for realizing link jump, which compresses the parameter link part of the link which needs to jump the software program authorization, changes the parameter link part into a short compressed link, decompresses after the page callback, analyzes the decompressed link into the original link, and then redirects the original link. The technical problem that URL parameters are lost in the jump process due to the long link problem in the prior art is effectively solved.
Exemplary apparatus
Fig. 2 is a schematic structural diagram of an implementation apparatus for link skip according to an exemplary embodiment of the present invention. As shown in fig. 2, the apparatus 200 includes:
an obtaining module 210, configured to obtain a link of a page to be skipped;
the compression module 220 is configured to intercept the parameter link portion of the link, and compress the parameter link portion by using a compression plug-in to generate a compressed link parameter when the parameter link portion is not within a preset threshold range;
the splicing module 230 is configured to splice the uncompressed link parameter and the compressed link parameter of the link to generate a compressed jump link, where the uncompressed link parameter is a domain name path part parameter;
the redirection module 240 is configured to decompress the redirection link parameters according to the compressed jump link entering the page to be jumped, and splice the decompressed parameter connection portion and the uncompressed link parameters to generate a link redirection current page before replacement.
Optionally, the compression plug-in is: LZString or lzutf8.
Optionally, the apparatus 200 further comprises: and the adding module is used for adding a judging mark for the compression jump link, wherein the judging mark is used for judging whether the compression jump link is the compression link or not.
Optionally, the decompressing the redirection link parameter in the redirection module 240 includes:
and the decompression sub-module is used for judging whether the redirection link parameter is the compression jump link according to the judgment mark, and decompressing the compression jump link under the condition that the redirection link parameter is the compression jump link.
Exemplary electronic device
Fig. 3 is a structure of an electronic device provided in an exemplary embodiment of the present invention. As shown in fig. 3, the electronic device 30 includes one or more processors 31 and memory 32.
The processor 31 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
Memory 32 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that can be executed by the processor 31 to implement the methods of the software programs of the various embodiments of the present invention described above and/or other desired functions. In one example, the electronic device may further include: an input device 33 and an output device 34, which are interconnected by a bus system and/or other forms of connection mechanisms (not shown).
In addition, the input device 33 may also include, for example, a keyboard, a mouse, and the like.
The output device 34 can output various information to the outside. The output device 34 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device that are relevant to the present invention are shown in fig. 3 for simplicity, components such as buses, input/output interfaces, etc. being omitted. In addition, the electronic device may include any other suitable components depending on the particular application.
Exemplary computer program product and computer readable storage Medium
In addition to the methods and apparatus described above, embodiments of the invention may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform steps in a method according to various embodiments of the invention described in the "exemplary methods" section of this specification.
The computer program product may write program code for performing operations of embodiments of the present invention in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present invention may also be a computer-readable storage medium, having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the steps in a method of mining history change records according to various embodiments of the present invention described in the "exemplary methods" section above in this specification.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present invention have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present invention are merely examples and not intended to be limiting, and these advantages, benefits, effects, etc. are not to be considered as essential to the various embodiments of the present invention. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, as the invention is not necessarily limited to practice with the above described specific details.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, so that the same or similar parts between the embodiments are mutually referred to. For system embodiments, the description is relatively simple as it essentially corresponds to method embodiments, and reference should be made to the description of method embodiments for relevant points.
The block diagrams of the devices, systems, apparatuses, systems according to the present invention are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, systems, apparatuses, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
The method and system of the present invention may be implemented in a number of ways. For example, the methods and systems of the present invention may be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above-described sequence of steps for the method is for illustration only, and the steps of the method of the present invention are not limited to the sequence specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present invention may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
It is also noted that in the systems, devices and methods of the present invention, components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered as equivalent aspects of the present invention. The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the invention. Thus, the present invention is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the invention to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (10)

1. A method for implementing link hopping, comprising:
acquiring a link of a page to be skipped;
intercepting the parameter link part of the link, and compressing the parameter link part by using a compression plug-in unit under the condition that the parameter link part is not in a preset threshold range to generate a compressed link parameter;
splicing the uncompressed link parameters of the link and the compressed link parameters to generate a compressed jump link, wherein the uncompressed link parameters are domain name path part parameters;
and according to the compressed jump link, entering a page to be jumped, decompressing the redirection link parameters, splicing the decompressed parameter connection part with the uncompressed link parameters, and generating a link redirection current page before replacement.
2. The method of claim 1, wherein the compression plug is: LZString or lzutf8.
3. The method as recited in claim 1, further comprising: and adding a judging mark for the compression jump link, wherein the judging mark is used for judging whether the compression jump link is the compression link or not.
4. A method according to claim 3, wherein decompressing the redirect-linking parameter comprises:
judging whether the redirection link parameter is a compression jump link according to the judgment mark, and decompressing the compression jump link under the condition that the redirection link parameter is the compression jump link.
5. A device for implementing link hopping, comprising:
the acquisition module is used for acquiring links of pages to be skipped;
the compression module is used for intercepting the parameter link part of the link, and compressing the parameter link part by using a compression plug-in unit under the condition that the parameter link part is not in a preset threshold range to generate a compression link parameter;
the splicing module is used for splicing the uncompressed link parameters of the links and the compressed link parameters to generate compressed jump links, wherein the uncompressed link parameters are domain name path part parameters;
and the redirection module is used for decompressing the redirection link parameters according to the compressed jump link entering the page to be jumped, splicing the decompressed parameter connection part with the uncompressed link parameters, and generating a link redirection current page before replacement.
6. The apparatus of claim 5, wherein the compression insert is: LZString or lzutf8.
7. The apparatus as recited in claim 5, further comprising: and the adding module is used for adding a judging identifier for the compression jump link, wherein the judging identifier is used for judging whether the compression jump link is the compression link or not.
8. The apparatus of claim 7, wherein decompressing the redirect link parameters in the redirect module comprises:
and the decompression sub-module is used for judging whether the redirection link parameter is a compression jump link according to the judgment mark, and decompressing the compression jump link under the condition that the redirection link parameter is the compression jump link.
9. A computer readable storage medium, characterized in that the storage medium stores a computer program for executing the method of any of the preceding claims 1-4.
10. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any of the preceding claims 1-4.
CN202311664737.9A 2023-12-06 2023-12-06 Method, device, medium and equipment for realizing link jump Pending CN117725326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311664737.9A CN117725326A (en) 2023-12-06 2023-12-06 Method, device, medium and equipment for realizing link jump

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311664737.9A CN117725326A (en) 2023-12-06 2023-12-06 Method, device, medium and equipment for realizing link jump

Publications (1)

Publication Number Publication Date
CN117725326A true CN117725326A (en) 2024-03-19

Family

ID=90204467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311664737.9A Pending CN117725326A (en) 2023-12-06 2023-12-06 Method, device, medium and equipment for realizing link jump

Country Status (1)

Country Link
CN (1) CN117725326A (en)

Similar Documents

Publication Publication Date Title
US9529873B2 (en) Enhancing performance of extract, transform, and load (ETL) jobs
US20110219357A1 (en) Compressing source code written in a scripting language
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
CN111314388B (en) Method and apparatus for detecting SQL injection
CN110457656A (en) A kind of document display method and apparatus
CN114895908B (en) Web application expression-based implementation method, system, equipment and storage medium
WO2023092580A1 (en) Page display method and apparatus, storage medium, and electronic device
CN115048623A (en) Method, computing device and storage medium for encrypting code
CN113268453A (en) Log information compression storage method and device
CN113343066A (en) Page processing method and device, electronic equipment and storage medium
CN117725326A (en) Method, device, medium and equipment for realizing link jump
CN111291288A (en) Webpage link extraction method and system
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN112149392A (en) Rich text editing method and device
CN115080154A (en) Page display method and device, storage medium and electronic equipment
CN110659062B (en) Front-end scaffold configuration method and device, readable storage medium and electronic equipment
CN110765003B (en) Code detection method, device and equipment and storage medium
CN116431941A (en) Method, device and medium for realizing link authorization jump
CN116501335B (en) Deployment method, device and medium of one-stop type station building system
CN112783615A (en) Method and device for cleaning data processing task
CN115334161B (en) Access request processing method and device, storage medium and electronic equipment
CN117931117A (en) Automatic audio playing method, device and medium for WeChat browser
CN112925573B (en) Method, device, equipment and computer readable medium for loading web page
US11966597B1 (en) Multi-domain configurable data compressor/de-compressor
CN112214250B (en) Application program component loading method and device

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