TWI672019B - Method and device for calling a file - Google Patents

Method and device for calling a file Download PDF

Info

Publication number
TWI672019B
TWI672019B TW106102210A TW106102210A TWI672019B TW I672019 B TWI672019 B TW I672019B TW 106102210 A TW106102210 A TW 106102210A TW 106102210 A TW106102210 A TW 106102210A TW I672019 B TWI672019 B TW I672019B
Authority
TW
Taiwan
Prior art keywords
resource file
debugged
file
virtual server
access path
Prior art date
Application number
TW106102210A
Other languages
Chinese (zh)
Other versions
TW201735583A (en
Inventor
辜志豪
Original Assignee
香港商阿里巴巴集團服務有限公司
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 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW201735583A publication Critical patent/TW201735583A/en
Application granted granted Critical
Publication of TWI672019B publication Critical patent/TWI672019B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本發明實施例提供一種調用文件方法及裝置,該方法當接收到針對https網頁中網路資源文件的替換指令時,根據該替換指令,在本地建立虛擬伺服器,並通過該虛擬伺服器,將存取該網路資源文件的存取路徑替換為存取本地的待調試資源文件的存取路徑,之後為該虛擬伺服器產生根證書以及子證書,使得當本地瀏覽器根據http網頁發起對該網路資源文件的調用請求時,由該虛擬伺服器接收該調用請求,並向該瀏覽器返回該待調試資源文件以及該子證書,使得該瀏覽器根據該子證書調用並執行該待調試資源文件。通過上述方法,由於為虛擬伺服器產生了可向該瀏覽器提供根證書以及子證書,使該瀏覽器可正常調用該待調試資源文件。 Embodiments of the present invention provide a method and a device for invoking a file. When a replacement instruction for a network resource file in an https webpage is received, a virtual server is locally established according to the replacement instruction, and the virtual server is used to pass the virtual server. The access path for accessing the network resource file is replaced with the access path for accessing the local resource file to be debugged, and then a root certificate and a sub-certificate are generated for the virtual server, so that when the local browser initiates the When the network resource file is called, the virtual server receives the calling request and returns the resource file to be debugged and the sub-certificate to the browser, so that the browser calls and executes the resource to be debugged according to the sub-certificate. file. Through the above method, since a virtual server is provided with a root certificate and a sub-certificate that can be provided to the browser, the browser can normally call the resource file to be debugged.

Description

調用文件之方法與裝置 Method and device for calling file

本發明係關於資訊技術領域,尤其關於一種調用文件方法及裝置。 The present invention relates to the field of information technology, and in particular, to a method and device for calling a file.

在現今的資訊化社會中,網路成為人們生活和工作中不可或缺的一部分。人們在瀏覽網頁時,一般是通過瀏覽器(或者,具有瀏覽器內核的應用)與伺服器建立通信連接,以使得該瀏覽器可向該伺服器發送獲取網頁頁面的請求,並在獲得該伺服器返回的網頁頁面後,顯示該網頁頁面。 In today's information society, the Internet has become an integral part of people's lives and work. When people browse a webpage, they usually establish a communication connection with the server through a browser (or an application with a browser kernel), so that the browser can send a request to the server to obtain a webpage page and obtain the server. After the browser returns the web page, the web page is displayed.

由於,網頁是由一組代碼構成的(如,由html5代碼構成),並且該網頁的代碼指向各類資源文件(如,JavaScript程式源文件、網頁的樣式文件等)也是由各自的代碼構成的,但是代碼都是人工編寫的,所以只要是代碼就可能會存在缺陷或者瑕疵。於是,在伺服器向網路提供一個網頁之前(即,將一個網頁上線之前),一般會在離線環境中,先對該網頁中的各個代碼進行測試,即,進行離線測試。 Because the webpage is composed of a set of codes (for example, composed of html5 code), and the code of the webpage points to various resource files (for example, JavaScript program source files, webpage style files, etc.) are also composed of respective codes , But the code is written manually, so as long as the code may have defects or flaws. Therefore, before the server provides a web page to the network (that is, before a web page goes online), generally, each code in the web page is tested in an offline environment, that is, an offline test is performed.

但是,在離線測試時,該伺服器只能使用模擬的線上資料對該網頁進行測試,這就使得離線測試的結果並不一定準確,也就是說通過離線測試確定沒有問題的網頁,在上線後也可能出現問題。則此時,工作人員需要在伺服器端調試該出現問題的資源文件的代碼,但是由於伺服器一般比較繁忙,在該伺服器中執行該調試操作的業務可能需要排隊等待,直到有空閒線程來執行該調試操作業務,所以導致每一次調試該出現問題的資源文件的代碼所需要的時間較長。並且,由於通常情況下僅靠一次調試很難解決該資源文件的代碼中存在的問題,需要進行多次調試,所以進一步使得調試解決問題所需的時間增加(尤其是在對儲存於其他伺服器中的資源文件進行調試時,還需要浪費大量的傳輸時間)。基於上述原因,導致工作人員難以對網頁中出現問題的資源文件進行快速、方便的調試。 However, during offline testing, the server can only test the webpage using simulated online data, which makes the results of offline testing not necessarily accurate. Problems may also occur. At this time, the worker needs to debug the code of the resource file in question on the server side, but since the server is generally busy, the business that performs the debugging operation in the server may need to wait in line until an idle thread comes This debugging operation is performed, so that it takes a long time to debug each time the code of the problematic resource file. In addition, because it is difficult to solve the problems in the code of the resource file by only one debugging under normal circumstances, multiple debugging is required, which further increases the time required for debugging and solving the problem (especially when it is stored on other servers). When debugging the resource files in the system, a lot of transmission time is also wasted). Based on the above reasons, it is difficult for the staff to quickly and conveniently debug the resource files that have problems in the web page.

於是,在現有技術中,針對網頁中需要調試的資源文件,採用http代理的方法,將需要調試的資源文件映射到終端本地,以便後續可以利用真實的線上資料,對該資源文件進行調試,其中,http代理方法具體如圖1所示。 Therefore, in the prior art, for resource files that need to be debugged on a webpage, the http proxy method is used to map the resource files that need to be debugged to the terminal locally, so that the resource files can be debugged later using real online data, where The http proxy method is shown in Figure 1.

圖1為現有技術http代理的方法,具體包括:S101:確定網頁中需要調試的資源文件,並下載所述資源文件,作為待調試資源文件。 FIG. 1 is a prior art method of http proxy, which specifically includes: S101: Determine a resource file to be debugged in a webpage, and download the resource file as a resource file to be debugged.

由於http代理方法,是希望工作人員可以在終端本地完成對該資源文件的調試,所以首先該端需要確定網頁中需要調試的資源文件,再將該文件下載到該終端本地,作 為待調試資源文件,以便後續可以對該待調試資源文件進行調試。 Because the http proxy method hopes that the staff can complete the debugging of the resource file locally on the terminal, first the terminal needs to determine the resource file that needs to be debugged in the web page, and then download the file to the terminal locally for Is the resource file to be debugged so that the resource file to be debugged can be debugged later.

