CN113438221B - Local end file loading method and device, electronic equipment and medium - Google Patents

Local end file loading method and device, electronic equipment and medium Download PDF

Info

Publication number
CN113438221B
CN113438221B CN202110693065.9A CN202110693065A CN113438221B CN 113438221 B CN113438221 B CN 113438221B CN 202110693065 A CN202110693065 A CN 202110693065A CN 113438221 B CN113438221 B CN 113438221B
Authority
CN
China
Prior art keywords
file
domain name
webpage
loaded
page
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.)
Active
Application number
CN202110693065.9A
Other languages
Chinese (zh)
Other versions
CN113438221A (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.)
Shenzhen Saiante Technology Service Co Ltd
Original Assignee
Shenzhen Saiante Technology Service 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 Shenzhen Saiante Technology Service Co Ltd filed Critical Shenzhen Saiante Technology Service Co Ltd
Priority to CN202110693065.9A priority Critical patent/CN113438221B/en
Publication of CN113438221A publication Critical patent/CN113438221A/en
Application granted granted Critical
Publication of CN113438221B publication Critical patent/CN113438221B/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/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Abstract

The invention relates to the technical field of cloud security, and discloses a local file loading method, which comprises the steps of reading a local file to obtain a file stream; storing the file stream into a preset storage space and constructing a storage path; mapping the storage path into a virtual domain name and storing the virtual domain name in a webpage interceptor; when the webpage end receives the domain name to be loaded, judging whether the domain name to be loaded is matched with the virtual domain name in the webpage interceptor; if not, loading the display page corresponding to the domain name to be loaded to the webpage end; and if so, constructing a response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message. The invention also provides a local end file loading device, equipment and a storage medium. The invention also relates to blockchain techniques, the stream files being storable in blockchain nodes. The invention improves the security of transmitting the local file to the webpage end.

Description

