CN114745190A - Page processing method and device, storage medium and electronic equipment - Google Patents

Page processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114745190A
CN114745190A CN202210427260.1A CN202210427260A CN114745190A CN 114745190 A CN114745190 A CN 114745190A CN 202210427260 A CN202210427260 A CN 202210427260A CN 114745190 A CN114745190 A CN 114745190A
Authority
CN
China
Prior art keywords
encryption
page
field
parameter
encrypted
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.)
Granted
Application number
CN202210427260.1A
Other languages
Chinese (zh)
Other versions
CN114745190B (en
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.)
Yidu Cloud Beijing Technology Co Ltd
Original Assignee
Yidu Cloud Beijing 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 Yidu Cloud Beijing Technology Co Ltd filed Critical Yidu Cloud Beijing Technology Co Ltd
Priority to CN202210427260.1A priority Critical patent/CN114745190B/en
Publication of CN114745190A publication Critical patent/CN114745190A/en
Application granted granted Critical
Publication of CN114745190B publication Critical patent/CN114745190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Abstract

The disclosure provides a page processing method, a page processing device, a storage medium and an electronic device, and relates to the technical field of computers. The page processing method comprises the following steps: when a target page is loaded, if a page routing link address is determined to need encryption through a first hook function of a routing manager, the encryption state of the page routing link address is obtained; in the first hook function, redirecting field parameters of an encrypted field in the page routing link address to encrypted parameters corresponding to the encrypted field according to the encryption state; and if the encryption parameter is determined to need decryption, decrypting the encryption parameter in a second hook function of the routing manager to obtain a decryption parameter, and processing the target page according to the decryption parameter. According to the technical scheme in the embodiment of the disclosure, the times of encryption and decryption operations are reduced, and the processing efficiency of the back-end server can be improved.

Description