S102:建立虛擬伺服器,並為該待調試資源文件確定存取路徑。 S102: Establish a virtual server, and determine an access path for the resource file to be debugged.

該待調試資源文件需要通過本地瀏覽器獲取。具體的,該瀏覽器通過運行網頁中的代碼,先獲得該待調試資源文件的存取路徑(即,該待調試資源文件的域名),再根據所述存取路徑,向提供該待調試資源文件的伺服器發起調用該資源文件的請求,最後獲得該伺服器返回的該待調試資源文件。 The resource file to be debugged needs to be obtained through a local browser. Specifically, the browser first obtains the access path of the resource file to be debugged (that is, the domain name of the resource file to be debugged) by running the code in the webpage, and then provides the resource to be debugged according to the access path. The server of the file initiates a request to call the resource file, and finally obtains the resource file to be debugged returned by the server.

但是,由於工作人員希望能通過在本地直接修改該待調試資源文件,所以此時,該終端還需要偽裝成為伺服器,以欺騙該瀏覽器,讓該瀏覽器通過運行同樣的網頁代碼,獲取本地已下載的該待調試資源文件。以實現,在該終端本地調試該待調試資源文件的目的。 However, because the staff wants to modify the resource file to be debugged directly locally, at this time, the terminal also needs to disguise itself as a server to deceive the browser and let the browser obtain the local content by running the same web page code. The downloaded resource file to be debugged. In order to achieve the purpose of locally debugging the resource file to be debugged on the terminal.

具體的,該終端需要在本地建立虛擬伺服器,並為儲存在本地的該待調試資源文件確定存取路徑(即,該待調試資源文件的虛擬域名)。 Specifically, the terminal needs to establish a local virtual server and determine an access path (ie, a virtual domain name of the resource file to be debugged) stored locally on the resource file to be debugged.

S103:通過所述虛擬伺服器,將存取原資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 S103: Replace the access path for accessing the original resource file with the access path for accessing the local resource file to be debugged through the virtual server.

為了使該終端中的瀏覽器在通過網頁代碼存取該資源文件時,不再存取該資源文件的伺服器,而是存取本地的虛擬伺服器。此時,還需要對該終端的網路配置進行修改,以使得該終端在接收到該瀏覽器發起的調用該資源文 件的請求時,將存取該資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 In order that when the browser in the terminal accesses the resource file through the webpage code, it no longer accesses the server of the resource file, but accesses the local virtual server. At this time, it is also necessary to modify the network configuration of the terminal so that the terminal receives the call to the resource file initiated by the browser. When a file is requested, the access path for accessing the resource file is replaced with the access path for accessing the local resource file to be debugged.

使得當該瀏覽器向網路上的伺服器發送調用該資源文件的請求時,該虛擬伺服器替代該網路上的伺服器接收該調用請求,並將該待調試資源文件返回給該伺服器,並使該瀏覽器確定接收到的是網路上對應伺服器返回的資源文件。 When the browser sends a request for calling the resource file to a server on the network, the virtual server receives the call request instead of the server on the network, and returns the resource file to be debugged to the server, and Make the browser determine that it received the resource file returned by the corresponding server on the network.

通過圖1所述的方法,可將該需要調試的資源文件下載到本地後,作為待調試資源文件,在該終端本地對該待調試資源文件經行調試,並且由於該網頁中代碼並沒有改動,所以可以充分的利用線上的真實資料進行調試。進一步的,由於該終端可僅用於調試該待調試資源文件,所以每一次調試過程無需等待可以立刻執行,提高了調試效率。 After downloading the resource file to be debugged locally by using the method described in FIG. 1 as the resource file to be debugged, the terminal debugs the resource file to be debugged locally, and the code in the webpage has not been changed. , So you can make full use of the real data online for debugging. Further, since the terminal can only be used for debugging the resource file to be debugged, each debugging process can be executed immediately without waiting, thereby improving debugging efficiency.

但是,圖1所示的過程僅可針對網頁為超文本傳輸協議(Hyper Text Transfer Protocol,http)的網頁實現。對於網頁為安全套接字層超文本傳輸協議(Hyper Text Transfer Protocol over Secure Socket Layer,https)的網頁而言,此時瀏覽器與伺服器間的傳輸需要進行通信加密,即,該瀏覽器需要利用安全套接字層協議(Secure Socket Layer,ssl)協議產生的安全證書來驗證伺服器的身份,並在接收伺服器返回的資源文件時,需要驗證該資源文件是否攜帶了對應的安全證書。 However, the process shown in FIG. 1 can only be implemented for a web page whose web page is a Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, http). For web pages that are Hyper Text Transfer Protocol over Secure Socket Layer (https), the communication between the browser and the server at this time needs to be encrypted for communication, that is, the browser needs The security certificate generated by the Secure Socket Layer (SSL) protocol is used to verify the identity of the server, and when receiving the resource file returned by the server, it is necessary to verify whether the resource file carries the corresponding security certificate.

但是,由於在圖1所示的過程中,該虛擬伺服器沒有 安全證書,也無法提供安全證書,則該瀏覽器既無法驗證該虛擬伺服器的身份,也無法確定接收到該虛擬伺服器返回的該待調試資源文件的安全性,那麼對於https網頁來說,該瀏覽器甚至無法調用該待調試資源文件,也就使得工作人員無法進行後續調試工作。 However, since the virtual server does not have If the security certificate cannot provide a security certificate, the browser can neither verify the identity of the virtual server nor determine the security of the resource file to be debugged received by the virtual server. For the https page, The browser cannot even call the resource file to be debugged, which makes the staff unable to perform subsequent debugging work.

可見,現有技術中,由於沒有安全證書,導致難以進行https網頁的代理,無法調用待調試資源文件的問題。 It can be seen that in the prior art, because there is no security certificate, it is difficult to proxy the https webpage, and the problem that the resource file to be debugged cannot be called.

本發明實施例提供一種調用文件方法及裝置,用以解決現有調用文件方法,採用的http代理方式,由於無法提供安全證書,導致瀏覽器無法調用待調試資源文件的問題。 Embodiments of the present invention provide a method and a device for invoking a file, which are used to solve an existing method for invoking a file. The http proxy method adopted in the method fails to provide a security certificate, which causes the browser to fail to call a resource file to be debugged.

本發明實施例提供的一種調用文件方法,包括:接收針對https網頁中網路資源文件的替換指令;根據所述替換指令,在本地建立虛擬伺服器;通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;為所述虛擬伺服器產生根證書;根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根 據所述子證書,獲取並執行所述待調試資源文件。 A method for invoking a file provided by an embodiment of the present invention includes: receiving a replacement instruction for a network resource file in an https webpage; establishing a virtual server locally according to the replacement instruction; The access path of the network resource file is replaced with the access path of the local resource file to be debugged; a root certificate is generated for the virtual server; a sub-certificate is generated according to the root certificate, so that when the local browser When the https webpage initiates a call request for the network resource file, the virtual server receives the call request and sends the call request to the browser according to an access path replaced by a local resource file to be debugged. Return the resource file to be debugged and the sub-certificate, so that the browser root Obtaining and executing the resource file to be debugged according to the sub-certificate.