Local end file loading method and device, electronic equipment and medium
Technical Field
The invention relates to the technical field of cloud security, in particular to a local-end file loading method and device, electronic equipment and a computer-readable storage medium.
Background
With the popularization of networks, local files are often required to be uploaded to a webpage end, for example, on-line examination entry is required to upload entry data from the local end to the webpage end. At present, when a local file is uploaded and previewed on a webpage end, the local file needs to be directly loaded on the webpage end, so that a storage path of the local file is easily displayed, and the local file is exposed as an attribute of local storage and is not safe enough.
Disclosure of Invention
The invention provides a local file loading method, a local file loading device, electronic equipment and a computer readable storage medium, and mainly aims to improve the security of local files transmitted to a webpage end.
In order to achieve the above object, a local file loading method provided by the present invention includes:
sequentially reading local files to obtain a file stream of the local files;
storing the file stream into a preset storage space in a binary form, and constructing a storage path of the file stream in the storage space;
mapping the storage path into a virtual domain name according to a preset mapping table, and storing the virtual domain name in a preset webpage interceptor;
when the webpage end receives the domain name to be loaded, judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor;
if the domain name to be loaded is not matched with the virtual domain name, loading a display page corresponding to the domain name to be loaded to the webpage end;
and if the domain name to be loaded is matched with the virtual domain name, constructing a response message according to the webpage end, storing the file stream corresponding to the virtual domain name by using the response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message.
Optionally, the storing the file stream into a preset storage space in a binary form includes:
acquiring the file type of a local end file corresponding to the file stream;
calling a preset file editor according to the file type;
and carrying out binarization operation on the file stream by using the file editor to obtain a binarization numerical value of the file stream, and storing the binarization numerical value of the file stream into the storage space.
Optionally, the constructing a storage path of the file stream in the storage space includes:
acquiring an original file name, a timestamp and a suffix name of a local file corresponding to the file stream;
and constructing a storage path of the file stream in the storage space according to the original file name, the timestamp and the suffix name.
Optionally, the constructing a response packet according to the web page end includes:
acquiring a response head, a response body and a response code of the webpage end;
and constructing a response message of the webpage end by using the response head, the response body and the response code.
Optionally, after the display page corresponding to the domain name to be loaded is loaded to the web page end, the method further includes:
and sequencing the display pages loaded by the webpage end by using a page sequencing method.
Optionally, the sorting the display pages loaded by the web page end by using a page sorting method includes:
acquiring an incoming chain and an outgoing chain of the display page and a page ranking value of a webpage corresponding to the incoming chain;
calculating the page ranking value of the display page by using a page ranking method according to the incoming chain and the outgoing chain of the display page and the page ranking value of the webpage corresponding to the incoming chain;
and sequencing the display pages according to the page sequencing values of the display pages.
Optionally, the calculating the page ranking value of the display page by using a page ranking method includes:
calculating a page sorting value PR (u) of the display page by using the following page sorting formula:
Figure GDA0003555270830000021
wherein L (v) is the number of out-links of the display page, BuAnd PR (v) is a page ranking value of the webpage corresponding to the incoming chain.
In order to solve the above problem, the present invention further provides a local-end-based file loading apparatus, including:
the file reading module is used for sequentially reading local files to obtain a file stream of the local files;
the file storage module is used for storing the file stream into a preset storage space in a binary mode and constructing a storage path of the file stream in the storage space;
the virtual domain name generation module is used for mapping the storage path into a virtual domain name according to a preset mapping table and storing the virtual domain name in a preset webpage interceptor;
the domain name interception module is used for judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor or when the webpage end receives the domain name to be loaded;
and the domain name loading module is used for loading the display page corresponding to the domain name to be loaded to the webpage end if the domain name to be loaded is not matched with the virtual domain name, constructing a response message according to the webpage end if the domain name to be loaded is matched with the virtual domain name, storing the file stream corresponding to the virtual domain name by using the response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the local-end file loading method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium including a storage data area and a storage program area, the storage data area storing created data, the storage program area storing a computer program; wherein the computer program, when executed by a processor, implements the local side file loading method as described above.
In the embodiment of the invention, the local files are sequentially read according to the file transmission instruction to obtain the file flow of the local files, the file flow is stored in the preset storage space and the storage path of the file flow is created, the storage path of the local files can be hidden, the storage path of the file flow is mapped into the virtual domain name through the preset mapping table, the virtual domain name is sent to the preset webpage interceptor, when the webpage loads the domain name to be loaded, the webpage interceptor is used for intercepting, whether the domain name to be loaded is the virtual domain name is judged, if not, the domain name is directly loaded, if the domain name is the virtual domain name, a response message is constructed to store the file flow corresponding to the virtual domain name, the file flow is sent to the webpage end, the local attribute of the local files is hidden, and the purpose of improving the safety when the local files are transmitted to the webpage end is achieved.
Drawings
Fig. 1 is a schematic flowchart of a local file loading method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a local side file loading apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing a local file loading method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a local side file loading method. The execution subject of the local-side file loading method includes, but is not limited to, at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the local side file loading method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flowchart of a local file loading method according to an embodiment of the present invention. In this embodiment, the local side file loading method includes:
and S1, sequentially reading the local files to obtain the file streams of the local files.
In the embodiment of the invention, the local file is a file pre-stored on a computer hard disk or a mobile hard disk, and compared with a webpage file, the local file is a storage file which is more convenient for a user to classify, search and call.
In the embodiment of the invention, the local files are sequentially read according to the preset file transmission instruction, and the file transmission instruction can be sent by a computer system for a user based on the purpose of transmitting the local files to the webpage end, and can also be sent by the computer system for solving the problem provided by the user.
Further, the file stream (filestream) of the local file is a stream composed of files transmitted in a data transmission channel, and the local file can be transmitted to the web page side by converting the local file into the file stream.
S2, storing the file stream into a preset storage space in a binary form, and constructing a storage path of the file stream in the storage space.
In the embodiment of the present invention, the storage space is a storage space preset by a user or a computer system, and further, the storage space may be a sandbox, which is an environment for performing isolation protection on storage and invocation of a file.
In detail, the storing the file stream into a preset storage space in a binary form includes:
acquiring the file type of a local end file corresponding to the file stream;
calling a preset file editor according to the file type;
and carrying out binarization operation on the file stream by using the file editor to obtain a binarization numerical value of the file stream, and storing the binarization numerical value of the file stream into the storage space.
The file editor is used for selecting according to the file category of the local end file. The file categories include text files, video files, and the like. For example, when the local file is a text file, a binary operation may be performed on a file stream of the local file by using an Ultra Edit text editor, and if the local file is a video file, a video frame and a video picture of the video file may be acquired by using an OpenCV computer vision library, and then the video frame is read into a binary file stream by using a binary reader file in C language.
Specifically, the constructing a storage path of the file stream in the storage space includes:
acquiring an original file name, a timestamp and a suffix name of a local file corresponding to the file stream;
and constructing a storage path of the file stream in the storage space according to the original file name, the timestamp and the suffix name.
In the embodiment of the invention, the timestamp is an identifier for authenticating the generation time of the file stream by a certain technical means so as to verify whether the file stream is tampered after being generated. The suffix name is a file extension, which is a mechanism used by a computer system to label the file type of the file stream, for example, exe is an executable file, txt is a text file, etc.
And S3, mapping the storage path into a virtual domain name according to a preset mapping table, and storing the virtual domain name in a preset webpage interceptor.
In this embodiment of the present invention, the preset mapping table is a mapping table of a conversion relationship between the storage path and the virtual domain name.
In detail, the mapping the storage path to a virtual domain name according to a preset mapping table includes;
acquiring the original file name, the timestamp and the suffix name in the storage path;
and mapping the original file name, the timestamp and the suffix name by using the preset mapping table to obtain an identifier, a file name code, a compression identifier, a file sequence index, a file timestamp and a file suffix name, and constructing the virtual domain name.
In the embodiment of the present invention, the web page interceptor may also be referred to as a website interceptor or a website interceptor, etc. is used to prevent a user and a web browser on a specific computer from accessing some websites. The virtual domain name is stored in the webpage interceptor, so that after the webpage end receives the domain name to be loaded, the webpage interceptor intercepts and classifies the domain name to be loaded, whether the domain name to be loaded is the virtual domain name is judged, the domain name to be loaded can be intercepted and classified, and the aim of secretly transmitting the local file to the webpage end is fulfilled.
And S4, when the webpage end receives the domain name to be loaded, judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor.
In the embodiment of the invention, the webpage end, namely the Web end, is a platform for bearing various website applications.
In the embodiment of the present invention, the virtual domain name is obtained by mapping a file path through the mapping table, and further, the storage path of a file stream corresponding to the virtual domain name can be queried by querying the mapping table through the interceptor.
In the embodiment of the present invention, determining whether the domain name to be loaded matches the virtual domain name stored in the web page interceptor includes:
acquiring a fixed identifier of the domain name to be loaded through the webpage interceptor;
if the domain name to be loaded contains the fixed identifier, the domain name to be loaded is a virtual domain name and a virtual domain name corresponding to the domain name to be loaded in the webpage interceptor is obtained;
and if the domain name to be loaded does not contain the fixed identifier, the domain name to be loaded is not a virtual domain name and is a real loadable domain name.
Specifically, the fixed identifier is a symbol or a character string used for identifying a certain element in the virtual domain name, for example, a fixed identifier pac-interrupt exists in the virtual domain name.
And if the domain name to be loaded is not matched with the virtual domain name, executing S5 and loading the display page corresponding to the domain name to be loaded to the webpage end.
In the embodiment of the invention, the display page is a webpage display page obtained by loading the domain name to be loaded on the webpage end.
In one embodiment of the present invention, after the displaying the display page corresponding to the domain name to be loaded is displayed at the web page end, the method further includes: and sequencing the display pages loaded by the webpage end by using a page sequencing method.
In detail, the sorting the display pages loaded by the webpage end by using a page sorting method includes:
acquiring an incoming chain and an outgoing chain of the display page and a page ranking value of a webpage corresponding to the incoming chain;
calculating the page ranking value of the display page by using a page ranking method according to the incoming chain and the outgoing chain of the display page and the page ranking value of the webpage corresponding to the incoming chain;
and sequencing the display pages according to the page sequencing values of the display pages.
Further, the calculating the page rank value of the display page by using a page rank method includes:
calculating a page sorting value PR (u) of the display page by using the following page sorting formula:
Figure GDA0003555270830000071
wherein L (v) is the number of out-links of the display page, BuAnd PR (v) is a page ranking value of the webpage corresponding to the incoming chain.
In the embodiment of the present invention, the in-link is a link pointing to the display page, the out-link is a link on the display page, and the page ranking value is a value used for ranking the importance of the page.
If the domain name to be loaded is the virtual domain name, executing S6, constructing a response packet according to the web page end, storing the file stream corresponding to the virtual domain name by using the response packet, and loading the file stream corresponding to the virtual domain name to the web page end through the response packet.
The message is a data unit exchanged and transmitted in the network, the message contains complete data information to be sent, and the length is not limited and is variable.
In this embodiment of the present invention, the constructing a response packet according to the web page includes:
acquiring a response head, a response body and a response code of the webpage end;
and constructing a response message of the webpage end by using the response head, the response body and the response code.
In the embodiment of the present invention, the response message includes a response code, and after the file stream is stored in the response code, the web page terminal may call the file stream data by calling the response code of the response message.
Further, after the file stream corresponding to the virtual domain name is loaded to the web page end through the response packet, the method may also include sorting the display pages loaded by the web page end by using a page sorting method as described in S5. Since the above S5 has described a detailed implementation means for sorting the display pages loaded by the web page end by using the page sorting method, details are not described here.
In the embodiment of the invention, the local files are sequentially read according to the file transmission instruction to obtain the file flow of the local files, the file flow is stored in the preset storage space and the storage path of the file flow is created, the storage path of the local files can be hidden, the storage path of the file flow is mapped into the virtual domain name through the preset mapping table, the virtual domain name is sent to the preset webpage interceptor, when the webpage loads the domain name to be loaded, the webpage interceptor is used for intercepting, whether the domain name to be loaded is the virtual domain name is judged, if not, the domain name is directly loaded, if the domain name is the virtual domain name, a response message is constructed to store the file flow corresponding to the virtual domain name, the file flow is sent to the webpage end, the local attribute of the local files is hidden, and the purpose of improving the safety of the local files when the local files are transmitted to the webpage end is achieved.
Fig. 2 is a schematic block diagram of a local file loading apparatus according to the present invention.
The local side file loading apparatus 100 of the present invention can be installed in an electronic device. According to the implemented functions, the local side file loading device may include a file reading module 101, a file storage module 102, a virtual domain name generation module 103, a domain name interception module 104, and a domain name loading module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the file reading module 101 is configured to sequentially read local side files to obtain a file stream of the local side files.
In the embodiment of the invention, the local file is a file pre-stored on a computer hard disk or a mobile hard disk, and compared with a webpage file, the local file is a storage file which is more convenient for a user to classify, search and call.
In the embodiment of the invention, the local files are sequentially read according to the preset file transmission instruction, and the file transmission instruction can be sent by a computer system for a user based on the purpose of transmitting the local files to the webpage end, and can also be sent by the computer system for solving the problem provided by the user.
Further, the file stream (filestream) of the local file is a stream composed of files transmitted in a data transmission channel, and the local file can be transmitted to the web page side by converting the local file into the file stream.
The file storage module 102 is configured to store the file stream into a preset storage space in a binary form, and construct a storage path of the file stream in the storage space.
In the embodiment of the present invention, the storage space is a storage space preset by a user or a computer system, and further, the storage space may be a sandbox, which is an environment for performing isolation protection on storage and invocation of a file.
In detail, the storing the file stream into a preset storage space in a binary form includes:
acquiring the file type of a local end file corresponding to the file stream;
calling a preset file editor according to the file type;
and carrying out binarization operation on the file stream by using the file editor to obtain a binarization numerical value of the file stream, and storing the binarization numerical value of the file stream into the storage space.
The file editor is used for selecting according to the file category of the local end file. The file categories include text files, video files, and the like. For example, when the local file is a text file, a binary operation may be performed on a file stream of the local file by using an Ultra Edit text editor, and if the local file is a video file, a video frame and a video picture of the video file may be acquired by using an OpenCV computer vision library, and then the video frame is read into a binary file stream by using a binary reader file in C language.
Specifically, the constructing a storage path of the file stream in the storage space includes:
acquiring an original file name, a timestamp and a suffix name of a local file corresponding to the file stream;
and constructing a storage path of the file stream in the storage space according to the original file name, the timestamp and the suffix name.
In the embodiment of the invention, the timestamp is an identifier for authenticating the generation time of the file stream by a certain technical means so as to verify whether the file stream is tampered after being generated. The suffix name is a file extension, which is a mechanism used by a computer system to label the file type of the file stream, for example, exe is an executable file, txt is a text file, etc.
The virtual domain name generating module 103 is configured to map the storage path into a virtual domain name according to a preset mapping table, and store the virtual domain name in a preset web page interceptor.
In this embodiment of the present invention, the preset mapping table is a mapping table of a conversion relationship between the storage path and the virtual domain name.
In detail, the mapping the storage path to a virtual domain name according to a preset mapping table includes;
acquiring the original file name, the timestamp and the suffix name in the storage path;
and mapping the original file name, the timestamp and the suffix name by using the preset mapping table to obtain an identifier, a file name code, a compression identifier, a file sequence index, a file timestamp and a file suffix name, and constructing the virtual domain name.
In the embodiment of the present invention, the web page interceptor may also be referred to as a website interceptor or a website interceptor, etc. is used to prevent a user and a web browser on a specific computer from accessing some websites. The virtual domain name is stored in the webpage interceptor, so that after the webpage end receives the domain name to be loaded, the webpage interceptor intercepts and classifies the domain name to be loaded, whether the domain name to be loaded is the virtual domain name is judged, the domain name to be loaded can be intercepted and classified, and the aim of secretly transmitting the local file to the webpage end is fulfilled.
The domain name intercepting module 104 is configured to, when the web page end receives the domain name to be loaded, determine whether the domain name to be loaded matches the virtual domain name stored in the web page interceptor.
In the embodiment of the invention, the webpage end, namely the Web end, is a platform for bearing various website applications.
In the embodiment of the present invention, the virtual domain name is obtained by mapping a file path through the mapping table, and further, the storage path of a file stream corresponding to the virtual domain name can be queried by querying the mapping table through the interceptor.
In the embodiment of the present invention, determining whether the domain name to be loaded matches the virtual domain name stored in the web page interceptor includes:
acquiring a fixed identifier of the domain name to be loaded through the webpage interceptor;
if the domain name to be loaded contains the fixed identifier, the domain name to be loaded is a virtual domain name and a virtual domain name corresponding to the domain name to be loaded in the webpage interceptor is obtained;
and if the domain name to be loaded does not contain the fixed identifier, the domain name to be loaded is not a virtual domain name and is a real loadable domain name.
Specifically, the fixed identifier is a symbol or a character string used for identifying a certain element in the virtual domain name, for example, a fixed identifier pac-interrupt exists in the virtual domain name.
The domain name loading module 105 is configured to load a display page corresponding to the domain name to be loaded to the web page end if the domain name to be loaded is not matched with the virtual domain name, construct a response packet according to the web page end if the domain name to be loaded is matched with the virtual domain name, store a file stream corresponding to the virtual domain name by using the response packet, and load the file stream corresponding to the virtual domain name to the web page end through the response packet.
In the embodiment of the invention, the display page is a webpage display page obtained by loading the domain name to be loaded on the webpage end.
In one embodiment of the present invention, after the displaying the display page corresponding to the domain name to be loaded is displayed at the web page end, the method further includes: and sequencing the display pages loaded by the webpage end by using a page sequencing method.
In detail, the sorting the display pages loaded by the webpage end by using a page sorting method includes:
acquiring an incoming chain and an outgoing chain of the display page and a page ranking value of a webpage corresponding to the incoming chain;
calculating the page ranking value of the display page by using a page ranking method according to the incoming chain and the outgoing chain of the display page and the page ranking value of the webpage corresponding to the incoming chain;
and sequencing the display pages according to the page sequencing values of the display pages.
Further, the calculating the page rank value of the display page by using a page rank method includes:
calculating a page sorting value PR (u) of the display page by using the following page sorting formula:
Figure GDA0003555270830000111
wherein L (v) is the number of out-links of the display page, BuAnd PR (v) is a page ranking value of the webpage corresponding to the incoming chain.
In the embodiment of the present invention, the in-link is a link pointing to the display page, the out-link is a link on the display page, and the page ranking value is a value used for ranking the importance of the page.
The message is a data unit exchanged and transmitted in the network, the message contains complete data information to be sent, and the length is not limited and is variable.
In this embodiment of the present invention, the constructing a response packet according to the web page includes:
acquiring a response head, a response body and a response code of the webpage end;
and constructing a response message of the webpage end by using the response head, the response body and the response code.
In the embodiment of the present invention, the response message includes a response code, and after the file stream is stored in the response code, the web page terminal may call the file stream data by calling the response code of the response message.
In the embodiment of the invention, the local files are sequentially read according to the file transmission instruction to obtain the file flow of the local files, the file flow is stored in the preset storage space and the storage path of the file flow is created, the storage path of the local files can be hidden, the storage path of the file flow is mapped into the virtual domain name through the preset mapping table, the virtual domain name is sent to the preset webpage interceptor, when the webpage loads the domain name to be loaded, the webpage interceptor is used for intercepting, whether the domain name to be loaded is the virtual domain name is judged, if not, the domain name is directly loaded, if the domain name is the virtual domain name, a response message is constructed to store the file flow corresponding to the virtual domain name, the file flow is sent to the webpage end, the local attribute of the local files is hidden, and the purpose of improving the safety of the local files when the local files are transmitted to the webpage end is achieved.
Fig. 3 is a schematic structural diagram of an electronic device implementing a local file loading method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a local side file loader, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., executing a local file loader, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a local file loader, etc., but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The local side file loader stored in the memory 11 of the electronic device is a combination of computer programs, and when running in the processor 10, can realize:
sequentially reading local files to obtain a file stream of the local files;
storing the file stream into a preset storage space in a binary form, and constructing a storage path of the file stream in the storage space;
mapping the storage path into a virtual domain name according to a preset mapping table, and storing the virtual domain name in a preset webpage interceptor;
when the webpage end receives the domain name to be loaded, judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor;
if the domain name to be loaded is not matched with the virtual domain name, loading a display page corresponding to the domain name to be loaded to the webpage end;
and if the domain name to be loaded is matched with the virtual domain name, constructing a response message according to the webpage end, storing the file stream corresponding to the virtual domain name by using the response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a non-volatile computer-readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
sequentially reading local files to obtain a file stream of the local files;
storing the file stream into a preset storage space in a binary form, and constructing a storage path of the file stream in the storage space;
mapping the storage path into a virtual domain name according to a preset mapping table, and storing the virtual domain name in a preset webpage interceptor;
when the webpage end receives the domain name to be loaded, judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor;
if the domain name to be loaded is not matched with the virtual domain name, loading a display page corresponding to the domain name to be loaded to the webpage end;
and if the domain name to be loaded is matched with the virtual domain name, constructing a response message according to the webpage end, storing the file stream corresponding to the virtual domain name by using the response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for loading a local side file is characterized by comprising the following steps:
sequentially reading local files to obtain a file stream of the local files;
storing the file stream into a preset storage space in a binary form, and constructing a storage path of the file stream in the storage space;
mapping the storage path into a virtual domain name according to a preset mapping table, and storing the virtual domain name in a preset webpage interceptor;
when the webpage end receives the domain name to be loaded, judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor;
if the domain name to be loaded is not matched with the virtual domain name, loading a display page corresponding to the domain name to be loaded to the webpage end;
and if the domain name to be loaded is matched with the virtual domain name, constructing a response message according to the webpage end, storing the file stream corresponding to the virtual domain name by using the response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message.
2. The local-end file loading method according to claim 1, wherein the storing the file stream in a binary form into a preset storage space comprises:
acquiring the file type of a local end file corresponding to the file stream;
calling a preset file editor according to the file type;
and carrying out binarization operation on the file stream by using the file editor to obtain a binarization numerical value of the file stream, and storing the binarization numerical value of the file stream into the storage space.
3. The local-end file loading method according to claim 1, wherein the constructing a storage path of the file stream in the storage space comprises:
acquiring an original file name, a timestamp and a suffix name of a local file corresponding to the file stream;
and constructing a storage path of the file stream in the storage space according to the original file name, the timestamp and the suffix name.
4. The local-end file loading method according to claim 1, wherein the constructing a response packet according to the web page end includes:
acquiring a response head, a response body and a response code of the webpage end;
and constructing a response message of the webpage end by using the response head, the response body and the response code.
5. The local-side file loading method according to claim 1, wherein after the display page corresponding to the domain name to be loaded is loaded to the web page side, the method further comprises:
and sequencing the display pages loaded by the webpage end by using a page sequencing method.
6. The method of claim 5, wherein the sorting the display pages loaded by the web page side using a page sorting method comprises:
acquiring an incoming chain and an outgoing chain of the display page and a page ranking value of a webpage corresponding to the incoming chain;
calculating the page ranking value of the display page by using a page ranking method according to the incoming chain and the outgoing chain of the display page and the page ranking value of the webpage corresponding to the incoming chain;
and sequencing the display pages according to the page sequencing values of the display pages.
7. The method of claim 6, wherein calculating the page rank value of the display page using a page rank method comprises:
calculating a page sorting value PR (u) of the display page by using the following page sorting formula:
Figure FDA0003555270820000021
wherein L (v) is the number of out-links of the display page, BuAnd PR (v) is a page ranking value of the webpage corresponding to the incoming chain.
8. A local side file loading apparatus, comprising:
the file reading module is used for sequentially reading local files to obtain a file stream of the local files;
the file storage module is used for storing the file stream into a preset storage space in a binary mode and constructing a storage path of the file stream in the storage space;
the virtual domain name generation module is used for mapping the storage path into a virtual domain name according to a preset mapping table and storing the virtual domain name in a preset webpage interceptor;
the domain name interception module is used for judging whether the domain name to be loaded is matched with the virtual domain name stored in the webpage interceptor or when the webpage end receives the domain name to be loaded;
and the domain name loading module is used for loading the display page corresponding to the domain name to be loaded to the webpage end if the domain name to be loaded is not matched with the virtual domain name, constructing a response message according to the webpage end if the domain name to be loaded is matched with the virtual domain name, storing the file stream corresponding to the virtual domain name by using the response message, and loading the file stream corresponding to the virtual domain name to the webpage end through the response message.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the local side file loading method of any one of claims 1 to 7.
10. A computer-readable storage medium comprising a storage data area storing created data and a storage program area storing a computer program; wherein the computer program when executed by a processor implements the local side file loading method as claimed in any one of claims 1 to 7.
CN202110693065.9A 2021-06-22 2021-06-22 Local end file loading method and device, electronic equipment and medium Active CN113438221B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110693065.9A CN113438221B (en) 2021-06-22 2021-06-22 Local end file loading method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110693065.9A CN113438221B (en) 2021-06-22 2021-06-22 Local end file loading method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN113438221A CN113438221A (en) 2021-09-24
CN113438221B true CN113438221B (en) 2022-04-29

