Information management method and device and storage medium
By running the information injection code in the source code of the destination web page, injecting the information to be injected into the web page, and deleting the information when specific conditions are met, the problem of low security in injection information is solved and the security viewing and deletion of information is achieved.
Patent Information
- Application Number
- CN202510197799.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-23
AI Technical Summary
The injected information in the prior art is low in security and is easily viewed.
By running the information injection code in the source code of the destination web page, inject the information to be injected into the web page, and delete the information when specific conditions are met, ensuring that the information can only be viewed under specific operations.
Improves the security of injected information, ensures that the information can only be viewed when certain conditions are met, and provides the operation of deleting information.
Smart Images

Figure CN120030596A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an information management method, device and storage medium. Background Art
[0002] When compiling a front-end project, it is common to inject additional information. Usually, the injected information includes the compilation time and the compilation branch. Currently, information injection is achieved by injecting information into index.html in the form of comments or injecting it into a global variable in the window in the form of variables.
[0003] However, after injecting information using the above two methods, the injected information can be easily viewed, resulting in low information security. Summary of the invention
[0004] The purpose of the present application is to provide an information management method, device and storage medium, aiming to solve the problem of low security of injected information.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides an information management method, which includes: in response to an information injection operation satisfying an information injection condition, running an information injection code in the source code of a target web page to inject the information to be injected into the target web page; in response to an information viewing operation, displaying the information to be injected on the target web page; and when an information destruction condition is satisfied, deleting the information to be injected on the target web page.
[0007] The information management method provided by the embodiment of the present application can view the information to be injected only after it is injected into the target web page when the information injection operation meets the information injection conditions, and delete the information to be injected when the information destruction conditions are met. In this way, the information to be injected can be viewed only through specific operations, and an operation for deleting the information to be injected is also provided, thereby improving the security of the injected information.
[0008] In a possible implementation, the information destruction condition includes at least one of the following: detecting a deletion operation on the information to be injected on the target web page; the display time of the information to be injected on the target web page exceeds a preset time; detecting an operation that triggers the execution of the information destruction code in the source code.
[0009] In one possible implementation, the information injection operation satisfies the information injection conditions including at least one of the following: the information injection operation triggers a preset link on the target web page; the information injection operation triggers a preset control on the target web page; the information injection operation triggers a preset area on the target web page; the information injection operation moves the target icon on the target web page to the preset area.
[0010] In a possible implementation, running the information injection code in the source code of the target webpage to inject the information to be injected into the target webpage includes: running the information injection code in the source code of the target webpage to generate a target variable, the value of the target variable is the information to be injected; inserting the target variable into the target webpage.
[0011] In a possible implementation, the method also includes: obtaining the original code of the target web page, the original code including multiple key parameters; based on the front-end construction tool, replacing the first key parameter with the information injection code, and replacing the second key parameter with the information destruction code, the first key parameter and the second key parameter being different key parameters among the multiple key parameters.
[0012] In a possible implementation, based on a front-end construction tool, the first key parameter is replaced with an information injection code, and the second key parameter is replaced with an information destruction code, including: configuring a loader through the front-end construction tool, the loader being used to modify the original code of the target web page; through the loader, replacing the first key parameter with the information injection code, and replacing the second key parameter with the information destruction code.
[0013] In a second aspect, the present application provides an information management device, which includes: a processing unit; a processing unit, which is used to run the information injection code in the source code of the target web page in response to the information injection operation satisfying the information injection condition, so as to inject the information to be injected into the target web page; the processing unit is also used to display the information to be injected on the target web page in response to the information viewing operation; the processing unit is also used to delete the information to be injected on the target web page when the information destruction condition is satisfied.
[0014] In a possible implementation, the information destruction condition includes at least one of the following: detecting a deletion operation on the information to be injected on the target web page; the display time of the information to be injected on the target web page exceeds a preset time; detecting an operation that triggers the execution of the information destruction code in the source code.
[0015] In one possible implementation, the information injection operation satisfies the information injection conditions including at least one of the following: the information injection operation triggers a preset link on the target web page; the information injection operation triggers a preset control on the target web page; the information injection operation triggers a preset area on the target web page; the information injection operation moves the target icon on the target web page to the preset area.
[0016] In a possible implementation, the processing unit is further used to run the information injection code in the source code of the target webpage to generate a target variable, the value of the target variable is the information to be injected; the processing unit is further used to insert the target variable into the target webpage.
[0017] In one possible implementation, the device also includes: a communication unit; a communication unit, used to obtain the original code of the target web page, the original code including multiple key parameters; a processing unit, also used to replace the first key parameter with the information injection code based on the front-end construction tool, and replace the second key parameter with the information destruction code, the first key parameter and the second key parameter are different key parameters among the multiple key parameters.
[0018] In one possible implementation, the processing unit is further used to configure the loader through a front-end construction tool, and the loader is used to modify the original code of the target web page; the processing unit is further used to replace the first key parameter with the information injection code and the second key parameter with the information destruction code through the loader.
[0019] In a third aspect, the present application provides an information management device, comprising: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the information management method described in the first aspect and any possible implementation method of the first aspect.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal, the terminal executes the information management method described in the first aspect and any possible implementation of the first aspect.
[0021] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an information management device, enables the information management device to execute the information management method as described in the first aspect and any possible implementation of the first aspect.
[0022] In a sixth aspect, the present application provides a chip, the chip comprising a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the information management method described in the first aspect and any possible implementation method of the first aspect.
[0023] Specifically, the chip provided in the present application also includes a memory for storing computer programs or instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1A schematic diagram of the composition of an information management device provided in an embodiment of the present application;
[0026] Figure 2 A flowchart of an information management method provided in an embodiment of the present application;
[0027] Figure 3 A flowchart of another information management method provided in an embodiment of the present application;
[0028] Figure 4 A flowchart of another information management method provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of the structure of an information management device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] In the description of this application, it should be understood that the terms "upper", "lower", "left", "right", "front", "back", "inside", "outside", etc. indicate directions or positional relationships based on the directions or relative positional relationships shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on this application. Unless otherwise specified, the above-mentioned directional description can be flexibly set in the process of actual application under the condition that the relative positional relationship shown in the accompanying drawings is met.
[0032] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0033] In the present application, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, article or device including the element.
[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0035] In the description of this specification, specific features, structures, materials or characteristics may be combined in an appropriate manner in any one or more embodiments or examples.
[0036] Currently, information injection is usually achieved by injecting information into index.html in the form of comments or injecting it into a global variable in the window in the form of variables. However, after injecting information in the above two ways, the injected information can be easily viewed, resulting in low information security.
[0037] In view of this, an embodiment of the present application provides an information management method, which includes: in response to an information injection operation satisfying an information injection condition, running an information injection code in the source code of a target webpage to inject the information to be injected into the target webpage. In response to an information viewing operation, displaying the information to be injected on the target webpage. In the case where an information destruction condition is satisfied, deleting the information to be injected on the target webpage. In other words, the information management method provided by the embodiment of the present application is that the information to be injected can only be viewed after the information to be injected is injected into the target webpage when the information injection operation satisfies the information injection condition, and the information to be injected is deleted when the information destruction condition is satisfied. In this way, the information to be injected can only be viewed through a specific operation, and an operation of deleting the information to be injected is also provided, thereby improving the security of the injected information.
[0038] For example, Figure 1 Schematic diagram of the composition of an information management device 10 provided in an embodiment of the present application. Figure 1 As shown, the information management device 10 may include a processor 101 and a bus 102 .
[0039] Furthermore, the information management device 10 may also include a communication interface 103 and a memory 104. The processor 101, the memory 104 and the communication interface 103 may be connected via a bus 102.
[0040] The processor 101 is a central processing unit (CPU), a general processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 101 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.
[0041] The bus 102 is used to transmit information between the components included in the information management device 10.
[0042] The communication interface 103 is used to communicate with other devices or other communication networks. The other communication networks may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 103 may be a module, a circuit, a communication interface or any device capable of realizing communication.
[0043] The memory 104 is used to store instructions, where the instructions may be computer programs.
[0044] The memory 104 may be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0045] It should be noted that the memory 104 can exist independently of the processor 101 or can be integrated with the processor 101. The memory 104 can be used to store instructions or program codes or some data. The memory 104 can be located in the information management device 10 or outside the information management device 10, without limitation. The processor 101 is used to execute the instructions stored in the memory 104 to implement the information management method provided in the following embodiments of the present application.
[0046] In an example, the processor 101 may include one or more CPUs, for example, CPU0 and CPU1 (not shown in the figure).
[0047] As an optional implementation, the information management device 10 includes multiple processors.
[0048] As an optional implementation, the information management device 10 further includes an output device and an input device. For example, the input device is a keyboard, a mouse, a microphone, a joystick, and the output device is a display screen, a speaker, and the like.
[0049] It should be noted that the information management device 10 can be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system or a Figure 1 In addition, Figure 1 The composition shown in the Figure 1 The limitations of each device in Figure 1 In addition to the parts shown, Figure 1 The various devices in the drawings may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0050] In the embodiment of the present application, the chip system may be composed of a chip, or may include a chip and other discrete devices.
[0051] In addition, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message name or parameter name in the message exchanged between the various devices in the embodiments of the present application is only an example, and other names can also be used in the specific implementation without limitation.
[0052] The information management method provided by the embodiment of the present application is described below in conjunction with the accompanying drawings. Among them, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message name or parameter name in the message exchanged between the various devices in the embodiment of the present application is only an example, and other names can also be used in the specific implementation without limitation. The actions involved in the various embodiments of the present application are only an example, and other names can also be used in the specific implementation, such as: "included in" in the embodiment of the present application can also be replaced by "carried on" or "carried in", etc.
[0053] like Figure 2 As shown, the embodiment of the present application proposes an information management method, which includes:
[0054] S201 . In response to an information injection operation satisfying an information injection condition, executing information injection code in a source code of a target webpage to inject information to be injected into the target webpage.
[0055] The information to be injected refers to the information that needs to be injected into the target web page. For example, the information to be injected may include the version information and development information of the target web page. The development information may be the web page release time, web page release personnel, web page release branch, or web page compilation time.
[0056] In one possible implementation, the information injection operation performed by the user on the target web page is detected to determine whether the information injection operation meets the information injection conditions, and if the information injection operation meets the information injection conditions, the information injection code in the source code of the target web page is run to inject the information to be injected into the target web page.
[0057] Exemplarily, the above-mentioned information injection operation satisfies the information injection condition and may include at least one of the following:
[0058] 1-1. The information injection operation is to trigger the preset link on the target web page
[0059] Specifically, triggering the preset link on the target webpage may be that the user clicks the preset link with a mouse, the user accesses the preset link with a keyboard shortcut, or the user opens the preset link with a voice command.
[0060] 1-2. The information injection operation is to trigger the preset controls on the target web page
[0061] Specifically, the above-mentioned preset control can be a preset button, a preset input box or a preset check box, and triggering the preset control on the target web page can be that the user clicks the preset button continuously for a preset number of times, the user enters preset content in the preset input box, or the user selects a preset option in the preset check box.
[0062] 1-3. The information injection operation is to trigger the preset area on the target web page
[0063] Specifically, the preset area on the target webpage may be triggered by the user clicking the preset area with a mouse or the user hovering the mouse pointer over the preset area for a preset time.
[0064] 1-4. The information injection operation is to move the target icon on the target web page to the preset area
[0065] Specifically, the user selects a target icon on a target webpage and moves the target icon to a preset area.
[0066] Furthermore, the implementation process of running the information injection code in the source code of the target webpage to inject the information to be injected into the target webpage may be: running the information injection code in the source code of the target webpage, generating a target variable, and inserting the target variable into the target webpage, wherein the target variable is a window global variable, and the value of the target variable is the information to be injected.
[0067] Exemplarily, the above information injection code may be:
[0068] “window.$InjectData$={"time":"Mon Sep 16 2024 20:32:07GMT+0800(China Standard Time)","version":"2024-09-16"}”.
[0069] Among them, window.$InjectData$ represents the target variable, "time":"Mon Sep 16 202420:32:07GMT+0800(China Standard Time)","version":"2024-09-16" represents the information to be injected, including compilation time and version information.
[0070] S202: In response to the information viewing operation, display the information to be injected on the target web page.
[0071] In a possible implementation, in response to the user's information viewing operation, the information to be injected is displayed on the console panel of the target webpage.
[0072] Specifically, the above information viewing operation can be: right-click the mouse on the target web page and select Inspect Element, and click the Console tab at the top of the developer tool interface that pops up. Enter the target variable name in the console panel and press Enter. For example, enter window.$InjectData$ and press Enter, and the displayed value of the information instance to be injected is: {"time":"Mon Sep 16 202420:32:07GMT+0800(China Standard Time)","version":"2024-09-16"}.
[0073] S203: When the information destruction condition is met, the information to be injected on the target web page is deleted.
[0074] In a possible implementation, after the target webpage displays the information to be injected, it is determined whether there is a situation on the target webpage that satisfies the information destruction condition, and if the information destruction condition is satisfied, the information to be injected on the target webpage is deleted.
[0075] Exemplarily, the above-mentioned information destruction conditions may include at least one of the following:
[0076] 2-1. Detection of deleting the information to be injected on the target web page
[0077] Specifically, it is detected that the user selects the information to be injected on the target webpage, and the information to be injected is deleted.
[0078] 2-2. The information to be injected is displayed on the target web page for longer than the preset time.
[0079] Specifically, the timing starts from when the information to be injected is displayed on the target webpage, and it is identified that the display time of the information to be injected on the target webpage exceeds a preset time (for example, 5 minutes).
[0080] 2-3. Detecting an operation that triggers the execution of information destruction code in the source code
[0081] Specifically, the operation of triggering the execution of the information destruction code in the source code may refer to the operation in which the aforementioned information injection operation satisfies the information injection condition, which will not be described in detail here.
[0082] It should be noted that the above information destruction conditions can be set by the code developer of the target web page.
[0083] Optionally, in combination with the above information injection code example, the above information destruction code may be "deletewindow.$InjectData$", which means deleting the target variable (ie, window.$InjectData$), that is, deleting the information to be injected on the target web page.
[0084] In the information management method provided by the present application, in response to an information injection operation satisfying an information injection condition, the information injection code in the source code of the target webpage is run to inject the information to be injected into the target webpage. In response to an information viewing operation, the information to be injected is displayed on the target webpage. In the case where an information destruction condition is satisfied, the information to be injected on the target webpage is deleted. That is to say, in the embodiment of the present application, the information to be injected can only be viewed after the information to be injected is injected into the target webpage when the information injection operation satisfies the information injection condition, and the information to be injected is deleted when the information destruction condition is satisfied. In this way, the information to be injected can only be viewed through a specific operation, and an operation of deleting the information to be injected is also provided, thereby improving the security of the injected information.
[0085] Optionally, before S201, the original code of the target webpage may be converted into a source code including an information injection code and an information destruction code, so that the information to be injected can be injected into the target webpage by running the information injection code and the information to be injected on the target webpage can be deleted by running the information destruction code. Figure 3 As shown, the information injection method described in the embodiment of the present application may also include the following steps.
[0086] S301, obtaining the original code of the target web page.
[0087] The original code of the target webpage includes multiple key parameters, including a first key parameter and a second key parameter. The first key parameter is used to identify the location of the information injection code. The second key parameter is used to identify the location of the information destruction code.
[0088] In a possible implementation, a front-end engineering source file of a target webpage is obtained, wherein the front-end engineering source file includes the original code of the front-end execution event. A first key parameter is inserted at a position where information injection is expected in the original code of the front-end execution event, and a second key parameter is inserted at a position where information destruction is expected in the original code of the front-end execution event, to obtain the original code of the target webpage.
[0089] Exemplarily, the first key parameter may be “ / *data-load-placeholder* / ”, and the second key parameter may be “ / *data-unload-placeholder* / ”.
[0090] S302. Based on the front-end construction tool, the first key parameter is replaced with the information injection code, and the second key parameter is replaced with the information destruction code.
[0091] The first key parameter and the second key parameter are different key parameters among the multiple key parameters.
[0092] In a possible implementation, a loader is imported into the configuration file of the front-end building tool, and the loader searches for the first key parameter and the second key parameter in the original code of the target webpage, and replaces the first key parameter with the information injection code and the second key parameter with the information destruction code. Figure 4 The described embodiments are not described in detail here.
[0093] Exemplarily, the front-end building tool may be Webpack. Webpack is a powerful front-end module building tool that supports multiple features such as modular development, code conversion, and plug-in extension, and can package all modules in the front-end project into one or more static resource files.
[0094] In one embodiment, Figure 4 As shown, the above S302 can be specifically determined through the following S401 to S402.
[0095] S401. Configure the loader through the front-end build tool.
[0096] The loader is used to modify the original code of the target web page.
[0097] In a possible implementation, the code for importing the loader is inserted into the configuration file of the front-end building tool, and the parameters required by the loader are defined in the configuration file, and the loader is obtained through the configuration file.
[0098] It should be noted that a loader is essentially a JavaScript module exported as a function, which receives the source file as input and outputs the processed result. The main function of the loader is to transform the source file. In Webpack, any file can be regarded as a module, and the loader is used to convert the module into a format that Webpack can process and effectively package.
[0099] Exemplarily, the code of the configuration file of the front-end construction tool may include the following content:
[0100]
[0101]
[0102] The first line of code above indicates the import of the path module, which is used to process and convert file paths.
[0103] The second line of code indicates exporting the configuration object.
[0104] The third line of code sets the operating mode to production mode.
[0105] The fourth and fifth lines of code indicate disabling the code compression feature in the optimization options.
[0106] The seventh line of code represents the configuration entry file.
[0107] The eighth to tenth lines of code represent the configuration of output options, including specifying the name of the output file and the absolute path of the output directory.
[0108] The twelfth line of code represents the configuration module processing rules.
[0109] The thirteenth to fifteenth lines of code represent the configuration processing rules for files with the suffix .js.
[0110] The sixteenth to nineteenth lines of code specify the loader to be used, including the storage path of the loader.
[0111] The 20th to 24th lines of code represent the four parameters passed to the loader, including injects (i.e. the information to be injected), data_load_placeholder (i.e. the first key parameter), data_unload_placeholder (i.e. the second key parameter), and window_var (i.e. the target variable).
[0112] It should be noted that each file suffix can match a loader. For the JavaScript code file that executes the event on the front end, the file suffix is .js. Therefore, the 15th line of code above limits the loader's processing files to js files.
[0113] It should be noted that the above-mentioned injects, data_load_placeholder and data_unload_placeholder parameter names and parameter contents are only examples, and other parameter names and parameter contents may also be used without limitation.
[0114] It is understandable that when you need to inject information into different web pages, you can import the loader in the Webpack configuration file to inject the information to be injected into the web page, thereby improving the efficiency of information injection. In addition, if the information to be injected changes, you only need to modify the content of the injects parameter in the above configuration file.
[0115] S402: Using a loader, replace the first key parameter with an information injection code, and replace the second key parameter with an information destruction code.
[0116] In a possible implementation, the original code of the target webpage is identified by a loader, and the first key parameter and the second key parameter are found. The first key parameter is replaced with the information injection code, and the second key parameter is replaced with the information destruction code.
[0117] For example, in combination with injects, data_load_placeholder, data_unload_placeholder, and window_var defined in the configuration file of the aforementioned front-end building tool, / *data-load-placeholder* / in the original code of the target webpage is replaced with: window.$InjectData$={"time":"Mon Sep 162024 20:32:07GMT+0800(China Standard Time)","version":"2024-09-16"}. / *data-unload-placeholder* / in the original code of the target webpage is replaced with: delete window.$InjectData$.
[0118] For example, the code of the loader may be as follows:
[0119] JavaScript
[0120]
[0121] The first line of code above indicates exporting a function, the input of which is the parameter source, and source indicates the content of the source file.
[0122] The second line of code indicates getting four parameters from the this.query object: injects, window_var, data_load_placeholder, and data_unload_placeholder.
[0123] The third line of code means that if injects exists and is not false, the following code block will be executed.
[0124] The fourth line of code initializes a new variable newSource and sets it to source.
[0125] The fifth to seventh lines of code indicate that the replace method is used to find the data_load_placeholder placeholder in the source file and replace it with the code that converts injects into a JSON string and assigns it to the window_var variable of the window global variable.
[0126] The ninth to eleventh lines of code indicate that the replace method is used to find the data_unload_placeholder placeholder in the source file and replace it with the code that deletes the window_var variable from the window global variable.
[0127] The thirteenth line of code indicates returning the modified source file.
[0128] Lines 14 to 15 of the code indicate that if injects is false, the original source file is returned.
[0129] It is understandable that when it is necessary to inject information into different web pages, there is no need to modify the code of the above loader. The loader can be directly imported into the Webpack configuration file, which can improve the efficiency of information injection.
[0130] It is understandable that the above-mentioned information management method can be implemented by an information management device. In order to realize the above-mentioned functions, the information management device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments disclosed in the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments disclosed in this application.
[0131] The embodiments disclosed in the present application can divide the functional modules of the information management device generated by the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments disclosed in the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0132] Figure 5 This is a schematic diagram of the structure of an information management device provided in an embodiment of the present application. Figure 5 As shown, the information management device 50 can be used to perform Figure 2-Figure 4 The information management method shown. The information management device 50 includes: a processing unit 501.
[0133] Processing unit 501 is used to run the information injection code in the source code of the target web page in response to the information injection operation satisfying the information injection condition, so as to inject the information to be injected into the target web page; processing unit 501 is also used to display the information to be injected on the target web page in response to the information viewing operation; processing unit 501 is also used to delete the information to be injected on the target web page when the information destruction condition is satisfied.
[0134] In a possible implementation, the information destruction condition includes at least one of the following: detecting a deletion operation on the information to be injected on the target web page; the display time of the information to be injected on the target web page exceeds a preset time; detecting an operation that triggers the execution of the information destruction code in the source code.
[0135] In one possible implementation, the information injection operation satisfies the information injection conditions including at least one of the following: the information injection operation triggers a preset link on the target web page; the information injection operation triggers a preset control on the target web page; the information injection operation triggers a preset area on the target web page; the information injection operation moves the target icon on the target web page to the preset area.
[0136] In a possible implementation, the processing unit 501 is further used to run the information injection code in the source code of the target webpage to generate a target variable, the value of the target variable is the information to be injected; the processing unit 501 is further used to insert the target variable into the target webpage.
[0137] In one possible implementation, the device also includes: a communication unit 502; the communication unit 502 is used to obtain the original code of the target web page, the original code includes multiple key parameters; the processing unit 501 is also used to replace the first key parameter with the information injection code based on the front-end construction tool, and replace the second key parameter with the information destruction code, the first key parameter and the second key parameter are different key parameters among the multiple key parameters.
[0138] In one possible implementation, the processing unit 501 is also used to configure the loader through the front-end construction tool, and the loader is used to modify the original code of the target web page; the processing unit 501 is also used to replace the first key parameter with the information injection code and the second key parameter with the information destruction code through the loader.
[0139] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0140] The present disclosure also provides a computer-readable storage medium having instructions stored thereon. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the information management method provided by the above-mentioned embodiment of the present disclosure.
[0141] The embodiments of the present disclosure also provide a computer program product including instructions, which, when executed on an electronic device, enables the electronic device to execute the information management method provided by the embodiments of the present disclosure.
[0142] Among them, the computer readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0143] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An information management method, characterized in that: The method comprises: In response to the information injection operation satisfying the information injection condition, running the information injection code in the source code of the target webpage to inject the information to be injected into the target webpage; In response to the information viewing operation, displaying the information to be injected on the target webpage; When the information destruction condition is met, the information to be injected on the target webpage is deleted.
2. The method according to claim 1, characterized in that: The information destruction conditions include at least one of the following: Detecting that a deletion operation is performed on the information to be injected on the target webpage; The display time of the information to be injected on the target webpage exceeds a preset time; An operation is detected that triggers the execution of information destruction code in the source code.
3. The method according to claim 1, characterized in that The information injection operation satisfies the information injection condition including at least one of the following: The information injection operation is to trigger a preset link on the target web page; The information injection operation is to trigger a preset control on the target web page; The information injection operation is to trigger a preset area on the target web page; The information injection operation is to move the target icon on the target webpage to the preset area.
4. The method according to any one of claims 1 to 3, characterized in that The step of running the information injection code in the source code of the target webpage to inject the information to be injected into the target webpage includes: Running the information injection code in the source code of the target webpage to generate a target variable, the value of the target variable being the information to be injected; The target variable is inserted into the target web page.
5. The method according to claim 2, characterized in that: The method further comprises: Acquire the original code of the target webpage, wherein the original code includes a plurality of key parameters; Based on the front-end construction tool, the first key parameter is replaced with the information injection code, and the second key parameter is replaced with the information destruction code, and the first key parameter and the second key parameter are different key parameters among the multiple key parameters.
6. The method according to claim 5, characterized in that The method of replacing the first key parameter with the information injection code and the second key parameter with the information destruction code based on the front-end construction tool includes: Configuring a loader through a front-end building tool, wherein the loader is used to modify the original code of the target webpage; Through the loader, the first key parameter is replaced with the information injection code, and the second key parameter is replaced with the information destruction code.
7. An information management device, characterized in that: The device comprises: a processing unit; The processing unit is used for running the information injection code in the source code of the target webpage in response to the information injection operation satisfying the information injection condition, so as to inject the information to be injected into the target webpage; The processing unit is further configured to display the information to be injected on the target webpage in response to an information viewing operation; The processing unit is further configured to delete the information to be injected on the target webpage when an information destruction condition is met.
8. An information management device, characterized in that: include: Memory and processor; The memory is coupled to the processor; The memory is used to store instructions executable by the processor; When the processor executes the instructions, the information management method according to any one of claims 1 to 6 is performed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the information management method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises computer program instructions, and when the computer program instructions are executed by a processor, the information management method according to any one of claims 1 to 6 is implemented.