Page processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a page processing method, a page processing apparatus, a computer-readable storage medium, and an electronic device.
Background
In order to ensure security, when a page is loaded and accessed, page links need to be encrypted, and then page rendering is performed.
In the related art, the encryption process may be performed using a backend interface. The encryption method comprises the steps of encrypting data, transmitting the encrypted data to an interface for decryption, wherein the interface is required for processing as long as the encrypted data is encrypted. Specifically, decryption is required to be performed when a link is encrypted once and a page is accessed, decryption of an interface is also required to be performed when the page is loaded, jumped and refreshed, and the front end needs to wait for a request result of the interface to acquire data.
In the above manner, when the interface is used for encryption processing, since all information needs to be encrypted and decrypted by using the backend interface, the flexibility is poor, the processing pressure of the backend interface is increased, the processing efficiency is reduced, and the original logic of the code may be affected, thereby affecting the display of the page.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a page processing method and apparatus, a computer-readable storage medium, and an electronic device, so as to overcome, at least to some extent, the problem of low encryption efficiency in the related art.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to an aspect of the present disclosure, there is provided a page processing method, including: when a target page is loaded, if a page routing link address is determined to need encryption through a first hook function of a routing manager, the encryption state of the page routing link address is obtained; in the first hook function, redirecting field parameters of an encrypted field in the page routing link address to encrypted parameters corresponding to the encrypted field according to the encryption state; and if the encryption parameter is determined to need decryption, decrypting the encryption parameter in a second hook function of the routing manager to obtain a decryption parameter, and processing the target page according to the decryption parameter.
In an exemplary embodiment of the disclosure, the determining, by the first hook function of the routing manager, that the page routing link address requires encryption includes: in the first hook function, if it is determined that the return information of the identification information of the page routing link address is first information, it is determined that the page routing link address needs to be encrypted.
In an exemplary embodiment of the present disclosure, the obtaining an encryption status of the page routing link address includes: if the encrypted field exists in the page routing link address and the encrypted field can be decrypted successfully, determining that the page routing link address is the encrypted field; and if the encrypted field does not exist in the page routing link address or the encrypted field cannot be decrypted successfully, determining that the page routing link address is the unencrypted field.
In an exemplary embodiment of the present disclosure, the redirecting a field parameter of an encrypted field in the page routing link address to an encryption parameter corresponding to the encrypted field according to the encryption status includes: if the encryption state is the encrypted field, determining the field parameter of the encrypted field as the encryption parameter; if the encryption state is a non-encryption field, encrypting the field parameters of the encryption field in the first hook function according to the encryption attribute information to obtain encryption parameters, and replacing the field parameters with the encryption parameters.
In an exemplary embodiment of the disclosure, the encrypting, in the first hook function, the field parameter of the encrypted field according to the encryption attribute information to obtain an encryption parameter includes: and encrypting the field parameters of the encrypted field according to the encryption opportunity and the encryption algorithm in the encryption attribute information to obtain the encryption parameters.
In an exemplary embodiment of the present disclosure, the encryption timing includes an encryption start timing and an encryption end timing.
In an exemplary embodiment of the present disclosure, the method further comprises: if the target page is a single page, keeping the display information of the target page fixed.
According to an aspect of the present disclosure, there is provided a page processing apparatus including: the state determining module is used for acquiring the encryption state of the page routing link address if the page routing link address is determined to be required to be encrypted through a first hook function of the routing manager when a target page is loaded; the encryption module is used for redirecting field parameters of an encryption field in the page routing link address to encryption parameters corresponding to the encryption field according to the encryption state in the first hook function; and the decryption module is used for decrypting the encryption parameter in a second hook function of the routing manager to obtain a decryption parameter if the encryption parameter is determined to be required to be decrypted, and processing the target page according to the decryption parameter.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the page processing method of any one of the above.
According to an aspect of the present disclosure, there is provided an electronic device including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above page processing methods via execution of the executable instructions.
The page processing method, the page processing device, the computer-readable storage medium and the electronic device provided in the embodiments of the present disclosure implement link encryption by a first hook function of a routing manager, and perform link decryption by a second hook function of the routing manager. On one hand, encryption and decryption judgment, encryption link and decryption link are carried out only through the first hook function and the second hook function, the original logic of the code is not required to be modified, operation steps are reduced, and the influence on the page is avoided. On the other hand, the page routing link address is encrypted and decrypted through the first hook function and the second hook function of the routing manager, the function of a back-end server can be realized through the front end, the times of encryption and decryption operations are reduced, the processing pressure of the back-end server is reduced, and the processing efficiency of the back-end server can be improved. On the other hand, the encryption and decryption are carried out in the first hook function and the second hook function, so that the problem that all information can only be encrypted and decrypted simultaneously can be avoided, the information amount of encryption and decryption is reduced, and the flexibility of encryption and decryption is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is apparent that the drawings in the following description are only some embodiments of the present disclosure, and that other drawings can be obtained from those drawings without inventive effort for a person skilled in the art.
Fig. 1 schematically shows a system architecture diagram for implementing a page processing method according to an embodiment of the present disclosure.
Fig. 2 schematically illustrates a schematic diagram of a page processing method in an embodiment of the present disclosure.
Fig. 3 schematically illustrates a flow chart for determining an encryption status in an embodiment of the present disclosure.
Fig. 4 schematically illustrates a flow chart for determining an encryption parameter in an embodiment of the present disclosure.
Fig. 5 schematically illustrates a specific schematic diagram of processing a link address in the embodiment of the present disclosure.
Fig. 6 schematically shows a structural diagram of a routing manager plug-in the embodiment of the present disclosure.
Fig. 7 schematically shows a block diagram of a page processing apparatus in an embodiment of the present disclosure.
Fig. 8 schematically illustrates a block diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The embodiment of the disclosure provides a page processing method. Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present disclosure may be applied.
As shown in fig. 1, system architecture 100 may include a client 101, a network 102, and a server 103. The client can be an intelligent terminal such as a smart phone, a computer, a tablet personal computer smart sound box and the like, and access can be performed only through the link. Network 102 serves as a medium for providing communication links between clients 101 and servers 103. Network 102 may include various types of connections, such as wired communication links, wireless communication links, and so forth, and in embodiments of the disclosure, network 102 between clients 101 and server 103 may be wired communication links, such as may be provided by serial connection lines, or wireless communication links, such as may be provided by a wireless network. The server 103 may be a server with a computing function or a client, for example, a terminal device with a computing function such as a portable computer, a desktop computer, a smart phone, and the like, for processing data or links and the like sent by the client.
In the embodiment of the present disclosure, the client 101 obtains a page routing link address, encrypts the page routing link address in a first hook function of a routing manager based on a routing manager plug-in installed on the client to obtain an encryption parameter, and redirects a field parameter of an encryption field in the page routing link address according to the encryption parameter. And further, sending the redirected page routing link address to a server to acquire data corresponding to the page routing link address, and returning the data to the client. And decrypting the encryption parameter in the page routing link address in a second hook function of the routing manager to obtain a decryption parameter, loading the target page according to the decryption parameter and rendering the target page.
It should be noted that the page processing method provided by the embodiment of the present disclosure may be completely executed by the routing manager plug-in, and since the routing manager plug-in may be installed in the client, the page processing method provided by the embodiment of the present disclosure may also be considered to be executed by the client.
Based on the system architecture, the embodiment of the present disclosure provides a page processing method, which is applied to a routing manager plug-in installed on a client, and is used for implementing page processing through a front-end interface provided by the routing manager plug-in. Referring to fig. 2, the page processing method includes steps S210 to S230, which are described in detail as follows:
in step S210, when the target page is loaded, if it is determined that the page routing link address needs to be encrypted through the first hook function of the routing manager, the encryption state of the page routing link address is obtained.
In the embodiment of the present disclosure, the target page refers to a browser page to be loaded. The route manager may be various types of route managers, such as vue-router. The routing manager is applicable to front-end generic frameworks. The front-end generic framework may be a progressive framework for building a user interface, which may be the vue framework when the routing manager is vue-router. The embodiment of the present disclosure may provide a route manager plug-in, which may be applied to all general scenarios that use vue-router front-end plug-ins, that is, scenarios that use vue framework and vue-router routing plug-ins and require encryption of page routing link addresses, and may access the route manager plug-in. The page routing link address refers to a routing link address url (uniform Resource locator) of a website page.
When the route is jumped, authority judgment or other operations need to be executed, so that a hook function of the route manager needs to be used. The hook function is mainly a function defined by performing special processing when a route is changed. The routing manager may include a plurality of hook functions therein, and for the routing manager in the embodiment of the present disclosure, the routing manager will be described by taking an example in which the plurality of hook functions includes a first hook function and a second hook function. The first hook function may be a before arch function and the second hook function may be an after arch function. The first hook function, before jump, may be executed, once for each route change. The second hook function, afterarch, may be executed after the jump. The first hook function and the second hook function execute encryption and decryption processing respectively before entering the corresponding page and at the time when the initialization page is not rendered.
Based on this, after the first hooking function is determined, it may be determined whether the page routing link address needs to be encrypted in the first hooking function, and processing may be performed according to the determination result. And if the judgment result is that the page routing link address needs to be encrypted, continuously acquiring the encryption state of the page routing link address so as to execute subsequent operation. If the judgment result is that the page routing link address does not need to be encrypted, the whole process is ended. Specifically, whether the page routing link address needs to be encrypted may be determined according to return information of the identification information included in the page routing link address. The identification information may be rule/single. The return information refers to a return value of the identification information for the configuration function. The configuration function may be, for example, a close function.
For example, the configuration may be performed in the first hook function by a function close method, and if the close method is configured, if the page routing link address URL has the identification information "rule/single", it may be further determined whether the page routing link address needs to be encrypted according to the return information of the identification information. If the page routing link address has the identification information and the returned information is the first information, the page routing link address needs to be encrypted. If the page routing link address has the identification information and the returned information is the second information, the page routing link address does not need to be encrypted. The first information may be a flash, and the second information may be a true. Specifically, if the return information of if (window. location. href. entities ("rule/single") is a flash), it indicates that encryption is not to be turned off, i.e., it is determined that encryption is required.
Further, if the page routing link address is determined to need to be encrypted, the encryption state of the page routing link address is obtained to determine whether the page routing link address can be encrypted. The encryption status may be both encrypted and non-encrypted fields. The encryption state of the page routing link address can be determined according to the encryption field in the page routing link address and the decryption state of the encryption field. The encrypted field indicates that the page routing link address has been encrypted, and the unencrypted field indicates that the page routing link address has not been encrypted. The decryption state is used for describing whether the encrypted field can be decrypted successfully or not, and specifically may include decryption success and decryption failure. The decryption state here may be determined according to the result of decryption of the encrypted field. The decryption method for obtaining the decryption result is used to determine whether the encryption field can be successfully encrypted, and the decryption method may be a default decryption method and may be the same as or different from the decryption method executed in the second hook function, and is not limited herein. On the basis, the encrypted field in the page routing link address can be decrypted once so as to judge whether the decryption can be successful or not according to the decryption result. If the decryption result is the same as the encryption field, the decryption success of the encryption field in the page routing link address is indicated. If the decryption result is different from the encryption field, the decryption failure of the encryption field in the page routing link address is indicated.
Fig. 3 schematically shows a flow chart for determining the encryption status, and referring to fig. 3, the determination of the encryption status mainly comprises the following steps:
in step S310, it is determined whether there is an encrypted field in the page routing link address; if yes, go to step S320; if not, go to step S340.
In step S320, determining whether the encrypted field can be decrypted successfully; if yes, go to step S330; if not, go to step S340.
In step S330, the encryption status of the page routing link address is determined to be an encrypted field.
In step S340, the encryption status of the page routing link address is determined to be an unencrypted field.
In the embodiment of the disclosure, if the encrypted field exists in the page routing link address and the encrypted field can be decrypted successfully, the page routing link address can be determined to be the encrypted field. That is, the page routing link address may be considered to be an encrypted field only if the conditions of the presence of the encrypted field and the success of decryption are both satisfied. If the encrypted field does not exist in the page routing link address or the decryption of the encrypted field fails, the page routing link address can be determined to be the unencrypted field. That is, the page routing link address may be considered as an unencrypted field, if the encrypted field does not exist in the page routing link address, or if the encrypted field does exist in the page routing link address but the encrypted field cannot be decrypted successfully.
Next, with continuing reference to fig. 2, in step S220, in the first hook function, a field parameter of an encrypted field in the page routing link address is redirected to an encrypted parameter corresponding to the encrypted field according to the encryption status.
In the embodiment of the present disclosure, the field parameter of the encrypted field refers to a current parameter of the encrypted field, that is, a parameter value before encryption using the encryption algorithm in the first hook function. The field parameter may be an encrypted parameter or a non-encrypted parameter, and may be determined according to an encryption state. Specifically, if the encryption status of the page routing link address is an encrypted field, the field parameter is an encrypted parameter. And if the encryption state of the page routing link address is an unencrypted field, the field parameter is an unencrypted parameter. The redirected encryption parameter refers to a parameter value after encrypting the field parameter. Since the encryption status can be divided into an encrypted field and an unencrypted field, the encryption parameter can be determined according to the encrypted field existing in advance, or according to the encryption timing in the first hook function and the encryption process composed of the encryption algorithm. It should be noted that, for the non-encrypted field, encryption can be continued; for encrypted fields, no further encryption is required.
Fig. 4 schematically shows a flow chart for determining encryption parameters, and referring to fig. 4, mainly includes the following steps:
in step S410, if the encryption status is an encrypted field, determining a field parameter of the encrypted field as the encryption parameter;
in step S420, if the encrypted state is an unencrypted field, encrypting the field parameter according to the encryption attribute information in the first hook function to obtain an encrypted parameter, and redirecting the field parameter of the page routing link address as the encrypted parameter.
In the embodiment of the present disclosure, if the encryption status is an encrypted field, the field parameter in the page routing link address does not need to be encrypted again, so the encryption parameter may be the same as the field parameter in this case, that is, the field parameter in the page routing link address may be kept unchanged.
If the encryption state is the non-encryption field, the encryption attribute information can be obtained in the first hook function, and the field parameter of the encryption field in the page routing link address is encrypted through the encryption attribute information to obtain the corresponding encryption parameter. The encryption attribute information may be any information capable of describing an encryption situation, and the encryption attribute information may specifically include an encryption occasion and an encryption algorithm, and may include other types of information in addition. The encryption timing is used to specify the timing at which encryption is required, for example, to specify at which page encryption is to be performed, and when encryption is to be started, when decryption is to be ended, and the like. The encryption timing includes an encryption start timing and an encryption end timing. The encryption start timing and the encryption end timing may be configured according to an actual application scenario. For example, when entering a page, it can be determined whether the page needs to be encrypted. For example, for page a and page B, page a may jump to page B. When the page a jumps to the page B, the page B may determine whether the page B needs to be encrypted according to an encryption opportunity configured in the first hook function of the page B. It should be noted that both the encryption timing and the encryption algorithm may be configured according to the actual application scenario and stored in the first hook function. The actual application scenarios are different, the encryption time and the encryption algorithm may be the same or different.
The encryption algorithm may be any type of encryption algorithm as long as an encryption operation can be achieved. The encryption algorithm may include, for example, but is not limited to, a symmetric encryption algorithm, an asymmetric encryption algorithm, a hash algorithm, and the like. The encryption algorithm may be a default encryption algorithm in the first hook function, or may be a custom encryption algorithm configured according to an actual application scenario, and is not specifically limited herein. The encryption parameters may be determined according to an encryption algorithm, and for field parameters of the same encryption field, the encryption algorithm is different, and the corresponding encryption parameters are also different. For example, the encryption time of the scene 1 is the time 1, and the encryption algorithm is a symmetric encryption algorithm; the encryption opportunity of the scene 2 is opportunity 2, and the encryption algorithm is an asymmetric encryption algorithm.
Further, after the field parameter is encrypted according to the encryption algorithm to obtain the encryption parameter, the encryption parameter can be redirected to the page routing link address. The redirection refers to replacing field parameters in the page routing link address by encryption parameters corresponding to the encryption fields, and regenerating the page routing link address so as to refresh the page routing link address.
For example, if the destination page enters, the page routing link address is "rule/single", wherein the corresponding encrypted field is ydEncryptKey, and the field parameter of the encrypted field may be, for example, a ═ 1, and so on. Further, if the encryption state of the page routing link address is an unencrypted field, the field parameter of the encrypted field may be encrypted by using the encryption attribute information in the first hook function, so as to obtain an encryption parameter B corresponding to the encrypted field. It should be noted that the encryption parameter may be different from the field parameter, and the specific value of the encryption parameter is determined according to the encryption algorithm. And after the encryption parameter B is obtained, replacing the field parameter A of the encryption field in the page routing link address with the encryption parameter B to be 1, and updating the page routing link address according to the generated encryption parameter.
Specifically, if the link is "rule/single", the corresponding parameter (encrypted field) is ydencrypt key, and the parameters carried thereafter all belong to encrypted parameters, based on which the URL link displayed in the actual scene can be obtained, for example:
192.168.216.36/rule/singleydEncryptKey=eyJydWxISWQIOm51bGwsl...
it should be noted that, for a single page, the display information of the target page may be kept fixed. A single page refers to an application with only one main page in which the browser initially loads all the necessary public resources html, js, css, all the page content being contained in the main page. The single page jump only refreshes local resources, and the common resources only need to be loaded once. And in the single-page operation process, page jump is not carried out, and the html content is changed. Keeping the display information of the target page fixed may be understood as that the target page does not blink for the user. Flashing here refers to the displayed information at page refresh, i.e. no page jump is visible to the user. Based on the method, the field parameter of the page routing link address can be redirected through the encryption parameter, the non-inductive refreshing of the target page is realized, and the influence on the display performance of the front-end page in the related technology is avoided.
In the embodiment of the disclosure, the field parameters of the encrypted field are encrypted at the encryption time contained in the encryption attribute information, so that the time for turning on the encryption and turning off the encryption can be configured definitely, the problem that the whole link address needs to be encrypted in the related technology is solved, and the flexibility of encryption processing is improved. Because the encryption process can be limited according to the encryption time instead of encrypting all information, the data volume needing to be processed during encryption is reduced, and the encryption efficiency and flexibility are improved.
Continuing to refer to fig. 2, in step S230, if it is determined that the encryption parameter needs to be decrypted, decrypting the encryption parameter in the second hook function of the routing manager to obtain a decryption parameter, and processing the target page according to the decryption parameter.
In an embodiment of the disclosure, the decrypting step may be performed in a second hook function of the routing manager. First, a parameter of the second hook function may be determined, where the parameter may be a hop parameter to, and the hop parameter to is used to indicate the route object to be jumped. Further, it can be determined in the second hook function whether the encryption parameter jumped to the route object needs to be decrypted. If decryption is needed, the encryption parameter can be decrypted in a second hook function of the routing manager to obtain a decryption parameter, and the target page is processed according to the decryption parameter. The decryption parameters may be determined according to decryption algorithms, which may correspond one-to-one to encryption algorithms. It should be noted that the decryption parameter may be the same as the field parameter. When the decryption parameter is the same as the field parameter, the decryption can be determined to be successful; when the decryption parameter is different from the field parameter, it may be determined that the decryption has failed.
Specifically, if the encrypted parameter needs to be decrypted and can be decrypted successfully, the encrypted parameter is modified to the original parameter represented by the field parameter, the page can acquire the original function represented by the field parameter without modifying, and the acquisition of the field parameter can be performed by using the original function this. $route.
It is to be added that the above steps S210 to S230 may be performed by a route manager plug-in. The route manager plug-in may be installed in the client. On this basis, according to the configuration of the route manager plug-in, if it is detected that the route manager plug-in is introduced into the client through mian.js, the route manager plug-in can be injected into Vue instance through vue.use () method. The routing manager plug-in can open encryption and close encryption according to a close function configured in a first hook function of the routing manager to determine an encryption opportunity, encrypt a field parameter in a page routing link address of a target page according to a configured encryption algorithm or a default encryption algorithm in the encryption opportunity, decrypt the encryption parameter in a second hook function, and render the target page according to the decryption parameter. It should be noted that the second hooking function can only be executed after the first hooking function.
A flow chart of the processing of the link address is schematically shown in fig. 5, and referring to fig. 3, mainly includes the following steps:
in step S510, the page enters.
In step S520, it is determined whether the page routing link address needs to be encrypted in the first hook function; if yes, go to step S530. If not, go to step S560.
In step S530, it is determined whether the page routing link address is encrypted. If yes, go to step S550. If not, go to step S540.
In step S540, parameter encryption is performed, and the page address parameter is modified again to be the encryption parameter.
In step S550, the encrypted parameters are decrypted and restored to the parameters of the routing manager.
In step S560, page rendering is performed.
In the embodiment of the present disclosure, referring to fig. 6, if a routing manager plugin 602 installed on a client 601 determines that a page routing link address needs to be encrypted in a first hook function 603 of a routing manager, an encryption state of the page routing link address is obtained; in the first hook function, if the encryption state is a non-encryption field, encrypting the field parameter of the encryption field 604 according to the encryption attribute information to obtain an encryption parameter 605, and redirecting the field parameter of the encryption field in the page routing link address to the encryption parameter corresponding to the encryption field; if it is determined that the encrypted parameter needs to be decrypted, decrypting the encrypted parameter in a second hook function 606 of the routing manager to obtain a decrypted parameter, where the decrypted parameter is the same as the encrypted field, and processing the target page according to the decrypted parameter.
For example, if there is a string of browser address bar links, the links may be represented as: http:// localhost:8080/listpage 5& username & idno 11112222, wherein three parameters on the link address are page, username and idno, respectively. In the related art, if encryption is used, a back-end interface is required to process encryption, and then page loading is performed and encrypted data is transmitted to the interface for decryption. Based on the route manager plug-in the embodiment of the present disclosure, encryption can be performed only by the front end, and an interface is not required.
The technical scheme in the embodiment of the disclosure is applied on the basis of using Vue front end framework and route manager vue-router, and is realized by providing a route manager plug-in to use a front end without using an interface to participate in encryption and decryption, so that parameter encryption and decryption of browser page addresses are performed, when in use, URL (uniform resource locator) parameters of link addresses in a browser address bar are a string of encryption parameters, and an encryption and decryption method can be freely configured to limit a user from being incapable of randomly changing and viewing sensitive parameters in the address bar, so that the security of the sensitive parameters is ensured. Because only the front-end plug-in does not need to use a server interface for encryption processing, the operation that any operation needs to be decrypted in the related technology is avoided, the decryption times are reduced, the calculation pressure of the server is reduced, and the development is not needed by the back end of a front-end development server, so the cost is reduced. Because the encryption process can be controlled by the encryption starting time and the encryption ending time in the first hook function, the required page can be encrypted, the processes that all link addresses of the whole site need to be encrypted and all information needs to be encrypted at the same level are avoided, the flexibility and pertinence of encryption processing are improved, and the openness is improved. Furthermore, for a user, as long as the configuration of parameter judgment and encryption and decryption judgment is carried out, no other influence is caused on the page, the front-end encryption is realized without cost configuration, the original code logic is not influenced, and the stability and the reliability are improved.
In an embodiment of the present disclosure, a page processing apparatus is further provided, and referring to fig. 7, the page processing apparatus 700 mainly includes the following modules:
the state determining module 701 is configured to, when a target page is loaded, obtain an encryption state of a page routing link address if it is determined that the page routing link address needs to be encrypted through a first hook function of a routing manager;
an encryption module 702, configured to redirect, in the first hook function, a field parameter of an encryption field in the page routing link address to an encryption parameter corresponding to the encryption field according to the encryption status;
a decryption module 703, configured to decrypt the encrypted parameter in the second hook function of the routing manager to obtain a decrypted parameter if it is determined that the encrypted parameter needs to be decrypted, and process the target page according to the decrypted parameter.
In an exemplary embodiment of the present disclosure, the encryption module includes: and the encryption judgment module is used for determining that the page routing link address needs to be encrypted if the returned information of the identification information of the page routing link address is determined to be the first information in the first hook function.
In an exemplary embodiment of the present disclosure, the state determination module includes: the first determining module is used for determining the page routing link address as an encrypted field if the encrypted field exists in the page routing link address and the encrypted field can be decrypted successfully; and the second determining module is used for determining the page routing link address as a non-encrypted field if the encrypted field does not exist in the page routing link address or the encrypted field cannot be decrypted successfully.
In an exemplary embodiment of the present disclosure, the encryption module includes: a first encryption module, configured to determine a field parameter of the encrypted field as the encryption parameter if the encryption status is an encrypted field; and the second encryption module is used for encrypting the field parameters of the encrypted field according to encryption attribute information in the first hook function to obtain encryption parameters if the encryption state is the non-encrypted field, and replacing the field parameters with the encryption parameters.
In an exemplary embodiment of the present disclosure, the second encryption module includes: and the encryption control module is used for encrypting the field parameters of the encrypted fields according to the encryption time and the encryption algorithm in the encryption attribute information to obtain the encryption parameters.
In an exemplary embodiment of the present disclosure, the encryption timing includes an encryption start timing and an encryption end timing.
In an exemplary embodiment of the present disclosure, the apparatus further includes: and the display information control module is used for keeping the display information of the target page fixed if the target page is a single page.
In addition, the specific details of each part in the page processing apparatus have been described in detail in the embodiment of the page processing method part, and details that are not disclosed may refer to the embodiment of the method part, and thus are not described again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
In the embodiment of the disclosure, an electronic device capable of implementing the method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to this embodiment of the disclosure is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, a bus 830 that couples various system components including the memory unit 820 and the processing unit 810, and a display unit 840.
Wherein the storage unit stores program code that is executable by the processing unit 810 to cause the processing unit 810 to perform steps according to various exemplary embodiments of the present disclosure as described in the "exemplary methods" section above in this specification. For example, the processing unit 810 may perform the steps as shown in fig. 2.
The storage unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration interface, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. As shown, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
In an embodiment of the present disclosure, a computer-readable storage medium is further provided, on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
According to the program product for implementing the above method of the embodiments of the present disclosure, it may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product 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 may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written 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 and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed, for example, synchronously or asynchronously in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (10)