Family

ID=77757096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110693065.9A Active CN113438221B (en) 2021-06-22 2021-06-22 Local end file loading method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113438221B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107528718A (en) * 2016-08-16 2017-12-29 腾讯科技(深圳)有限公司 Obtain the methods, devices and systems of resource
CN110874445A (en) * 2018-08-31 2020-03-10 中国移动通信集团浙江有限公司 Webpage loading method, client and business service center

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060206586A1 (en) * 2005-03-09 2006-09-14 Yibei Ling Method, apparatus and system for a location-based uniform resource locator
CN110765084A (en) * 2019-11-06 2020-02-07 杭州求是优脉科技有限公司 Picture uploading method and system, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107528718A (en) * 2016-08-16 2017-12-29 腾讯科技(深圳)有限公司 Obtain the methods, devices and systems of resource
CN110874445A (en) * 2018-08-31 2020-03-10 中国移动通信集团浙江有限公司 Webpage loading method, client and business service center

Also Published As

Publication number Publication date
CN113438221A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN113489704A (en) Sensitive data identification method and device based on flow, electronic equipment and medium
CN114185895A (en) Data import and export method and device, electronic equipment and storage medium
CN115081016A (en) Log desensitization method and device, electronic equipment and storage medium
CN113239106B (en) Excel file export method and device, electronic equipment and storage medium
CN114844792A (en) Dynamic monitoring method, device, equipment and storage medium based on LUA language
CN114491646A (en) Data desensitization method and device, electronic equipment and storage medium
CN112486490B (en) Front-end code packaging method and device, electronic equipment and storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN112104662B (en) Far-end data read-write method, device, equipment and computer readable storage medium
CN113382017A (en) Permission control method and device based on white list, electronic equipment and storage medium
CN113032275A (en) Method and device for testing field, electronic equipment and storage medium
CN113051224A (en) File transmission method and device, electronic equipment and computer readable storage medium
CN113438221B (en) Local end file loading method and device, electronic equipment and medium
CN114911479A (en) Interface generation method, device, equipment and storage medium based on configuration
CN114840388A (en) Data monitoring method and device, electronic equipment and storage medium
CN113364848A (en) File caching method and device, electronic equipment and storage medium
CN113704109B (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN113703995B (en) Front-end and back-end data interaction method and device, electronic equipment and storage medium
CN113810414B (en) Mobile client domain name filtering method and device, electronic equipment and storage medium
CN114942855A (en) Interface calling method and device, electronic equipment and storage medium
CN112667570A (en) File access method, device, equipment and readable storage medium
CN114006877A (en) Message transmission method and device, electronic equipment and storage medium
CN114416575A (en) Method, device and equipment for generating Mock data and storage medium
CN115174555A (en) File transmission method and device, electronic equipment and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20211015

Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant after: Shenzhen saiante Technology Service Co.,Ltd.

Address before: 1-34 / F, Qianhai free trade building, 3048 Xinghai Avenue, Mawan, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong 518000

Applicant before: Ping An International Smart City Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant