CN114448842B - Resource access method and device and computing equipment - Google Patents

Resource access method and device and computing equipment Download PDF

Info

Publication number
CN114448842B
CN114448842B CN202210141503.5A CN202210141503A CN114448842B CN 114448842 B CN114448842 B CN 114448842B CN 202210141503 A CN202210141503 A CN 202210141503A CN 114448842 B CN114448842 B CN 114448842B
Authority
CN
China
Prior art keywords
resource
resolver
optimal
access
information structure
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
CN202210141503.5A
Other languages
Chinese (zh)
Other versions
CN114448842A (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.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202210141503.5A priority Critical patent/CN114448842B/en
Publication of CN114448842A publication Critical patent/CN114448842A/en
Application granted granted Critical
Publication of CN114448842B publication Critical patent/CN114448842B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Library & Information Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a resource access method, a device and a computing device, wherein the method comprises the following steps: receiving a request for accessing resources based on URIs, wherein the request is sent by an application program; acquiring information of the optimal resolver from a protocol analyzer based on the URI, wherein the optimal resolver is the resolver with highest resolving efficiency; requesting the current optimal resolver to resolve the URI based on the information of the current optimal resolver so as to acquire a resource information structure returned by the current optimal resolver; and sending the resource information structure body to the protocol analyzer, and analyzing the resource information structure body by the protocol analyzer to determine a resource access type corresponding to the resource information structure body and a next optimal analyzer corresponding to the resource access type. According to the technical scheme of the invention, the resource accessing speed of the application program based on the URI can be improved.

Description

Resource access method and device and computing equipment
The present application is a divisional application of patent application 2021114885937 filed on 8/12/2021.
Technical Field
The present invention relates to the field of computers and internet technologies, and in particular, to a resource access method, a resource access device, and a computing device.
Background
The URI (Uniform Resource Identifier ) is mainly composed of scheme, userinfo, host, port, path, query and fragment. Wherein the schema defines the protocol type of the resource, the userinfo mainly carries user data information, host and port specify domain names and ports, path specify a resource specific directory, query specifies query information, and fragment represents anchor information.
In the prior art, by using a scheme of accelerating I/O through URI routing, a Windows system is designed according to a file bottom layer principle, and when receiving protocols of different schemes, the Windows system only forwards the protocols to different application programs to open addresses; the distribution protocol under the Linux system is mainly polling and binary searching, the specific protocol is analyzed by the specific implementation, and the path routing is completed by the virtual file system (virtual file system). For protocol distribution, although common URIs are extended for different release versions, access efficiency of different versions is quite different for specific protocols, and even access failure cases exist.
Based on the prior art framework, each release of the Linux system only analyzes and expands specific protocols, the scheme is single, the protocol support types are different, and the access effect cannot be guaranteed.
Therefore, a resource access method is needed, which can accelerate the resource access speed based on URI, so as to solve the problems in the prior art.
Disclosure of Invention
Accordingly, the present invention provides a resource access method, a resource access device, and a computing device to solve or at least alleviate the above-mentioned problems.
According to one aspect of the present invention, there is provided a resource access method, executed in an operating system, comprising the steps of: receiving a request for accessing resources based on URIs, wherein the request is sent by an application program; acquiring information of the optimal resolver from a protocol analyzer based on the URI, wherein the optimal resolver is the resolver with highest resolving efficiency; requesting the current optimal resolver to resolve the URI based on the information of the current optimal resolver so as to acquire a resource information structure returned by the current optimal resolver; and sending the resource information structure body to the protocol analyzer, and analyzing the resource information structure body by the protocol analyzer to determine a resource access type corresponding to the resource information structure body and a next optimal analyzer corresponding to the resource access type.
Optionally, in the resource access method according to the present invention, the step of analyzing the resource information structure includes: determining a resource access type according to one or more resource attribute information in the resource information structure body, and acquiring time-consuming data of the access from the resource information structure body; and determining the next optimal resolver corresponding to the resource access type according to the historical access time-consuming data and the current access time-consuming data corresponding to the resource access type.
Optionally, in the resource access method according to the present invention, the step of determining the next optimal resolver corresponding to the resource access type includes: judging whether the time-consuming data accessed at this time exceeds a time-consuming threshold value; and if the time consumption data of the current access does not exceed the time consumption threshold, determining the optimal resolver of the current time as the optimal resolver of the next time corresponding to the resource access type.
Optionally, in the resource access method according to the present invention, the method further includes the steps of: if the time-consuming data of the current access exceeds a time-consuming threshold and the resource access type is the first access, determining a second priority resolver as a next optimal resolver corresponding to the resource access type based on a preset resolver priority order; if the time-consuming data of the current access exceeds the time-consuming threshold and the resource access type is not the first access, dynamically adjusting the priority order of the resolvers according to the historical time-consuming data of the resource access type and the time-consuming data of the current access so as to determine the next optimal resolvers corresponding to the resource access type.
Optionally, in the resource access method according to the present invention, the URI includes a resource protocol, and before receiving a request sent by an application program to access a resource based on the URI, the method further includes the steps of: a list of resolvers is obtained from the configuration file and sent to the protocol analyzer, so that the protocol analyzer determines one or more resolvers matched with each resource protocol and preset resolver priority order according to the list of resolvers.
Optionally, in the resource access method according to the present invention, the resource attribute information in the resource information structure body includes one or more of time consuming of the access, a resource base type, a resource size, a resource depth, a number of sub-resources, and a sub-resource list.
Optionally, in the resource access method according to the present invention, the step of determining the resource access type according to one or more resource attribute information in the resource information structure body includes: if the resource depth in the resource information structure body is not more than the resource depth threshold, the resource size is not more than the resource size threshold, the number of sub-resources is not more than the number of sub-resources threshold, and the resource basic types are the same, determining the same resource access type.
Optionally, in the resource access method according to the present invention, the step of acquiring the current optimal parser information from the protocol parser based on the URI includes: and calling a parser query interface provided by the protocol analyzer to query the current optimal parser information corresponding to the URI.
Optionally, in the resource access method according to the present invention, after obtaining the resource information structure body returned by the present optimal parser, the method further includes the steps of: and returning the resource information structure to the application program.
According to one aspect of the present invention, there is provided a resource access device arranged on an operating system, the device comprising: a receiving unit adapted to receive a request sent by an application program to access a resource based on a URI; the acquisition unit is suitable for acquiring the information of the optimal resolver from the protocol analyzer based on the URI, wherein the optimal resolver is the resolver with highest resolving efficiency; the analysis unit is suitable for requesting the current optimal resolver to analyze the URI based on the information of the current optimal resolver so as to acquire a resource information structure body returned by the current optimal resolver; and the analysis unit is suitable for sending the resource information structure body to the protocol analyzer, and analyzing the resource information structure body through the protocol analyzer so as to determine the resource access type corresponding to the resource information structure body and the next optimal analyzer corresponding to the resource access type.
According to one aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the resource access method as described above.
According to one aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform a resource access method as described above.
According to the technical scheme of the invention, the resource access method is provided, and the optimal resolver with highest resolving efficiency and highest resolving speed can be selected based on different URIs to resolve the URIs. After the resource information structure body returned by the optimal analyzer is obtained each time, not only the resource information structure body is returned to the application program, but also further learning and analysis are performed by sending the resource information structure body to the protocol analyzer, so as to determine the resource access type and analyze the resource access type to obtain the next optimal analyzer corresponding to the resource access type. In this way, the invention dynamically analyzes the optimal analyzer with highest analysis efficiency and highest analysis speed based on each resource access type, the analyzed optimal analyzer is dynamically performed and updated, and when the application program accesses the same type of resource based on the URI next time, the next optimal analyzer information corresponding to the URI obtained by the latest analysis can be obtained from the protocol analyzer. According to the technical scheme of the invention, the URI is analyzed and the resource is acquired by using the optimal analyzer with the highest dynamic analysis speed, so that the resource accessing speed of an application program based on the URI can be improved, the accessing efficiency is improved, and the time consumption of accessing is shortened as much as possible.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above, as well as additional objects, features, and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 shows a schematic diagram of a computing device 100 according to one embodiment of the invention;
FIG. 2 illustrates a flow diagram of a resource access method 200 according to one embodiment of the invention;
FIG. 3 illustrates a timing diagram corresponding to a resource access method 200 according to one embodiment of the invention; and
fig. 4 shows a schematic diagram of a resource access device 400 according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic block diagram of an example computing device 100.
As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. The memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing including, but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of caches, such as a first level cache 110 and a second level cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations, the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, the application 122 may be arranged to execute instructions on an operating system by the one or more processors 104 using the program data 124.
Computing device 100 also includes storage device 132, storage device 132 including removable storage 136 and non-removable storage 138.
Computing device 100 may also include a storage interface bus 134. Storage interface bus 134 enables communication from storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to base configuration 102 via bus/interface controller 130. At least a portion of the operating system 120, applications 122, and data 124 may be stored on removable storage 136 and/or non-removable storage 138, and loaded into the system memory 106 via the storage interface bus 134 and executed by the one or more processors 104 when the computing device 100 is powered up or the application 122 is to be executed.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to basic configuration 102 via bus/interface controller 130. The exemplary output device 142 includes an image processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as a display or speakers via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via one or more communication ports 164 over a network communication link.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 100 may be implemented as a personal computer including desktop and notebook computer configurations. Of course, computing device 100 may also be implemented as part of a small-sized portable (or mobile) electronic device such as a cellular telephone, a digital camera, a Personal Digital Assistant (PDA), a personal media player device, a wireless web-watch device, a personal headset device, an application-specific device, or a hybrid device that may include any of the above functions. And may even be implemented as servers, such as file servers, database servers, application servers, WEB servers, and the like. The embodiments of the present invention are not limited in this regard.
In an embodiment according to the invention, the computing device 100 is configured to perform the resource access method 200 according to the invention. Wherein the operating system of the computing device 100 contains a plurality of program instructions for executing the resource access method 200 of the present invention, such that the resource access method 200 of the present invention can be executed in the operating system of the computing device 100.
According to one embodiment of the present invention, a resource access device 400 is disposed in an operating system of a computing apparatus 100, and the resource access device 400 includes a plurality of program instructions for executing the resource access method 200 of the present invention, so that the resource access method 200 of the present invention can be executed in the resource access device 400.
FIG. 2 illustrates a flow diagram of a resource access method 200 according to one embodiment of the invention. The resource access method 200 may be performed in an operating system of a computing device (e.g., the aforementioned computing device 100), and in particular may be performed in a resource access apparatus 400 in the operating system.
In an embodiment according to the invention, one or more applications are running on the operating system and at least one protocol analyzer, a plurality of protocol analyzers are arranged on the operating system.
In the specific embodiment, the present invention specifically describes the resource access method 200 by taking the Linux operating system as an example. However, it should be appreciated that the resource access method 200 of the present invention is not limited to a particular type of operating system that performs the method, and those skilled in the art will appreciate that the method can be implemented on other types of operating systems as well, such as Windows operating systems, without the need for inventive labor. Any kind of operating system that can achieve the speed of resource access based on URIs by the method of the invention is within the scope of the invention.
As shown in fig. 2, the method 200 begins at step S210.
In step S210, a request sent by an application program to access a resource based on a URI is received.
It should be noted that the present invention is not limited to a particular type of application. In one implementation, the application may be implemented as various types of file managers, such as Nautilus (the default file manager for the gnome desktop environment), dolphin (the default file manager for the KDE desktop environment), and the accessed resource may be various types of files, so that the method of the present invention may increase the speed of accessing the files. However, the present invention is not limited thereto.
Then, in step S220, the current optimal resolver information corresponding to the URI is acquired from the protocol analyzer based on the URI so as to resolve the URI based on the current optimal resolver. Here, the optimal parser is the highest priority protocol parser with the highest efficiency in URI parsing.
In one embodiment, the resource access device 400 requests the protocol analyzer to select the highest priority optimal resolver from the list of resolvers based on the URI. Specifically, the resource access device 400 may obtain a parser list from a configuration file and send the parser list to a protocol analyzer before receiving a request for accessing a resource based on a URI sent by an application. Here, the parser list includes a plurality of parsers matched with a plurality of resource protocols, wherein each resource protocol can adapt one or more parsers, and the plurality of parsers adapted for each resource protocol are preset with priority order. Thus, when the protocol analyzer selects the optimal analyzer for the first time, one or more resolvers matched with each resource protocol and a preset priority order of the resolvers can be determined according to the resolver list, and the resolver with the highest priority is selected from multiple resolvers according to the preset priority order of the resolvers to serve as the optimal analyzer.
The invention determines the priority order of the resolvers according to the resolution speed of the resolvers on the URI, wherein, for a plurality of resolvers matched with one resource protocol, the higher the resolution speed is, the shorter the access time is, the higher the priority of the resolvers is (the higher the priority order is); accordingly, the slower the parsing speed, the lower the priority of the parser (the later the priority order) the longer the access time.
It will be appreciated that the URI includes a corresponding resource protocol, and a parser matching the resource protocol in the URI can parse the URI. The optimal resolver is the highest priority protocol resolver, i.e., the first priority resolver, selected from one or more protocol resolvers matching the resource protocol in the URI.
It should be noted that when the resource protocol of the URI is adapted to multiple resolvers, the protocol analyzer selects the resolver with the highest priority from the multiple resolvers as the optimal resolver. If there is only one resolver that matches the resource protocol in the URI, the uniquely matching resolver can be directly taken as the optimal resolver.
In one embodiment, a protocol analyzer is provided with a parser query interface. In step S220, a parser query interface provided by the protocol analyzer may be invoked, and the current optimal parser information corresponding to the URI may be queried and obtained through the parser query interface.
Then in step S230, the corresponding current optimal resolver is pulled up based on the acquired current optimal resolver information, and the current optimal resolver is requested to resolve the URI to acquire the corresponding resource, the current optimal resolver may acquire the corresponding resource after resolving the URI, and then the resource information structure body is returned to the resource access device 400 as the resolving result, so that the resource access device 400 may acquire the resource information structure body returned by the current optimal resolver. Here, one or more kinds of resource attribute information (base information) are included in the resource information structure body.
Finally, in step S240, after acquiring the resource information structure returned by the current optimal resolver, the resource access device 400 sends the resource information structure to the protocol analyzer, and the protocol analyzer analyzes the resource information structure to determine the resource access type corresponding to the resource information structure and the next optimal resolver corresponding to the resource access type. Thus, when the resource that the application program requests to access based on the URI next time belongs to the resource access type, the next optimal parser information corresponding to the resource access type can be acquired from the protocol parser based on the URI.
In addition, after the resource information structure returned by the optimal resolver is obtained, the resource access device 400 returns the resource information structure to the application program, so that the application program obtains the result of accessing the resource based on the URI.
It should be noted that, the invention analyzes and selects the optimal analyzer through the protocol analyzer, and uses the optimal analyzer with the highest analysis speed to analyze the URI and acquire the resource, thereby improving the speed and the access efficiency of accessing the resource based on the URI.
FIG. 3 illustrates a timing diagram corresponding to resource access method 200 according to one embodiment of the invention. As shown in fig. 3, the application first pulls up the resource access device 400, and then the resource access device 400 pulls up the protocol analyzer, acquires the pull result returned by the protocol analyzer, and returns the pull result to the application. Next, the application initiates a URI request requesting the resource access device 400 to access the resource based on the URI. Subsequently, the resource access device 400 selects an optimal resolver type from the protocol analyzer based on the URI request, and acquires the optimal resolver type returned by the protocol analyzer. Next, the resource access device 400 pulls up the corresponding optimal resolver (the protocol resolver with the highest priority) according to the optimal resolver type, requests the optimal resolver to resolve the URI, and obtains the resolution result (resource information structure) returned by the optimal resolver. Subsequently, the resource access device 400 transmits the analysis result to the protocol analyzer to analyze the analysis result by the protocol analyzer, and the resource access device 400 returns the analysis result to the value application.
In one embodiment, the resource attribute information in the resource information structure includes, for example, one or more of the time consuming this access, the resource base type, the resource size, the resource depth (i.e., path depth), the number of sub-resources, and the list of sub-resources.
For example, the resource information structure may be implemented as:
Figure BDA0003507193710000091
Figure BDA0003507193710000101
in one embodiment, the protocol analyzer may analyze the resource information structure according to the following analysis method:
and determining the resource access type according to one or more resource attribute information in the resource information structure body, and acquiring the time-consuming data of the access from the resource information structure body. Here, the resource access type may be determined according to a range of attribute values in which one or more kinds of resource attribute information in the resource information structure body are located.
It should be noted that the present invention may define a plurality of resource access types based on different attribute value ranges of one or more kinds of resource attribute information in the resource information structure body. Specifically, resource information structures whose resource depths differ downward by no more than a resource depth threshold, whose resource sizes differ downward by no more than a resource size threshold, whose number of sub-resources differ downward by no more than a number of sub-resources threshold, and whose resource base types are the same may be defined as the same resource access type. Thus, when determining the resource access type based on one or more resource attribute information in the resource information structure, if the resource depth in the resource information structure differs downward by no more than a resource depth threshold, the resource size differs downward by no more than a resource size threshold, the number of sub-resources differs downward by no more than a number of sub-resources threshold, and the resource base types are the same, then the same resource access type may be determined.
In one implementation, the resource depth threshold is, for example, 1, the resource size threshold is, for example, 10%, and the sub-resource number threshold is, for example, 10%, that is, resource information structures whose resource depths differ downward by no more than 1, resource sizes differ downward by no more than 10%, sub-resource numbers differ downward by no more than 10%, and the resource base types are the same may be defined as the same resource access type. Conversely, exceeding the threshold may be defined as other resource access types.
And then, determining the next optimal resolver corresponding to the resource access type according to the historical access time-consuming data and the current access time-consuming data corresponding to the resource access type, so that the next optimal resolver with highest resolving efficiency and highest resolving speed is used for resolving the URI, the speed of accessing the resource based on the URI is improved, and the access time consumption is shortened as much as possible.
It should be noted that by defining multiple resource access types, the present invention can dynamically analyze the most efficient optimal resolver for each resource access type. Specifically, the invention classifies the resource accessed based on the URI, dynamically analyzes the optimal resolver with highest resolving efficiency and highest resolving speed according to the type of the resource access after the resource is acquired based on the URI each time, and can select the optimal resolver corresponding to the URI based on the result obtained by the latest analysis when the resource of the same type is accessed based on the URI later.
In one embodiment, whether to determine the current optimal resolver as the next optimal resolver corresponding to the resource access type is determined based on whether the time consuming data of the current access exceeds a time consuming threshold. Specifically, whether the time-consuming data of the current access exceeds a time-consuming threshold is judged, and if the time-consuming data of the current access does not exceed the time-consuming threshold, the optimal resolver of the current time is determined to be the optimal resolver of the next time corresponding to the resource access type. In one implementation, the time consumption threshold is, for example, 1000ms, but the present invention is not limited to a specific value of the time consumption threshold, which can be set by one skilled in the art according to actual needs.
If the time-consuming data of the current access exceeds the time-consuming threshold, judging whether the resource access type is the first access, and if the resource access type is the first access (no time-consuming data of the historical access exists), determining the second priority resolver as the next optimal resolver corresponding to the resource access type based on the priority order of the preset resolvers. That is, the order of the first priority resolver and the second priority resolver in the preset resolver priority order is adjusted, and the original second priority resolver is set as the highest priority resolver of the next (the next optimal resolver).
In addition, if the time-consuming data of the current access exceeds the time-consuming threshold, and the resource access type is not the first access (there is historical time-consuming data of the access), the priority order of the resolvers can be dynamically adjusted according to the historical time-consuming data of the access corresponding to the resource access type and the time-consuming data of the current access, wherein the priority order of the resolvers with shorter access time consumption is higher as the priority order is higher, and finally the next optimal resolvers corresponding to the resource access type can be determined.
In one embodiment, the protocol analyzer may determine a next best resolver corresponding to a resource access type through intelligent learning. The specific learning method is as follows: the protocol analyzer selects the optimal analyzer several times (configurable times) by executing the above analysis method, and a stable analyzer A is obtained after the analyzer selects to be stable. Then the rule of selecting the optimal resolver is reset, and the optimal resolver is selected for a plurality of times (the configurable times) to obtain the resolver B which is stabilized again. If resolver A is equal to resolver B, then it may be determined to be the next best resolver corresponding to the resource access type. If the resolver A is not equal to the resolver B, the learning method can be repeatedly executed to obtain the two stabilized resolvers until the two stabilized resolvers are the same, and the next optimal resolver corresponding to the resource access type can be determined.
Further, the definition of the resource access type can be further refined, and the learning method can be executed to determine the next optimal resolver corresponding to the refined resource access type. For example, the resource depth threshold is changed to be the same, the resource size threshold is changed to 5%, the sub-resource number threshold is changed to 5%, and the time-consuming threshold is changed to 500ms, and a better solution is obtained by executing the above learning method.
Fig. 4 shows a schematic diagram of a resource access device 400 according to an embodiment of the invention. The resource access device 400 is deployed in an operating system of a computing apparatus (e.g., the aforementioned computing apparatus 100) and is adapted to perform the resource access method 200 of the present invention. Wherein one or more applications are running on the operating system, and at least one protocol analyzer, a plurality of protocol analyzers are disposed on the operating system.
As shown in fig. 4, the resource access device 400 includes a receiving unit 410, an acquiring unit 420, an analyzing unit 430, and an analyzing unit 440, which are sequentially connected. Wherein the receiving unit 410 may receive a request for accessing a resource based on a URI sent by an application. The obtaining unit 420 obtains the information of the current optimal resolver from the protocol analyzer based on the URI, where the optimal resolver is the resolver with the highest resolving efficiency. The parsing unit 430 requests the current optimal parser to parse the URI based on the current optimal parser information, so as to obtain a resource information structure body returned by the current optimal parser. The analysis unit 440 transmits the resource information structure to the protocol analyzer, and analyzes the resource information structure by the protocol analyzer to determine a resource access type corresponding to the resource information structure and a next optimal analyzer corresponding to the resource access type.
It should be noted that the receiving unit 410 is configured to perform the foregoing step S210, the acquiring unit 420 is configured to perform the foregoing step S220, the analyzing unit 430 is configured to perform the foregoing step S230, and the analyzing unit 440 is configured to perform the foregoing step S240. Here, the specific execution logic of the receiving unit 410, the obtaining unit 420, the analyzing unit 430, and the analyzing unit 440 refers to the descriptions of steps S210 to S240 in the foregoing method 200, and will not be repeated here.
According to the resource access method 200 of the present invention, the optimal resolver with highest resolution efficiency and highest resolution speed can be selected based on different URIs to resolve the URIs. After the resource information structure body returned by the optimal analyzer is obtained each time, not only the resource information structure body is returned to the application program, but also further learning and analysis are performed by sending the resource information structure body to the protocol analyzer, so as to determine the resource access type and analyze the resource access type to obtain the next optimal analyzer corresponding to the resource access type. In this way, the invention dynamically analyzes the optimal analyzer with highest analysis efficiency and highest analysis speed based on each resource access type, the analyzed optimal analyzer is dynamically performed and updated, and when the application program accesses the same type of resource based on the URI next time, the next optimal analyzer information corresponding to the URI obtained by the latest analysis can be obtained from the protocol analyzer. According to the technical scheme of the invention, the URI is analyzed and the resource is acquired by using the optimal analyzer with the highest dynamic analysis speed, so that the resource accessing speed of an application program based on the URI can be improved, the accessing efficiency is improved, and the time consumption of accessing is shortened as much as possible.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the resource access method of the present invention in accordance with instructions in said program code stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the invention. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is for carrying out the functions performed by the elements for carrying out the objects of the invention.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.

Claims (11)

1. A method of resource access, executed in an operating system, comprising the steps of:
receiving a request for accessing resources based on URIs, wherein the request is sent by an application program;
acquiring information of the optimal resolver from a protocol analyzer based on the URI, wherein the optimal resolver is the resolver with highest resolving efficiency;
requesting the current optimal resolver to resolve the URI based on the information of the current optimal resolver to acquire a resource information structure body returned by the current optimal resolver, wherein the resource information structure body comprises one or more resource attribute information, and the resource attribute information comprises one or more of current access time consumption, resource basic type, resource size, resource depth, sub-resource quantity and sub-resource list; and
and sending the resource information structure body to the protocol analyzer, and analyzing the resource information structure body by the protocol analyzer to determine the resource access type corresponding to the resource information structure body and the next optimal analyzer corresponding to the resource access type.
2. The method of claim 1, wherein the step of analyzing the resource information structure comprises:
determining a resource access type according to one or more resource attribute information in the resource information structure body, and acquiring time-consuming data of the access from the resource information structure body;
and determining the next optimal resolver corresponding to the resource access type according to the historical access time-consuming data and the current access time-consuming data corresponding to the resource access type.
3. The method of claim 2, wherein determining a next-best resolver corresponding to the resource access type comprises:
judging whether the time-consuming data accessed at this time exceeds a time-consuming threshold value;
and if the time consumption data of the current access does not exceed the time consumption threshold, determining the optimal resolver of the current time as the optimal resolver of the next time corresponding to the resource access type.
4. A method as claimed in claim 3, further comprising the step of:
if the time-consuming data of the current access exceeds a time-consuming threshold and the resource access type is the first access, determining a second priority resolver as a next optimal resolver corresponding to the resource access type based on a preset resolver priority order;
if the time-consuming data of the current access exceeds the time-consuming threshold and the resource access type is not the first access, dynamically adjusting the priority order of the resolvers according to the historical time-consuming data of the resource access type and the time-consuming data of the current access so as to determine the next optimal resolvers corresponding to the resource access type.
5. The method according to any one of claims 1-4, wherein the URI includes a resource protocol therein, and further comprising the step of, prior to receiving a request sent by an application to access a resource based on the URI:
a list of resolvers is obtained from the configuration file and sent to the protocol analyzer, so that the protocol analyzer determines one or more resolvers matched with each resource protocol and preset resolver priority order according to the list of resolvers.
6. The method of any of claims 2-4, wherein determining a resource access type from one or more resource attribute information in the resource information structure comprises:
if the resource depth in the resource information structure body is not more than the resource depth threshold, the resource size is not more than the resource size threshold, the number of sub-resources is not more than the number of sub-resources threshold, and the resource basic types are the same, determining the same resource access type.
7. The method of any of claims 1-4, wherein the step of obtaining the current optimal resolver information from a protocol analyzer based on the URI comprises:
and calling a parser query interface provided by the protocol analyzer to query the current optimal parser information corresponding to the URI.
8. The method according to any one of claims 1-4, wherein after obtaining the resource information structure returned by the present optimal resolver, further comprising the steps of:
and returning the resource information structure to the application program.
9. A resource access device disposed on an operating system, the device comprising:
a receiving unit adapted to receive a request sent by an application program to access a resource based on a URI;
the acquisition unit is suitable for acquiring the information of the optimal resolver from the protocol analyzer based on the URI, wherein the optimal resolver is the resolver with highest resolving efficiency;
the analysis unit is suitable for requesting the current optimal resolver to analyze the URI based on the information of the current optimal resolver so as to acquire a resource information structure body returned by the current optimal resolver, wherein the resource information structure body comprises one or more resource attribute information, and the resource attribute information comprises one or more of current access time consumption, resource basic type, resource size, resource depth, sub-resource quantity and sub-resource list; and
and the analysis unit is suitable for sending the resource information structure body to the protocol analyzer, and analyzing the resource information structure body through the protocol analyzer so as to determine the resource access type corresponding to the resource information structure body and the next optimal analyzer corresponding to the resource access type.
10. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-8.
11. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-8.
CN202210141503.5A 2021-12-08 2021-12-08 Resource access method and device and computing equipment Active CN114448842B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210141503.5A CN114448842B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210141503.5A CN114448842B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment
CN202111488593.7A CN113904962B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202111488593.7A Division CN113904962B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN114448842A CN114448842A (en) 2022-05-06
CN114448842B true CN114448842B (en) 2023-06-16

Family

ID=79025622

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202111488593.7A Active CN113904962B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment
CN202210141503.5A Active CN114448842B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202111488593.7A Active CN113904962B (en) 2021-12-08 2021-12-08 Resource access method and device and computing equipment

Country Status (1)

Country Link
CN (2) CN113904962B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1955924A (en) * 2005-10-27 2007-05-02 国际商业机器公司 System and method for resolving resource
FI20116301A (en) * 2011-12-21 2013-06-22 Sensinode Oy Method, device, and system for allocating resources
EP3023919A1 (en) * 2014-11-20 2016-05-25 Tata Consultancy Services Ltd. Method and system for efficent transition of information technology operations
CN107172070A (en) * 2017-06-15 2017-09-15 小草数语(北京)科技有限公司 Resource access processing method and device
WO2021203623A1 (en) * 2020-04-07 2021-10-14 北京邮电大学 Internet-of-things resource access system and resource access method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8667031B2 (en) * 2008-06-13 2014-03-04 Oracle International Corporation Reuse of shared metadata across applications via URL protocol
CN104317570B (en) * 2014-09-29 2017-12-12 北京掌中经纬技术有限公司 The apparatus and method of dynamic analysis Web applications
CN106487906B (en) * 2016-11-01 2019-05-17 北京大学(天津滨海)新一代信息技术研究院 A kind of mobile Web application protocol switching method of context aware
US10581696B2 (en) * 2017-03-29 2020-03-03 International Business Machines Corporation Intelligent information adapter generation for service management
CN107707614B (en) * 2017-08-16 2022-02-08 深圳市丰巢科技有限公司 System hop protocol-based app routing implementation method, device and storage medium
CN107733972B (en) * 2017-08-28 2020-09-08 阿里巴巴集团控股有限公司 Short link analysis method, device and equipment
CN110377289A (en) * 2019-07-01 2019-10-25 北京字节跳动网络技术有限公司 A kind of data analysis method, device, medium and electronic equipment
CN113726762A (en) * 2021-08-27 2021-11-30 四川长虹网络科技有限责任公司 Internet of things equipment protocol analysis method based on configuration file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1955924A (en) * 2005-10-27 2007-05-02 国际商业机器公司 System and method for resolving resource
FI20116301A (en) * 2011-12-21 2013-06-22 Sensinode Oy Method, device, and system for allocating resources
EP3023919A1 (en) * 2014-11-20 2016-05-25 Tata Consultancy Services Ltd. Method and system for efficent transition of information technology operations
CN107172070A (en) * 2017-06-15 2017-09-15 小草数语(北京)科技有限公司 Resource access processing method and device
WO2021203623A1 (en) * 2020-04-07 2021-10-14 北京邮电大学 Internet-of-things resource access system and resource access method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云计算网络信息资源用户访问实时规划仿真;李江涛;;计算机仿真(07);全文 *

Also Published As

Publication number Publication date
CN113904962B (en) 2022-03-18
CN114448842A (en) 2022-05-06
CN113904962A (en) 2022-01-07

Similar Documents

Publication Publication Date Title
CN107291458B (en) Plug-in construction method and system for Web application and server
CN107743616B (en) Endpoint management system providing application programming interface proxy services
CN108090064B (en) Data query method and device, data storage server and system
US9729499B2 (en) Browser and method for domain name resolution by the same
CN111651464B (en) Data processing method, system and computing device
CN111563024B (en) Method and device for monitoring container process on host machine and computing equipment
EP3933615A1 (en) Data storage method and data query method
CN110187880B (en) Method and device for identifying similar elements and computing equipment
CN105608159B (en) The method and apparatus of data buffer storage
US9436776B2 (en) Web browsing system and method for rendering dynamic resource URIs using script
CN110968765A (en) Book searching method, computing device and computer storage medium
CN114860670A (en) File operation method of user space file system and user space file system
CN113254035A (en) Driver installation method, computing device and storage medium
CN111741010B (en) Docker operation request processing method and device based on proxy and computing equipment
CN111563259B (en) Puppet process detection method and device, readable storage medium and computing device
CN114448842B (en) Resource access method and device and computing equipment
CN112380480B (en) Page jump method, computing device and storage medium
WO2018081963A1 (en) Method and device for dns resolution and network system
CN108173716B (en) Method for identifying network equipment manufacturer and computing equipment
CN107317892B (en) Network address processing method, computing device and readable storage medium
CN107508705B (en) Resource tree construction method of HTTP element and computing equipment
CN115348246A (en) Method, equipment, system and medium for packet capture debugging of multi-user online agent
CN111782157B (en) Express delivery face list printing management method, device and system
CN114637969A (en) Target object authentication method and device
CN113032790A (en) Security vulnerability processing method, system, computing 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
GR01 Patent grant
GR01 Patent grant