1. A page processing method is characterized by comprising the following steps:
when a target page is loaded, if a page routing link address is determined to need encryption through a first hook function of a routing manager, the encryption state of the page routing link address is obtained;
in the first hook function, redirecting field parameters of an encrypted field in the page routing link address to encrypted parameters corresponding to the encrypted field according to the encryption state;
and if the encryption parameter is determined to need decryption, decrypting the encryption parameter in a second hook function of the routing manager to obtain a decryption parameter, and processing the target page according to the decryption parameter.
2. The page processing method according to claim 1, wherein said determining, by the first hook function of the route manager, that the page route link address needs to be encrypted comprises:
in the first hook function, if it is determined that the return information of the identification information of the page routing link address is the first information, it is determined that the page routing link address needs to be encrypted.
3. The page processing method according to claim 1, wherein said obtaining the encryption status of the page routing link address comprises:
if the encrypted field exists in the page routing link address and the encrypted field can be decrypted successfully, determining that the page routing link address is the encrypted field;
and if the encrypted field does not exist in the page routing link address or the encrypted field cannot be decrypted successfully, determining that the page routing link address is the unencrypted field.
4. The method for processing the page according to claim 1, wherein said redirecting the field parameter of the encrypted field in the page routing link address to the encrypted parameter corresponding to the encrypted field according to the encryption status comprises:
if the encryption state is the encrypted field, determining the field parameter of the encrypted field as the encryption parameter;
if the encryption state is a non-encryption field, encrypting the field parameter of the encryption field in the first hook function according to encryption attribute information to obtain an encryption parameter, and replacing the field parameter with the encryption parameter.
5. The page processing method according to claim 4, wherein said encrypting the field parameter of the encrypted field according to the encryption attribute information in the first hook function to obtain the encryption parameter comprises:
and encrypting the field parameters of the encrypted field according to the encryption opportunity and the encryption algorithm in the encryption attribute information to obtain the encryption parameters.
6. The page processing method according to claim 5, wherein the encryption timing includes an encryption start timing and an encryption end timing.
7. The page processing method according to claim 1, characterized in that the method further comprises:
if the target page is a single page, keeping the display information of the target page fixed.
8. A page processing apparatus, comprising:
the state determining module is used for acquiring the encryption state of the page routing link address if the page routing link address is determined to be required to be encrypted through a first hook function of the routing manager when a target page is loaded;
the encryption module is used for redirecting field parameters of an encryption field in the page routing link address to encryption parameters corresponding to the encryption field according to the encryption state in the first hook function;
and the decryption module is used for decrypting the encryption parameter in a second hook function of the routing manager to obtain a decryption parameter if the encryption parameter is determined to be required to be decrypted, and processing the target page according to the decryption parameter.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the page processing method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page processing method of any of claims 1-7 via execution of the executable instructions.
CN202210427260.1A 2022-04-21 2022-04-21 Page processing method and device, storage medium and electronic equipment Active CN114745190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210427260.1A CN114745190B (en) 2022-04-21 2022-04-21 Page processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210427260.1A CN114745190B (en) 2022-04-21 2022-04-21 Page processing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114745190A true CN114745190A (en) 2022-07-12
CN114745190B CN114745190B (en) 2024-01-16