本發明實施例提供的一種調用文件裝置,包括:接收模組,用於接收https網頁中網路資源文件的替換指令;執行模組,用於根據所述替換指令,在本地建立虛擬伺服器;替換模組,用於通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;根證書模組,用於為所述虛擬伺服器產生根證書;子證書模組,用於根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。 An embodiment of the present invention provides a file calling device, including: a receiving module for receiving a replacement instruction of a network resource file in an https webpage; an execution module for establishing a virtual server locally according to the replacement instruction; A replacement module for replacing an access path for accessing the network resource file with an access path for accessing a resource file to be debugged locally through the virtual server; a root certificate module for the The virtual server generates a root certificate; a sub-certificate module is configured to generate a sub-certificate according to the root certificate, so that when a local browser initiates a call request for the network resource file according to the https webpage, the The virtual server receives the invocation request, and returns the resource file to be debugged and the sub-certificate to the browser according to the access path replaced by accessing the local resource file to be debugged, so that the browser The sub-certificate obtains and executes the resource file to be debugged.

本發明實施例提供一種調用文件方法及裝置,該方法當接收到針對https網頁中網路資源文件的替換指令時,根據該替換指令,在本地建立虛擬伺服器,並通過該虛擬伺服器,將存取該網路資源文件的存取路徑替換為存取本地的待調試資源文件的存取路徑,之後為該虛擬伺服器產生根證書以及子證書,使得當本地瀏覽器根據http網頁發起對該網路資源文件的調用請求時,由該虛擬伺服器接收 該調用請求,並向該瀏覽器返回該待調試資源文件以及該子證書,最終使得該瀏覽器可以根據該子證書,調用並執行該待調試資源文件。通過上述方法,由於為虛擬伺服器產生了根證書以及對應的子證書,使得該虛擬伺服器可向該瀏覽器提供安全證書,使該瀏覽器可正常調用該待調試資源文件。 Embodiments of the present invention provide a method and a device for invoking a file. When a replacement instruction for a network resource file in an https webpage is received, a virtual server is locally established according to the replacement instruction, and the virtual server is used to pass the virtual server. The access path for accessing the network resource file is replaced with the access path for accessing the local resource file to be debugged, and then a root certificate and a sub-certificate are generated for the virtual server, so that when the local browser initiates the When a network resource file is called, it is received by the virtual server The calling request returns the resource file to be debugged and the sub-certificate to the browser, so that the browser can call and execute the resource file to be debugged according to the sub-certificate. Through the above method, since a root certificate and a corresponding sub-certificate are generated for the virtual server, the virtual server can provide a security certificate to the browser, so that the browser can normally call the resource file to be debugged.

301‧‧‧接收模組 301‧‧‧Receiving module

302‧‧‧執行模組 302‧‧‧Execution Module

303‧‧‧替換模組 303‧‧‧ Replacement Module

304‧‧‧根證書模組 304‧‧‧ Root Certificate Module

305‧‧‧子證書模組 305‧‧‧Sub-Certificate Module

306‧‧‧下載模組 306‧‧‧Download Module

此處所說明的附圖用來提供對本發明的進一步理解,構成本發明的一部分,本發明的示意性實施例及其說明用於解釋本發明,並不構成對本發明的不當限定。在附圖中:圖1為現有技術http代理過程;圖2為本發明實施例提供的調用文件過程;圖3是本發明實施例提供一種調用文件裝置的結構示意圖。 The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and the descriptions thereof are used to explain the present invention, and do not constitute an improper limitation on the present invention. In the drawings: FIG. 1 is a prior art http proxy process; FIG. 2 is a file calling process provided by an embodiment of the present invention; and FIG. 3 is a schematic structural diagram of a file calling device provided by an embodiment of the present invention.

在本發明實施例中,在接收到對https網頁中的網路資源的替換指令時,該終端先根據該指令,先在該終端本地建立虛擬伺服器,再通過該虛擬伺服器,將該終端中存取該網路資源文件的存取路徑替換為存取本地的待調試資源文件的存取路徑,最後為該虛擬伺服器產生根證書以及對應的子證書。可見本發明所述的方法,通過為該虛擬伺 服器產生根證書(即,該虛擬伺服器頒發的自簽證書)的方法,使得該虛擬伺服器可以欺騙該瀏覽器,使該瀏覽器確定該虛擬伺服器是提供https網頁中網路資源文件的伺服器,並且,當向該瀏覽器返回本地的待調試資源文件時,可以一併返回由該根證書產生的子證書,使得該瀏覽器確定該待調試資源文件是安全的文件,最終使得該瀏覽器可以調用並執行該待調試資源文件,解決了由於虛擬伺服器無法提供安全證書,導致難以進行https網頁的代理,無法調用待調試資源文件的問題。 In the embodiment of the present invention, when receiving a replacement instruction for a network resource in an https webpage, the terminal firstly establishes a virtual server locally on the terminal according to the instruction, and then passes the virtual server to the terminal. The access path for accessing the network resource file is replaced with the access path for accessing the local resource file to be debugged, and finally a root certificate and a corresponding sub-certificate are generated for the virtual server. It can be seen that the method according to the present invention A method for the server to generate a root certificate (that is, a self-signed certificate issued by the virtual server), so that the virtual server can deceive the browser, and make the browser determine that the virtual server is providing the web resource file in the https web page And when the local resource file to be debugged is returned to the browser, the sub-certificate generated by the root certificate may be returned together, so that the browser determines that the resource file to be debugged is a secure file, and finally makes The browser can call and execute the resource file to be debugged, which solves the problem that because the virtual server cannot provide a security certificate, it is difficult to proxy the https web page, and the resource file to be debugged cannot be called.

為使本發明的目的、技術方案和優點更加清楚,下面將結合本發明具體實施例及相應的附圖對本發明技術方案進行清楚、完整地描述。顯然,所描述的實施例僅是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域習知技術人員在沒有做出具有進步性創作之前提下所獲得的所有其他實施例,都屬本發明保護的範圍。 In order to make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described in combination with specific embodiments of the present invention and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art before making progressive creations fall within the protection scope of the present invention.

圖2為本發明實施例提供的調用文件過程,具體包括以下步驟:S201:接收針對https網頁中網路資源文件的替換指令。 FIG. 2 is a file calling process provided by an embodiment of the present invention, which specifically includes the following steps: S201: Receive a replacement instruction for a network resource file in an https webpage.

由於需要在終端本地對https網頁中的網路資源文件進行調試,所以在調試開始之前,需要先將本地的待調試資源文件替換為該https網頁中的該網路資源文件。但是,由於此時尚未開始對該待調試資源文件的調試,所以 當前的該待調試資源文件可以是任意文件,並可是僅僅擁有文件標識以及地址但是沒有相應的內容的文件(即,是一個空白的文件),並不妨礙後續該待調試資源文件被調用。 Because the network resource file in the https webpage needs to be debugged locally on the terminal, before the debugging starts, the local resource file to be debugged needs to be replaced with the network resource file in the https webpage. However, since the debugging of the resource file to be debugged has not started at this time, The current resource file to be debugged may be any file, and may be a file that only has a file identifier and an address but has no corresponding content (that is, a blank file), which does not prevent the resource file to be debugged from being called subsequently.

於是,在本發明實施例中,該終端可接收針對https網頁中的該網路資源文件的替換指令。 Therefore, in the embodiment of the present invention, the terminal may receive a replacement instruction for the network resource file in the https webpage.

具體的,該替換指令可以是一行命令行,用於使該終端確定需要替換的網路資源文件以及預先保存在本地的待調試資源文件。其中,該替換指令包含:該網路資源文件的標識、該網路資源文件的存取路徑、預先保存在本地的該待調試資源文件的標識及該待調試資源文件的地址。 Specifically, the replacement instruction may be a command line for the terminal to determine a network resource file to be replaced and a resource file to be debugged that is stored locally in advance. The replacement instruction includes: the identification of the network resource file, the access path of the network resource file, the identification of the resource file to be debugged and the address of the resource file to be debugged.

需要說明的是,該終端可以是個人電腦(personal computer,PC)、手機、平板電腦等,該網路資源文件可以是在瀏覽器上運行的java腳本語言(JavaScript,JS)程式源文件、層疊樣式表(Cascading Style Sheets,css)文件等可由伺服器通過統一資源定位符(Uniform Resource Locator,URL)提供的文件。 It should be noted that the terminal may be a personal computer (PC), a mobile phone, a tablet computer, etc., and the network resource file may be a java script language (JavaScript, JS) program source file running on a browser, a cascade Files such as Cascading Style Sheets (css) files can be provided by the server through a Uniform Resource Locator (URL).

例如,假設https網頁A中的音樂播放按鈕,在被點擊後會向瀏覽器返回用於調用本地播放器應用播放音頻文件的JS程式源文件(以下,簡稱音頻JS文件),使該https網頁A通過本地播放器應用播放指定的音頻文件,但是工作人員在該https網頁A上線運行後,發現該音樂播放按鈕在點擊後,該https網頁A並沒有播放音頻文件,於是,該工作人員需要在自己的PC上對該https網 頁A中出現問題的該JS程式源文件。 For example, if the music playback button in the https webpage A is clicked, the JS program source file (hereinafter, referred to as the audio JS file) used to call the local player application to play the audio file is returned to the browser, so that the https webpage A The specified audio file is played through the local player application, but after the staff member runs on the https page A and finds that the music playback button is clicked, the https page A does not play the audio file. Therefore, the staff member needs to PC on the https network The JS program source file where the problem occurred on page A.

進一步假設,該PC接收到了針對該https網頁A中的音頻JS文件(即,網路資源文件)的替換指令,並且該替換指令中包含,該音頻JS文件的標識:a.js、該音頻JS文件的存取路徑:https://www.XX.com/XX/a.js、該PC本地預先保存的待調試資源文件的標識:b.js以及該待調試資源文件的地址:E:\調試工作\待調試文件\b.js。 It is further assumed that the PC receives a replacement instruction for the audio JS file (that is, a network resource file) in the https web page A, and the replacement instruction includes the identifier of the audio JS file: a.js, the audio JS File access path: https://www.XX.com/XX/a.js, the ID of the resource file to be debugged that is pre-saved locally on the PC: b.js, and the address of the resource file to be debugged: E: \ Debugging work \ file to be debugged \ b.js.

S202:根據所述替換指令,在本地建立虛擬伺服器。 S202: Create a virtual server locally according to the replacement instruction.

在本發明實施例中,正常情況下該網路資源文件的調用過程是:該終端中的瀏覽器通過運行該https網頁的代碼,先確定需要調用的網路資源文件的存取路徑,再向儲存該網路資源文件的伺服器發起調用該網路資源文件的請求(即,根據該網路資源文件的存取路徑發起調用請求),最後該瀏覽器接收該伺服器返回的該網路資源文件以及該伺服器提供的子證書,完成對該網路資源文件的調用。 In the embodiment of the present invention, the process of invoking the network resource file is as follows: The browser in the terminal determines the access path of the network resource file to be called by running the code of the https webpage, and then The server storing the web resource file initiates a request to call the web resource file (ie, initiates a call request according to the access path of the web resource file), and finally the browser receives the web resource returned by the server File and the sub-certificate provided by the server to complete the call to the network resource file.

但是在本發明中,由於需要該瀏覽器能調用本地的該待調試資源文件(以便後續可以在該終端本地進行調試),所以還需要為該待調試資源文件提供一個該瀏覽器可以存取的存取路徑。於是在本發明中,需要先將該終端偽裝成儲存該帶調試資源文件的虛擬伺服器,並確定該虛擬伺服器的域名,使得該瀏覽器可以通過該虛擬伺服器的域名存取該虛擬伺服器,以便進行後續為該待調試資源文件產生存取路徑。 However, in the present invention, since the browser needs to be able to call the local resource file to be debugged (so that the terminal can be debugged locally later), it is also necessary to provide the resource file to be debugged with a resource that the browser can access. Access path. Therefore, in the present invention, the terminal needs to be disguised as a virtual server storing the debugging resource file, and the domain name of the virtual server is determined, so that the browser can access the virtual server through the domain name of the virtual server. To generate an access path for the resource file to be debugged.

具體的在該終端本地建立虛擬伺服器的過程與現有技術一致,通過建立該虛擬伺服器以及確定該虛擬伺服器域名,使得該終端中的瀏覽器可以通過該虛擬伺服器的域名存取建立在該終端本地的虛擬伺服器,為該瀏覽器調用保存在本地的該待調試資源文件建立了基礎。 The specific process of establishing a virtual server locally on the terminal is consistent with the prior art. By establishing the virtual server and determining the domain name of the virtual server, the browser in the terminal can access the virtual server through the domain name of the virtual server to establish The local virtual server of the terminal establishes a basis for the browser to call the resource file to be debugged and saved locally.

繼續沿用上例,假設該PC在接收到該替換指令後,在該PC上建立了虛擬伺服器α,並確定其域名為:https://www.YY.com。 Continuing the above example, it is assumed that after the PC receives the replacement instruction, a virtual server α is established on the PC, and its domain name is determined to be: https://www.YY.com.

S203:通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 S203: Replace the access path for accessing the network resource file with the access path for accessing the local resource file to be debugged through the virtual server.

在本發明實施例中,當建立了虛擬伺服器之後,便可為該待調試資源文件產生存取路徑,使該瀏覽器可以根據該待調試資源文件的存取路徑調用該待調試資源文件。但是,此時該瀏覽器根據該https網頁的網頁代碼存取的還是該網路資源文件的路徑,所以還需要將存取該網路資源文件的存取路徑替換為存取該待調試資源文件的存取路徑。 In the embodiment of the present invention, after the virtual server is established, an access path can be generated for the resource file to be debugged, so that the browser can call the resource file to be debugged according to the access path of the resource file to be debugged. However, at this time, the browser accesses the path of the web resource file according to the web page code of the https web page, so the access path to access the web resource file needs to be replaced with the access to the resource file to be debugged. Access path.