Family

ID=82283634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210427260.1A Active CN114745190B (en) 2022-04-21 2022-04-21 Page processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114745190B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020152373A1 (en) * 2000-09-13 2002-10-17 Chih-Tang Sun Tunnel interface for securing traffic over a network
US20040117500A1 (en) * 2001-04-10 2004-06-17 Fredrik Lindholm Method and network for delivering streaming data
US20090103734A1 (en) * 2007-10-17 2009-04-23 Pitney Bowes Inc. Method and system for securing routing information of a communication using identity-based encryption scheme
CN110750741A (en) * 2019-10-18 2020-02-04 深圳市比量科技传媒有限公司 Webpage link skipping processing method, computer device and storage medium
CN111859226A (en) * 2020-08-05 2020-10-30 杭州安恒信息技术股份有限公司 Page jump method, device and related equipment
CN112000331A (en) * 2020-08-07 2020-11-27 北京三快在线科技有限公司 Page rendering method and device, electronic equipment and storage medium
CN114238811A (en) * 2021-12-13 2022-03-25 中国平安财产保险股份有限公司 Page loading method, page request response method, device, equipment and medium
CN114282233A (en) * 2021-11-25 2022-04-05 上海浦东发展银行股份有限公司 WEB performance optimization method and device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020152373A1 (en) * 2000-09-13 2002-10-17 Chih-Tang Sun Tunnel interface for securing traffic over a network
US20120324216A1 (en) * 2000-09-13 2012-12-20 Fortinet, Inc. Tunnel interface for securing traffic over a network
US20040117500A1 (en) * 2001-04-10 2004-06-17 Fredrik Lindholm Method and network for delivering streaming data
US20090103734A1 (en) * 2007-10-17 2009-04-23 Pitney Bowes Inc. Method and system for securing routing information of a communication using identity-based encryption scheme
CN110750741A (en) * 2019-10-18 2020-02-04 深圳市比量科技传媒有限公司 Webpage link skipping processing method, computer device and storage medium
CN111859226A (en) * 2020-08-05 2020-10-30 杭州安恒信息技术股份有限公司 Page jump method, device and related equipment
CN112000331A (en) * 2020-08-07 2020-11-27 北京三快在线科技有限公司 Page rendering method and device, electronic equipment and storage medium
CN114282233A (en) * 2021-11-25 2022-04-05 上海浦东发展银行股份有限公司 WEB performance optimization method and device, computer equipment and storage medium
CN114238811A (en) * 2021-12-13 2022-03-25 中国平安财产保险股份有限公司 Page loading method, page request response method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李莉;曾庆贤;文义红;王士成;: "基于区块链与代理重加密的数据共享方案", 信息网络安全, no. 08 *