具體的,首先根據該虛擬伺服器的域名以及該待調試文件的地址,產生該待調試文件的存取路徑(即,該待調試資源文件的虛擬域名),則此時可以認為該待調試資源文件是儲存於該虛擬伺服器中的文件。 Specifically, first, according to the domain name of the virtual server and the address of the file to be debugged, an access path of the file to be debugged (that is, the virtual domain name of the resource file to be debugged) is then considered as the resource to be debugged at this time. The file is a file stored in the virtual server.

其次,修改該終端的網路配置,將存取該網路資源文件的存取路徑替換為存取該待調試資源文件的存取路徑。 使得當該終端接收到該瀏覽器發送的基於該網路資源文件的存取路徑的存取、調用或查詢請求時,根據上述存取路徑的替換關係,使該虛擬伺服器接收該存取、調用、查詢請求,並且將該存取、調用、查詢請求的目的地指向該待調試資源文件的存取路徑。 Secondly, modify the network configuration of the terminal, and replace the access path for accessing the network resource file with the access path for accessing the resource file to be debugged. When the terminal receives an access, invocation, or query request based on the access path of the network resource file sent by the browser, the virtual server receives the access, Call, query request, and point the destination of the access, call, query request to the access path of the resource file to be debugged.

另外,為了後續調試過程中可以最大程度上利用線上的真實資料運行該https網頁,保證調試結果的可靠性,在本發明中可僅修改針對該網路資源文件的存取路徑為該待調試資源文件的存取路徑,而不改動該瀏覽器發出的針對其他資源文件存取路徑,使得當該瀏覽器在調用該https網頁上的其他資源文件時,根據該https網頁確定的存取路徑沒有被改變,該瀏覽器最終調用的還是網路上的其他資源文件,而當該瀏覽器調用該網路資源文件時,該瀏覽器確定的存取路徑被替換為指向該終端本地的該待調試資源文件,該瀏覽器調用的是本地保存的該待調試資源文件。進而使得在後續的調試過程中,該瀏覽器可以最大程度上使用線上的真實資料,使工作人員僅調試該該調試資源文件。 In addition, in order to run the https webpage with real online data to the greatest extent during subsequent debugging, and to ensure the reliability of the debugging results, in the present invention, only the access path for the network resource file can be modified to the resource to be debugged. File access path without changing the access path for other resource files issued by the browser, so that when the browser calls other resource files on the https page, the access path determined according to the https page is not Change, the browser finally calls other resource files on the network, and when the browser calls the network resource file, the access path determined by the browser is replaced with the resource file to be debugged pointing to the terminal locally. , The browser calls the resource file to be debugged, which is saved locally. Furthermore, in the subsequent debugging process, the browser can use the online real data to the greatest extent, so that the staff can only debug the debugging resource file.

需要說明的是,為該待調試資源產生存取路徑的方法與現有技術相同,可任意為該待調試資源文件產生一個基於該虛擬伺服器域名的存取路徑,並記錄該存取路徑與該待調試資源文件的地址的對應關係,使得該虛擬伺服器可以可根據該存取路徑確定該待調試資源文件。 It should be noted that the method for generating an access path for the resource to be debugged is the same as the prior art. An access path based on the virtual server domain name can be generated for the resource file to be debugged, and the access path and the The correspondence between the addresses of the resource files to be debugged enables the virtual server to determine the resource files to be debugged according to the access path.

繼續沿用上例,假設該PC通過該虛擬伺服器α的域 名https://www.YY.com以及該待調試資源文件b.js的地址E:\調試工作\待調試文件\b.js,產生所述待調試資源文件b.js的存取路徑:https://www.YY.com/b.js。並且,該PC還將網路配置中存取路徑https://www.XX.com/XX/a.js替換為https://www.YY.com/b.js。使得當該PC接收到終端瀏覽器B發出的針對該https網頁A的音頻JS文件的調用請求時,根據網路配置中修改的存取路徑,該虛擬伺服器α接收該調用請求,並根據存取路徑https://www.YY.com/b.js調用該待調試資源文件b.js。 Continue the above example, assuming that the PC passes the domain of the virtual server α Name https: //www.YY.com and the address E of the resource file b.js to be debugged: \ debugging work \ file to be debugged \ b.js to generate the access path of the resource file b.js to be debugged: https: //www.YY.com/b.js. In addition, the PC also replaced the access path https://www.XX.com/XX/a.js in the network configuration with https://www.YY.com/b.js. When the PC receives a call request for the audio JS file of the https web page A from the terminal browser B, the virtual server α receives the call request according to the access path modified in the network configuration, and Take the path https: //www.YY.com/b.js and call the resource file b.js to be debugged.

S204:為所述虛擬伺服器產生根證書。 S204: Generate a root certificate for the virtual server.

在本發明實施例中,步驟S101中已經寫明,本發明是基於https網頁的,而對於https網頁來說,該瀏覽器與該虛擬伺服器間的傳輸需要進行通信加密,於是為了使該虛擬伺服器能對與該瀏覽器間的傳輸進行通信加密,還需要為該虛擬伺服器產生根證書。 In the embodiment of the present invention, it has been stated in step S101 that the present invention is based on an https webpage. For an https webpage, the transmission between the browser and the virtual server needs to be encrypted for communication. Therefore, in order to make the virtual The server can encrypt the communication with the browser, and also needs to generate a root certificate for the virtual server.

具體的,由於該根證書僅作為該虛擬伺服器的安全證書在該終端中使用,所以無需權威的、公信力較高的安全證書(如,證書授權中心,Certificate Authority,頒發的CA證書),僅需能欺騙該瀏覽器,使該瀏覽器可以與該虛擬伺服器件的傳輸進行通信加密即可。 Specifically, since the root certificate is only used in the terminal as the security certificate of the virtual server, there is no need for an authoritative and high credibility security certificate (for example, a certificate authority, a CA issued by a Certificate Authority), and only It is necessary to be able to deceive the browser so that the browser can encrypt the communication with the transmission of the virtual servo device.

需要說明的是,該根證書是各種類型的安全證書,如,域名型SSL(Domain Validation SSL,DVSSL)證書、企業型SSL(Organization Validation SSL,OVSSL)證書、增強型SSL(Extended Validation SSL,EVSSL) 證書、通配符SSL(Wildcard SSL)證書,本發明對此並不具體限定。 It should be noted that the root certificate is various types of security certificates, such as Domain Validation SSL (DVSSL) certificates, Organization Validation SSL (OVSSL) certificates, and Extended Validation SSL (EVSSL). ) The certificate and the wildcard SSL (Wildcard SSL) certificate are not specifically limited in the present invention.

繼續沿用上例,假設,為該虛擬伺服器α產生了根證書β。 Continuing the above example, suppose that a root certificate β is generated for the virtual server α.

S205:根據所述根證書,產生子證書。 S205: Generate a sub-certificate according to the root certificate.

在本發明實施例中,當為該虛擬伺服器產生了根證書之後(即,為該虛擬伺服器頒發了自簽證書之後),為了使該瀏覽器可以調用保存於該終端本地的該待調試資源文件,該虛擬伺服器還可根據該根證書,產生用於發送給該瀏覽器的子證書,以便該瀏覽器可以根據該子證書確定該待調試資源文件是安全的。產生了根證書及其子證書後,該瀏覽器即可與該虛擬伺服器進行基於https網頁的通信連接。 In the embodiment of the present invention, after a root certificate is generated for the virtual server (that is, after a self-signed certificate is issued for the virtual server), in order to enable the browser to call the to-be-debugged file saved locally on the terminal. Resource file, the virtual server may also generate a sub-certificate for sending to the browser according to the root certificate, so that the browser may determine that the resource file to be debugged is safe according to the sub-certificate. After the root certificate and its sub-certificates are generated, the browser can communicate with the virtual server based on the https web page.

具體的與現有技術一致,該虛擬伺服器基於該根證書產生用於發送給該瀏覽器的子證書,使得當該終端中的該瀏覽器在根據該https網頁發起對該網路資源文件的調用請求時,由該虛擬伺服器接收到該調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向該瀏覽器返回該待調試資源文件以及該子證書,進而使該瀏覽器根據該子證書確定該待調試資源文件是安全的,獲取並執行該待調試資源文件。 Specifically consistent with the prior art, the virtual server generates a sub-certificate for sending to the browser based on the root certificate, so that when the browser in the terminal initiates a call to the network resource file according to the https webpage When requested, the virtual server receives the invocation request, and returns the resource file to be debugged and the sub-certificate to the browser according to the access path replaced by access to the local resource file to be debugged, thereby enabling the browser According to the sub-certificate, it is determined that the resource file to be debugged is secure, and the resource file to be debugged is obtained and executed.

繼續沿用上例,假設,該虛擬伺服器根據該根證書β產生子證書γ,則當該瀏覽器B在根據該https網頁A向https://www.XX.com/XX/a.js發起調用請求時,該虛擬伺 服器α接收到向https://www.YY.com/b.js發起的調用請求,則該虛擬伺服器α向該瀏覽器返回該待調試資源文件b.js以及該子證書γ,使得該瀏覽器B在接收到該待調試資源文件b.js以及該子證書γ後,根據該子證書γ確定該待調試資源文件b.js安全可用,獲取並執行該待調試資源文件b.js。 Continuing the above example, assuming that the virtual server generates a sub-certificate γ based on the root certificate β, when the browser B initiates to https://www.XX.com/XX/a.js according to the https page A When the request is called, the virtual server Server α receives the call request to https://www.YY.com/b.js, then the virtual server α returns the resource file b.js to be debugged and the sub-certificate γ to the browser, so that After receiving the resource file b.js to be debugged and the sub-certificate γ, the browser B determines that the resource file b.js to be debugged is safe and available according to the sub-certificate γ, and obtains and executes the resource file b.js to be debugged. .

通過如圖2所示的調用文件方法,可見,由於為該虛擬伺服器產生了根證書以及子證書,所以即使對於瀏覽器根據https網頁發起的網路資源文件的調用請求,該虛擬伺服器也可通過該根證書欺騙該瀏覽器,使該瀏覽器確定該虛擬伺服器是提供該https網頁中的網路資源文件的伺服器,並且,該虛擬服務通過向該瀏覽器返回該待調試資源文件以及該子證書,使得該待調試資源文件可以通過該子證書欺騙該瀏覽器,讓該瀏覽器確定該待調試資源文件的身份是安全的。從而實現https網頁中的網路資源文件的替換,並使該瀏覽器可以獲取、執行本地的待調試資源文件。使得工作人員後續可以在終端本地對出現問題的https網頁中的網路資源文件進行調試。 By calling the file method shown in FIG. 2, it can be seen that since the root certificate and the sub-certificate are generated for the virtual server, the virtual server also has an invocation request for a network resource file initiated by the browser according to the https webpage. The browser can be spoofed by the root certificate, so that the browser determines that the virtual server is a server that provides the network resource file in the https web page, and the virtual service returns the resource file to be debugged to the browser And the sub-certificate, so that the resource file to be debugged can trick the browser through the sub-certificate, and let the browser determine that the identity of the resource file to be debugged is secure. Thereby, the replacement of the network resource files in the https web page is realized, and the browser can obtain and execute the local resource files to be debugged. This enables the staff to debug the network resource files in the https webpage where the problem occurs in the terminal.

另外,如在步驟S201中所述的,該待調試資源文件可以是任意文件,於是,為了後續可以對該待調試資源文件進行調試,在本發明中還可以下載該網路資源文件至該待調試資源文件的地址。 In addition, as described in step S201, the resource file to be debugged may be any file, so in order to debug the resource file to be debugged later, in the present invention, the network resource file may also be downloaded to the file to be debugged. The address of the debug resource file.

具體的,該終端可根據該替換指令,確定該網路資源文件的存取路徑,並根據該網路資源文件的存取路徑下載 該網路資源文件至該待調試資源文件的地址,則此時該待調試資源文件不再是任意文件,而已經被替換為已下載的該網路資源文件,於是後續工作人員可以在本地對該待調試資源文件進行調試。 Specifically, the terminal may determine the access path of the network resource file according to the replacement instruction, and download the path according to the access path of the network resource file. The address of the network resource file to the resource file to be debugged. At this time, the resource file to be debugged is no longer an arbitrary file, but has been replaced with the downloaded network resource file, so subsequent staff can localize the file. The resource file to be debugged is debugged.

需要說明的是,該網路資源文件的下載以及該待調試資源文件的替換可以在本發明中任一步驟中進行,僅需要保證在步驟S203中產生的該待調試資源文件的存取路徑為已替換為網路資源文件的該待調試資源文件的存取路徑即可。 It should be noted that the downloading of the network resource file and the replacement of the resource file to be debugged can be performed in any step of the present invention. It only needs to ensure that the access path of the resource file to be debugged generated in step S203 is The access path of the resource file to be debugged has been replaced with the network resource file.

基於圖2所示的調用文件過程,本發明實施例還提供一種調用文件裝置,如圖3所示。 Based on the file calling process shown in FIG. 2, an embodiment of the present invention further provides a file calling device, as shown in FIG. 3.

圖3是本發明實施例提供一種調用文件裝置的結構示意圖,具體包括:接收模組301,用於接收https網頁中網路資源文件的替換指令;執行模組302,用於根據所述替換指令,在本地建立虛擬伺服器;替換模組303,用於通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;根證書模組304,用於為所述虛擬伺服器產生根證書;子證書模組305,用於根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網 路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。 FIG. 3 is a schematic structural diagram of a file calling device according to an embodiment of the present invention, which specifically includes: a receiving module 301 for receiving a replacement instruction of a network resource file in an https webpage; and an execution module 302 for performing a replacement instruction according to the replacement instruction. Creating a virtual server locally; a replacement module 303 for replacing the access path for accessing the network resource file with the access path for accessing the local resource file to be debugged through the virtual server; root The certificate module 304 is used to generate a root certificate for the virtual server; the sub-certificate module 305 is used to generate a sub-certificate based on the root certificate, so that when a local browser initiates When the resource resource file is called, the virtual server receives the resource request, and returns the resource file to be debugged to the browser according to the access path replaced by the local resource file to be debugged. The sub-certificate enables the browser to obtain and execute the resource file to be debugged according to the sub-certificate.