Also Published As

Publication number Publication date
CN114745190B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
US11520912B2 (en) Methods, media, apparatuses and computing devices of user data authorization based on blockchain
EP3916604B1 (en) Method and apparatus for processing privacy data of block chain, device, storage medium and computer program product
US8910277B1 (en) Process-based domain isolation
US20170272499A1 (en) Method and device for loading webpage
US8886819B1 (en) Cross-domain communication in domain-restricted communication environments
US8613106B2 (en) Reducing the value of a browser fingerprint
CN103647746A (en) User login method, device and system
US10824770B2 (en) Web application execution with secure elements
CN109800557B (en) Block chain-based integrated processing method, device, server, equipment and medium
CN110493239B (en) Authentication method and device
CN112905144B (en) Terminal display method and device, electronic equipment and storage medium
CN112612977A (en) Page display method, system, device, equipment and storage medium
CN114978605A (en) Page access method and device, electronic equipment and storage medium
CN113569229B (en) Synchronous login method and device, storage medium and electronic equipment
CN116569165A (en) Page display method and device, storage medium and electronic equipment
CN105391673B (en) Safety access method and device
CN113626795A (en) Verification method and device of distributed system architecture, electronic equipment and storage medium
CN111400760B (en) Method, device, server and storage medium for web application to access database
CN111800511A (en) Processing method, system, equipment and readable storage medium for synchronous login state
CN114745190B (en) Page processing method and device, storage medium and electronic equipment
US9794255B2 (en) Communication terminal and communication processing method
US9729619B2 (en) Information processing system, processing apparatus, and distributed processing method
CN110309213B (en) Database access control method, device, system, medium and equipment
CN113613044B (en) Video playing method and device, storage medium and electronic equipment
CN113329028B (en) Cross-domain access 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
GR01 Patent grant
GR01 Patent grant