所述替換指令包含:所述網路資源文件的標識、所述網路資源文件的存取路徑、預先保存在本地的所述待調試資源文件的標識及所述待調試資源文件地址。 The replacement instruction includes: an identifier of the network resource file, an access path of the network resource file, an identifier of the resource file to be debugged stored in advance locally, and an address of the resource file to be debugged.

執行模組302具體用於,根據所述替換請求,在本地建立虛擬伺服器,並確定所述虛擬伺服器的域名。 The execution module 302 is specifically configured to establish a virtual server locally according to the replacement request, and determine a domain name of the virtual server.

替換模組303具體用於,根據所述虛擬伺服器的域名以及所述待調試資源文件地址,產生所述待調試資源的存取路徑,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 The replacement module 303 is specifically configured to generate an access path of the resource to be debugged according to the domain name of the virtual server and the address of the resource file to be debugged, and replace the access path to access the network resource file. The access path for accessing the local resource file to be debugged.

所述裝置還包括:下載模組306,用於下載所述網路資源文件至所述待調試資源文件的地址。 The device further includes a download module 306 for downloading the network resource file to an address of the resource file to be debugged.

具體的,上述如圖3所示的資料庫語句編譯裝置可以位於終端中,該終端可以是手機、平板電腦或者PC。 Specifically, the above database sentence compiling device shown in FIG. 3 may be located in a terminal, and the terminal may be a mobile phone, a tablet computer, or a PC.

在一個典型的配置中,計算設備包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和隨機存取記憶體。 In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and random access memory.

隨機存取記憶體可能包括計算機可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非易失性隨機 存取記憶體等形式,如唯讀記憶體(ROM)或閃存(flash RAM)。隨機存取記憶體是計算機可讀媒體的示例。 Random-access memory may include non-persistent memory, random-access memory (RAM), and / or non-volatile random-access memory in computer-readable media Access memory and other forms, such as read-only memory (ROM) or flash RAM (flash RAM). Random access memory is an example of a computer-readable medium.

計算機可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是計算機可讀指令、資料結構、程式的模組或其他資料。計算機的儲存媒體的例子包括,但不限於相變隨機存取記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可擦除可編程唯讀記憶體(EEPROM)、快閃記憶體或其他隨機存取記憶體技術、光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁盤儲存或其他磁性儲存設備或任何其他非傳輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,計算機可讀媒體不包括暫存電腦可讀媒體(transitory media),如調變的資料信號和載波。 Computer-readable media includes permanent and non-permanent, removable and non-removable media. Information can be stored by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other random access memory technologies, CD-ROM, CD-ROM, Digital versatile discs (DVDs) or other optical storage, magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmitting media may be used to store information that can be accessed by computing devices. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。 It should also be noted that the terms "including," "including," or any other variation thereof are intended to encompass non-exclusive inclusion, so that a process, method, product, or device that includes a range of elements includes not only those elements, but also Other elements not explicitly listed, or those that are inherent to such a process, method, product, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, product, or equipment that includes the elements.

本領域技術人員應明白,本發明的實施例可提供為方法、系統或計算機程式產品。因此,本發明可採用完全硬體實施例、完全軟體實施例或結合軟體和硬體方面的實施例的形式。而且,本發明可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁盤記憶體、CD-ROM、光學記憶體等)上實施的計算機程式產品的形式。 Those skilled in the art should understand that the embodiments of the present invention may be provided as a method, a system or a computer program product. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.

以上所述僅為本發明的實施例而已,並不用於限制本發明。對於本領域技術人員來說,本發明可以有各種更改和變化。凡在本發明的精神和原理之內所作的任何修改、等同替換、改進等,均應包含在本發明的申請專利範圍之內。 The above description is only an embodiment of the present invention and is not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of patent application of the present invention.

Claims (10)

一種調用文件方法,所述方法包括:接收針對安全套接字層超文本傳輸協議https網頁中網路資源文件的替換指令;根據所述替換指令,在本地建立虛擬伺服器;通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;為所述虛擬伺服器產生根證書;根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。A method for invoking a file, the method comprising: receiving a replacement instruction for a network resource file in a secure socket layer hypertext transfer protocol https webpage; establishing a virtual server locally according to the replacement instruction; and using the virtual server Server, replacing the access path for accessing the network resource file with the access path for accessing the local resource file to be debugged; generating a root certificate for the virtual server; and generating a sub-certificate based on the root certificate, so that When a local browser initiates a call request for the network resource file according to the https webpage, the virtual server receives the call request and replaces it with an access path for accessing a local resource file to be debugged And returning the resource file to be debugged and the sub-certificate to the browser, so that the browser obtains and executes the resource file to be debugged according to the sub-certificate. 如申請專利範圍第1項所述的方法,其中,所述替換指令包含:所述網路資源文件的標識、所述網路資源文件的存取路徑、預先保存在本地的所述待調試資源文件的標識及所述待調試資源文件地址。The method according to item 1 of the scope of patent application, wherein the replacement instruction includes: an identification of the network resource file, an access path of the network resource file, and the resource to be debugged stored in advance locally The identifier of the file and the address of the resource file to be debugged. 如申請專利範圍第2項所述的方法,其中,根據所述替換指令,在本地建立虛擬伺服器,包括:根據所述替換指令,在本地建立虛擬伺服器,並確定所述虛擬伺服器的域名。The method according to item 2 of the scope of patent application, wherein establishing a virtual server locally according to the replacement instruction includes: establishing a virtual server locally according to the replacement instruction, and determining the virtual server's domain name. 如申請專利範圍第3項所述的方法,其中,通過所述虛擬伺服器,將存取網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑,包括:根據所述虛擬伺服器的域名以及所述待調試資源文件地址,產生所述待調試資源的存取路徑;將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。The method according to item 3 of the scope of patent application, wherein replacing the access path for accessing the network resource file with the access path for accessing the local resource file to be debugged by the virtual server includes: The domain name of the virtual server and the address of the resource file to be debugged generate the access path of the resource to be debugged; replacing the access path to the network resource file with the access to the local resource file to be debugged. Take the path. 如申請專利範圍第2項所述的方法,其中,所述方法還包括:下載所述網路資源文件至所述待調試資源文件的地址。The method according to item 2 of the scope of patent application, wherein the method further comprises: downloading the network resource file to an address of the resource file to be debugged. 一種調用文件的裝置,包括:接收模組,用於接收安全套接字層超文本傳輸協議https網頁中網路資源文件的替換指令;執行模組,用於根據所述替換指令,在本地建立虛擬伺服器;替換模組,用於通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;根證書模組,用於為所述虛擬伺服器產生根證書;子證書模組,用於根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。A device for invoking a file includes: a receiving module for receiving a replacement instruction of a network resource file in a secure socket layer hypertext transfer protocol https webpage; and an execution module for locally establishing the replacement instruction according to the replacement instruction. A virtual server; a replacement module for replacing an access path for accessing the network resource file with an access path for accessing a resource file to be debugged locally through the virtual server; a root certificate module for Generating a root certificate for the virtual server; a sub-certificate module configured to generate a sub-certificate based on the root certificate, so that when a local browser initiates a call request for the network resource file according to the https webpage Receiving the call request by the virtual server, and returning the resource file to be debugged and the sub-certificate to the browser according to the access path replaced by accessing the local resource file to be debugged, so that all The browser obtains and executes the resource file to be debugged according to the sub-certificate. 如申請專利範圍第6項所述的裝置,其中,所述替換指令包含:所述網路資源文件的標識、所述網路資源文件的存取路徑、預先保存在本地的所述待調試資源文件的標識及所述待調試資源文件地址。The device according to item 6 of the scope of patent application, wherein the replacement instruction includes: an identification of the network resource file, an access path of the network resource file, and the resource to be debugged that is stored locally in advance. The identifier of the file and the address of the resource file to be debugged. 如申請專利範圍第7項所述的裝置,其中,執行模組用於,根據所述替換指令,在本地建立虛擬伺服器,並確定所述虛擬伺服器的域名。The apparatus according to item 7 of the scope of patent application, wherein the execution module is configured to establish a virtual server locally according to the replacement instruction, and determine a domain name of the virtual server. 如申請專利範圍第8項所述的裝置,其中,替換模組用於,根據所述虛擬伺服器的域名以及所述待調試資源文件地址,產生所述待調試資源的存取路徑,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。The device according to item 8 of the scope of patent application, wherein the replacement module is configured to generate an access path of the resource to be debugged according to the domain name of the virtual server and the file address of the resource to be debugged, and store the resource. Replace the access path of the network resource file with the access path of the local resource file to be debugged. 如申請專利範圍第7項所述的裝置,其中,所述裝置還包括:下載模組,用於下載所述網路資源文件至所述待調試資源文件的地址。The device according to item 7 of the scope of patent application, wherein the device further comprises: a download module for downloading the network resource file to an address of the resource file to be debugged.
TW106102210A 2016-03-29 2017-01-20 Method and device for calling a file TWI672019B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610189253.7A CN107239475B (en) 2016-03-29 2016-03-29 File calling method and device
??201610189253.7 2016-03-29

Publications (2)

Publication Number Publication Date
TW201735583A TW201735583A (en) 2017-10-01
TWI672019B true TWI672019B (en) 2019-09-11

Family

ID=59963470

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106102210A TWI672019B (en) 2016-03-29 2017-01-20 Method and device for calling a file

Country Status (3)

Country Link
CN (1) CN107239475B (en)
TW (1) TWI672019B (en)
WO (1) WO2017167051A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768940B (en) * 2018-07-27 2022-03-22 深信服科技股份有限公司 Ciphertext data management and control method and system based on HTTPS (Hypertext transfer protocol secure) protocol, proxy server and storage medium
CN109508437B (en) * 2018-11-21 2021-05-04 深信服科技股份有限公司 Search website auditing method, system, gateway equipment and storage medium
CN113507529B (en) * 2021-07-26 2022-12-06 上海中通吉网络技术有限公司 Method for realizing file downloading based on Web application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7509490B1 (en) * 2000-05-26 2009-03-24 Symantec Corporation Method and apparatus for encrypted communications to a secure server
US20090319796A1 (en) * 2008-06-18 2009-12-24 Igt Gaming machine certificate creation and management
CN102916958A (en) * 2012-10-15 2013-02-06 福建榕基软件股份有限公司 Method and system for realizing access encryption of mobile terminal browser
JP2014229182A (en) * 2013-05-24 2014-12-08 日本電信電話株式会社 Web browsing history acquisition device, method, and program
US20150373013A1 (en) * 2014-06-20 2015-12-24 Adobe Systems Incorporated Method and apparatus for verifying an application to authorize content repository access using ssl certificates

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7370351B1 (en) * 2001-03-22 2008-05-06 Novell, Inc. Cross domain authentication and security services using proxies for HTTP access
CN102214224A (en) * 2011-06-15 2011-10-12 中兴通讯股份有限公司 Network resource access optimizing method, Web page browser and terminal
CN103065078A (en) * 2013-01-04 2013-04-24 无锡矽鼎科技有限公司 Method of loading client certificate for Android system by OpenSSL engine
CN104539682A (en) * 2014-12-19 2015-04-22 乐视网信息技术(北京)股份有限公司 Debug method, device, mobile terminal, server and system for mobile webpage
CN105404504B (en) * 2015-11-02 2018-12-25 北京锐安科技有限公司 A kind of adjustment method and device of Web component

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7509490B1 (en) * 2000-05-26 2009-03-24 Symantec Corporation Method and apparatus for encrypted communications to a secure server
US20090319796A1 (en) * 2008-06-18 2009-12-24 Igt Gaming machine certificate creation and management
CN102916958A (en) * 2012-10-15 2013-02-06 福建榕基软件股份有限公司 Method and system for realizing access encryption of mobile terminal browser
JP2014229182A (en) * 2013-05-24 2014-12-08 日本電信電話株式会社 Web browsing history acquisition device, method, and program
US20150373013A1 (en) * 2014-06-20 2015-12-24 Adobe Systems Incorporated Method and apparatus for verifying an application to authorize content repository access using ssl certificates

Also Published As

Publication number Publication date
TW201735583A (en) 2017-10-01
WO2017167051A1 (en) 2017-10-05
CN107239475B (en) 2020-09-18
CN107239475A (en) 2017-10-10

Similar Documents

Publication Publication Date Title
CN112637346B (en) Proxy method, proxy device, proxy server and storage medium
TWI679550B (en) Account login method and device
CN110990205B (en) Interface call testing method, device and computer readable storage medium
CN109543121B (en) Method and device for calling outer link url (real time communication) resources
CN104461491B (en) The operation method and system of a kind of Hybrid components
KR102087478B1 (en) Method and apparatus of downloading and installing a client
WO2017045563A1 (en) Web app access method, apparatus, and system
US10915437B1 (en) Framework for performing load testing and profiling of services
US10565090B1 (en) Proxy for debugging transformed code
US11196728B1 (en) Caching login sessions to access a software testing environment
CN107733882B (en) SSL certificate automatic deployment method and equipment
TW201732657A (en) Service execution method and device
TWI672019B (en) Method and device for calling a file
US10031837B1 (en) Dynamic service debugging in a virtual environment
CN104536890A (en) Testing system, method and device
US20200076792A1 (en) Secure password-based single sign-on
TW201516910A (en) Method and system for authenticating service
JP2018500688A (en) Computer-readable storage medium for dynamic service deployment and method and system for utilizing the same
WO2020063607A1 (en) Application client launch method, service server, and client device
WO2017206605A1 (en) Method and device for preventing server from being attacked
CN115225707A (en) Resource access method and device
CN108255708A (en) Method, apparatus, storage medium and the equipment of production file are accessed in test environment
CN112733001A (en) Method and device for acquiring subscription information and electronic equipment
CN102662838B (en) The adjustment method of Flash and system in a kind of browser
TW201734856A (en) Method and device of page display does not need to search required information on the page to bring convenience for the user