CN112364268A - Resource acquisition method and device, electronic equipment and storage medium - Google Patents

Resource acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112364268A
CN112364268A CN202011270902.9A CN202011270902A CN112364268A CN 112364268 A CN112364268 A CN 112364268A CN 202011270902 A CN202011270902 A CN 202011270902A CN 112364268 A CN112364268 A CN 112364268A
Authority
CN
China
Prior art keywords
resource
address
target resource
client
actual address
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.)
Pending
Application number
CN202011270902.9A
Other languages
Chinese (zh)
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.)
Weiyiyun Hangzhou Holding Co ltd
Original Assignee
Weiyiyun Hangzhou Holding 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 Weiyiyun Hangzhou Holding Co ltd filed Critical Weiyiyun Hangzhou Holding Co ltd
Priority to CN202011270902.9A priority Critical patent/CN112364268A/en
Publication of CN112364268A publication Critical patent/CN112364268A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a resource acquisition method, a resource acquisition device, electronic equipment and a storage medium, wherein the method is applied to a first service end and comprises the following steps: acquiring a resource acquisition request sent by a client, wherein the resource acquisition request carries a virtual address of a target resource; acquiring an actual address of the target resource from a configuration file according to the virtual address of the target resource; sending the target resource corresponding to the actual address to a client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address. The problem that the change of the static resource address needs to be overcome by re-releasing the software product is solved.

Description

Resource acquisition method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of computer programs, in particular to a resource acquisition method, a resource acquisition device, electronic equipment and a storage medium.
Background
Modification of any static resource at the front end inevitably causes the static resource address to change, so that the reference of the website body code to the static resource address needs to be modified, and the website body code needs to be reissued. Such front-end publishing is worthwhile for larger function iterations. However, in the case of no function iteration, the small-scale frequent update of static resources, such as the replacement of mp3 audio files, is not only tedious in process, but also causes the user experience of the website user to be affected by the main application due to frequent update.
The inventor finds in the course of implementing the present invention that there are at least changes in static resource addresses that need to be overcome by re-publishing the software product in the prior art.
Disclosure of Invention
The embodiment of the invention provides a resource acquisition method, a resource acquisition device, electronic equipment and a storage medium, and aims to solve the problem that the change of a static resource address needs to be overcome by reissuing a software product.
In a first aspect, an embodiment of the present invention provides a resource obtaining method, which is applied to a first service end, and the method includes:
acquiring a resource acquisition request sent by a client, wherein the resource acquisition request carries a virtual address of a target resource;
acquiring an actual address of the target resource from a configuration file according to the virtual address of the target resource;
sending the target resource corresponding to the actual address to a client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
In a second aspect, an embodiment of the present invention further provides a resource obtaining apparatus, which is disposed at a first service end, and includes:
the system comprises a request module, a resource obtaining module and a resource obtaining module, wherein the request module is used for obtaining a resource obtaining request sent by a client, and the resource obtaining request carries a virtual address of a target resource;
the address acquisition module is used for acquiring the actual address of the target resource from a configuration file according to the virtual address of the target resource;
the resource acquisition module is used for sending the target resource corresponding to the actual address to the client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
In a third aspect, an embodiment of the present invention further provides a resource obtaining method, applied to a client, where the method includes:
sending a resource obtaining request carrying a virtual address of a target resource to a first service end, so that the first service end obtains and returns an actual address of the target resource from a configuration file according to the virtual address;
and sending a secondary resource acquisition request carrying the actual address to a second server according to the actual address, so that the second server acquires and returns the target resource according to the actual address in the secondary resource acquisition request.
In a fourth aspect, an embodiment of the present invention further provides a resource obtaining apparatus, which is disposed at a client, and includes:
a first request module, configured to send a resource acquisition request carrying a virtual address of a target resource to a first service end, so that the first service end acquires from a configuration file according to the virtual address and returns an actual address of the target resource;
and the second request module is used for sending a secondary resource acquisition request carrying the actual address to a second server according to the actual address, so that the second server acquires and returns the target resource according to the actual address in the secondary resource acquisition request.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a resource acquisition method as in any embodiment.
In a sixth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the resource acquisition method according to any of the embodiments of the present invention.
According to the technical scheme of the resource obtaining method provided by the embodiment of the invention, the mapping relation between the virtual address and the actual address is set in the configuration file, so that the first server can accurately determine the actual address of the target resource according to the virtual address and the mapping relation in the resource obtaining request, when the actual address of the target resource changes, only the virtual address of the target resource in the configuration file is required to point to the actual address of the modified target resource, the process that the client obtains the target resource through the virtual address is not influenced, and the process that the first server determines the actual address of the target resource according to the virtual address is also not influenced, so that software programs used by the client and the first server do not need to be modified, namely software products of the client or the first server do not need to be released again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a resource obtaining method according to an embodiment of the present invention;
fig. 2 is a block diagram of a resource acquiring apparatus according to a second embodiment of the present invention;
fig. 3 is a flowchart of a resource obtaining method according to a third embodiment of the present invention;
fig. 4 is a block diagram of a resource acquiring apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described through embodiments with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Fig. 1 is a flowchart of a resource obtaining method according to an embodiment of the present invention. The technical scheme of the embodiment is particularly suitable for the condition that the static resource address changes frequently. The method can be executed by a resource acquisition device provided by the embodiment of the invention, and the device can be realized in a software and/or hardware manner and is configured to be applied in electronic equipment.
The method is applied to a first service end and comprises the following steps:
s110, a resource obtaining request sent by the client is obtained, and the resource obtaining request carries a virtual address of a target resource.
The client is a user side, such as a user PC side, a user mobile phone side, and the like. The target resource is a static resource including, but not limited to, picture, audio, video, and JS file (Javascript) lights, etc. The virtual address is not the actual address of the target resource, i.e., the virtual address does not point directly to the target resource.
When a user wants to acquire a target resource, a resource acquisition request of the target resource is directly input at a client, the client sends the resource acquisition request to a first service end, and the first service end receives the resource acquisition request and extracts a virtual address of the target resource from the resource acquisition request.
In one embodiment, when a user wants to obtain a target resource, the user inputs a name of the target resource in a client segment, the client generates a resource obtaining request for obtaining an actual address of the target resource according to the name of the target resource, and the first service end receives the resource obtaining request and extracts a virtual address of the target resource from the resource obtaining request.
Illustratively, when a user wants to search for a song a, when the client inputs a song a address and detects a search requirement of the song a, a resource acquisition request carrying a virtual address AA is generated and sent to a first service end, the first service end receives the resource acquisition request, extracts the virtual address AA from the resource acquisition request, and determines an actual address a-a corresponding to the virtual address AA according to a mapping relationship between the virtual address AA and the virtual address AA in a configuration file.
And S120, acquiring the actual address of the target resource from the configuration file according to the virtual address of the target resource.
The configuration file is used for storing the mapping relation between the virtual address and the actual address of the resource.
The mapping relation is a corresponding relation between virtual addresses and real addresses of resources, and the virtual address of each resource corresponds to one or more real addresses. When the virtual address of the resource corresponds to a plurality of real addresses, the plurality of real addresses are set with an access sequence, and the first server determines the real address corresponding to the current virtual address according to the access sequence. In other words, when the virtual address of a certain resource corresponds to multiple real addresses, the first service end preferably uses the first ranked real address as the real address of the resource, and only when the first ranked real address cannot acquire the corresponding resource, uses the second ranked real address as the real address of the resource.
For the convenience of management of mapping relationships, in this embodiment, it is preferable to store mapping relationships between different types of static resource addresses through different configuration files, for example, store mapping relationships between virtual addresses and actual addresses of audio resources through a configuration file a, and store mapping relationships between virtual addresses and actual addresses of picture resources through a configuration file B.
After extracting the virtual address from the resource acquisition request, the first service end determines an actual address corresponding to the virtual address of the target resource according to the virtual address and the mapping relation between the virtual address and the actual address. Wherein the real address points directly to the target resource.
Illustratively, when a user wants to search for a song a, when the client inputs a song a address and detects a search requirement of the song a, a resource acquisition request carrying a virtual address AA is generated and sent to a first server, the first server receives the resource acquisition request, extracts the virtual address AA from the resource acquisition request, and determines an actual address a-a corresponding to the virtual address AA according to a mapping relationship between the virtual address AA and the virtual address AA in a configuration file.
S130, sending the target resource corresponding to the actual address to the client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
After determining the actual address of the target resource, the first service end determines the target resource pointed by the actual address, and sends the target resource to the client. The first server determines a virtual address of a target resource through a resource acquisition request, determines an actual address of the target resource and the target resource pointed by the actual address according to the virtual address and a mapping relation between the virtual address and the corresponding actual address, and finally sends the target resource pointed by the actual address to the client. It can be understood that, since the real address is determined by the virtual address and the mapping relationship between the virtual address and the virtual address, when the real address of the resource changes, the virtual address only needs to be pointed to the modified real address, and the software program of the first service end does not need to be modified, so that the software version of the first service end does not need to be reissued.
In one embodiment, after determining an actual address of a target resource, a first service end directly sends the actual address to a client, the client receives the actual address and generates a secondary resource acquisition request according to the actual address, the secondary resource acquisition request carries the actual address of the target resource, and a second service end acquires a corresponding target resource according to the actual address of the target resource and sends the acquired target resource to the client.
It can be understood that, no matter how the actual address of the resource changes, when the virtual address does not change, the resource acquisition request of the resource acquisition request at the client side does not change; on the premise that the mapping relation between the virtual address and the changed actual address is correct, the first server directly sends the actual address pointed by the virtual address of the target resource to the client, so that the operation mode of the first server is not changed, software of the first server does not need to be modified, and the first server does not need to be reissued; the client generates a secondary resource acquisition request according to the received actual address, so that the generation mode of the secondary resource acquisition request is not changed no matter whether the actual address of the resource is correct or not, and client software does not need to be modified and reissued; the second server side directly obtains the resources according to the actual addresses of the resources, and the determination work of the actual addresses is obtained by the first server side, so that the operation of the second server side is not influenced by the change of the actual addresses, the change of the actual addresses of the resources does not influence the operation of the second server side, and the software program of the second server side does not need to be modified and is not required to be released again.
According to the technical scheme of the resource obtaining method provided by the embodiment of the invention, the mapping relation between the virtual address and the actual address is set in the configuration file, so that the first server can accurately determine the actual address of the target resource according to the virtual address and the mapping relation in the resource obtaining request, when the actual address of the target resource changes, only the virtual address of the target resource in the configuration file is required to point to the actual address of the modified target resource, the process that the client obtains the target resource through the virtual address is not influenced, and the process that the first server determines the actual address of the target resource according to the virtual address is also not influenced, so that software programs used by the client and the first server do not need to be modified, namely software products of the client or the first server do not need to be released again.
Example two
Fig. 2 is a block diagram of a resource obtaining apparatus according to a second embodiment of the present invention, configured to execute the resource obtaining method according to any of the above embodiments, and configured at a first service end. The resource acquiring device comprises a request module 11, an address acquiring module 12 and a resource acquiring module 13. The request module 11 is configured to obtain a resource obtaining request sent by a client, where the resource obtaining request carries a virtual address of a target resource; the address obtaining module 12 is configured to obtain an actual address of the target resource from the configuration file according to the virtual address of the target resource; the resource obtaining module 13 is configured to send a target resource corresponding to the actual address to the client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
Preferably, the configuration file stores at least two virtual addresses and a mapping relationship between each virtual address and a corresponding real address.
Preferably, the address obtaining module is further configured to update the mapping relationship of the target resource to the corresponding relationship between the virtual address of the target resource and the modified actual address when detecting that the actual address corresponding to the virtual address of any resource to be obtained in the configuration file is modified.
Compared with the prior art, the technical scheme of the resource acquisition device provided by the embodiment of the invention has the advantages that the mapping relation between the virtual address and the actual address is set in the configuration file, so that the first server can accurately determine the actual address of the target resource according to the virtual address and the mapping relation in the resource acquisition request, when the actual address of the target resource is changed, only the virtual address of the target resource in the configuration file is required to point to the actual address of the modified target resource, the process of acquiring the target resource by the client through the virtual address is not influenced, and the process of determining the actual address of the target resource by the first server according to the virtual address is also not influenced, so that software programs used by the client and the first server do not need to be modified, namely software products of the client or the first server do not need to be released again.
The resource acquisition device provided by the embodiment of the invention can execute the resource acquisition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE III
Fig. 3 is a flowchart of a resource obtaining method according to a third embodiment of the present invention. The technical scheme of the embodiment of the invention is suitable for the condition that the static resource address changes frequently. The method is applied to the client and comprises the following steps:
s310, sending a resource obtaining request carrying the virtual address of the target resource to the first service end, so that the first service end obtains the actual address of the target resource from the configuration file according to the virtual address and returns the actual address of the target resource.
The client is a user side, such as a user PC side, a user mobile phone side, and the like. The target resource is a static resource including, but not limited to, pictures, audio, video, and text. The virtual address is not the actual address of the target resource, i.e., the virtual address does not point directly to the target resource.
When a user wants to acquire a target resource, a resource acquisition request of the target resource is directly input at a client, the client sends the resource acquisition request to a first service end, and the first service end receives the resource acquisition request and extracts a virtual address of the target resource from the resource acquisition request.
In one embodiment, when a user wants to obtain a target resource, the user inputs a name of the target resource in a client segment, the client generates a resource obtaining request for obtaining an actual address of the target resource according to the name of the target resource, and the first service end receives the resource obtaining request and extracts a virtual address of the target resource from the resource obtaining request.
Illustratively, when a user wants to search for a song a, when the client inputs a song a address and detects a search requirement of the song a, a resource acquisition request carrying a virtual address AA is generated and sent to a first service end, the first service end receives the resource acquisition request, extracts the virtual address AA from the resource acquisition request, and determines an actual address a-a corresponding to the virtual address AA according to a mapping relationship between the virtual address AA and the virtual address AA in a configuration file.
The configuration file is used for storing the mapping relation between the virtual address and the actual address of the resource, and is preferably stored in the first server.
The mapping relation is a corresponding relation between virtual addresses and real addresses of resources, and the virtual address of each resource corresponds to one or more real addresses. When the virtual address of the resource corresponds to a plurality of real addresses, the plurality of real addresses are set with an access sequence, and the first server determines the real address corresponding to the current virtual address according to the access sequence. In other words, when the virtual address of a certain resource corresponds to multiple real addresses, the first service end preferably uses the first ranked real address as the real address of the resource, and only when the first ranked real address cannot acquire the corresponding resource, uses the second ranked real address as the real address of the resource.
For the convenience of management of mapping relationships, in this embodiment, it is preferable to store mapping relationships between different types of static resource addresses through different configuration files, for example, store mapping relationships between virtual addresses and actual addresses of audio resources through a configuration file a, and store mapping relationships between virtual addresses and actual addresses of picture resources through a configuration file B.
And S320, sending a resource acquisition request carrying the actual address to be acquired to the second server according to the actual address so that the second server acquires and returns the target resource according to the actual address.
The client receives the actual address, generates a secondary resource obtaining request according to the actual address, the secondary resource obtaining request carries the actual address of the target resource, and the second client obtains the corresponding target resource according to the actual address of the target resource and sends the obtained target resource to the client.
It can be understood that, no matter how the actual address of the resource changes, when the virtual address does not change, the resource acquisition request of the resource acquisition request at the client side does not change; on the premise that the mapping relation between the virtual address and the changed actual address is correct, the first server can accurately determine the changed actual address of the resource according to the virtual address of the resource and send the changed actual address to the client, so that the operation mode of the first server is not changed, software of the first server does not need to be modified, and the first server does not need to be released again; the client generates a secondary resource acquisition request according to the changed actual address, so that the generation mode of the secondary resource acquisition request is not changed no matter whether the actual address of the resource is correct or not, and client software does not need to be modified and reissued; the second server side directly obtains the resources according to the actual addresses of the resources, and the determination work of the actual addresses is obtained by the first server side, so that the operation of the second server side is not influenced by the change of the actual addresses, the change of the actual addresses of the resources does not influence the operation of the second server side, and the software program of the second server side does not need to be modified and is not required to be released again.
Compared with the prior art, the technical scheme of the resource acquisition method provided by the embodiment of the invention has the advantages that the mapping relation between the virtual address and the actual address is set in the configuration file, so that the first server can accurately determine the actual address of the target resource according to the virtual address and the mapping relation in the resource acquisition request, when the actual address of the target resource is changed, only the virtual address of the target resource in the configuration file is required to point to the actual address of the modified target resource, the flow of acquiring the target resource by the client through the virtual address is not influenced, the flow of determining the actual address of the target resource by the first server according to the virtual address is also not influenced, the second client is also not influenced to acquire the target resource according to the secondary resource acquisition request containing the actual address of the target resource, and software programs used by the client, the first server and the second server do not need to be modified, i.e. without re-distribution.
Example four
Fig. 4 is a block diagram of a resource obtaining apparatus according to a fourth embodiment of the present invention, configured to execute the resource obtaining method according to any of the foregoing embodiments, and configured to a client.
The device comprises a first request module 21 and a second request module 22, wherein the first request module 21 is used for sending a resource acquisition request carrying a virtual address of a target resource to a first service end, so that the first service end acquires from a configuration file according to the virtual address and returns a real address of the target resource; the second request module 22 is configured to send a resource obtaining request carrying a to-be-actual address to the second server according to the actual address, so that the second server obtains and returns the target resource according to the actual address.
Compared with the prior art, the technical scheme of the resource acquisition device provided by the embodiment of the invention has the advantages that the mapping relation between the virtual address and the actual address is set in the configuration file, so that the first server can accurately determine the actual address of the target resource according to the virtual address and the mapping relation in the resource acquisition request, when the actual address of the target resource is changed, only the virtual address of the target resource in the configuration file is required to point to the actual address of the modified target resource, the flow of acquiring the target resource by the client through the virtual address is not influenced, the flow of determining the actual address of the target resource by the first server according to the virtual address is also not influenced, the second client is also not influenced to acquire the target resource according to the secondary resource acquisition request containing the actual address of the target resource, and software programs used by the client, the first server and the second server do not need to be modified, i.e. without re-distribution.
The resource acquisition device provided by the embodiment of the invention can execute the resource acquisition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary device 40 suitable for use in implementing embodiments of the present invention. The device 40 shown in fig. 5 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
As shown in FIG. 5, device 40 is embodied in a general purpose computing device. The components of device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. Device 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
Device 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with device 40, and/or with any devices (e.g., network card, modem, etc.) that enable device 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, device 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via network adapter 412. As shown, network adapter 412 communicates with the other modules of device 40 via bus 403. It should be appreciated that although not shown in FIG. 5, other hardware and/or software modules may be used in conjunction with device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, to implement the resource acquisition method provided by the embodiment of the present invention.
EXAMPLE six
Embodiments of the present invention also provide a storage medium containing computer-executable instructions for performing a resource acquisition method when executed by a computer processor. The method is applied to a first service end and comprises the following steps:
acquiring a resource acquisition request sent by a client, wherein the resource acquisition request carries a virtual address of a target resource;
acquiring an actual address of the target resource from a configuration file according to the virtual address of the target resource;
sending the target resource corresponding to the actual address to a client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A resource obtaining method applied to a first service end comprises the following steps:
acquiring a resource acquisition request sent by a client, wherein the resource acquisition request carries a virtual address of a target resource;
acquiring an actual address of the target resource from a configuration file according to the virtual address of the target resource;
sending the target resource corresponding to the actual address to a client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
2. The method of claim 1, wherein the configuration file stores at least two virtual addresses and a mapping relationship between each virtual address and a corresponding real address.
3. The method of claim 2, further comprising:
and when detecting that the actual address corresponding to the virtual address of any resource to be acquired in the configuration file is modified, updating the mapping relation of the target resource into the corresponding relation between the virtual address of the target resource and the modified actual address.
4. The method of any of claims 1-3, wherein the target resource is a static resource.
5. A resource acquisition device, disposed at a first service end, includes:
the system comprises a request module, a resource obtaining module and a resource obtaining module, wherein the request module is used for obtaining a resource obtaining request sent by a client, and the resource obtaining request carries a virtual address of a target resource;
the address acquisition module is used for acquiring the actual address of the target resource from a configuration file according to the virtual address of the target resource;
the resource acquisition module is used for sending the target resource corresponding to the actual address to the client; or sending the actual address to the client so that the client acquires the target resource from the second server according to the actual address.
6. A resource acquisition method is applied to a client and comprises the following steps:
sending a resource obtaining request carrying a virtual address of a target resource to a first service end, so that the first service end obtains and returns an actual address of the target resource from a configuration file according to the virtual address;
and sending a secondary resource acquisition request carrying the actual address to a second server according to the actual address, so that the second server acquires and returns the target resource according to the actual address in the secondary resource acquisition request.
7. The resource acquisition device is arranged at a client and comprises:
a first request module, configured to send a resource acquisition request carrying a virtual address of a target resource to a first service end, so that the first service end acquires from a configuration file according to the virtual address and returns an actual address of the target resource;
and the second request module is used for sending a secondary resource acquisition request carrying the actual address to a second server according to the actual address, so that the second server acquires and returns the target resource according to the actual address in the secondary resource acquisition request.
8. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the resource acquisition method of any one of claims 1-3.
9. The electronic device of claim 8,
the storage device stores the configuration file.
10. A storage medium containing computer-executable instructions for performing the resource acquisition method of any one of claims 1-4 or 6 when executed by a computer processor.
CN202011270902.9A 2020-11-13 2020-11-13 Resource acquisition method and device, electronic equipment and storage medium Pending CN112364268A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011270902.9A CN112364268A (en) 2020-11-13 2020-11-13 Resource acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011270902.9A CN112364268A (en) 2020-11-13 2020-11-13 Resource acquisition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112364268A true CN112364268A (en) 2021-02-12

Family

ID=74514836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011270902.9A Pending CN112364268A (en) 2020-11-13 2020-11-13 Resource acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112364268A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160010A (en) * 2021-04-22 2021-07-23 北京润尼尔网络科技有限公司 Method and device for acquiring virtual resources and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107493329A (en) * 2017-08-15 2017-12-19 诸葛晴凤 A kind of remote document access method of distributed memory file system
CN110516465A (en) * 2019-07-11 2019-11-29 平安普惠企业管理有限公司 Management method, device, equipment and the computer readable storage medium of resource address
CN110727499A (en) * 2019-09-18 2020-01-24 平安科技(深圳)有限公司 Resource data acquisition method and device, computer equipment and storage medium
CN111913738A (en) * 2020-08-19 2020-11-10 工银科技有限公司 Access request processing method, device, computing equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107493329A (en) * 2017-08-15 2017-12-19 诸葛晴凤 A kind of remote document access method of distributed memory file system
CN110516465A (en) * 2019-07-11 2019-11-29 平安普惠企业管理有限公司 Management method, device, equipment and the computer readable storage medium of resource address
CN110727499A (en) * 2019-09-18 2020-01-24 平安科技(深圳)有限公司 Resource data acquisition method and device, computer equipment and storage medium
CN111913738A (en) * 2020-08-19 2020-11-10 工银科技有限公司 Access request processing method, device, computing equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160010A (en) * 2021-04-22 2021-07-23 北京润尼尔网络科技有限公司 Method and device for acquiring virtual resources and electronic equipment

Similar Documents

Publication Publication Date Title
CN111090628B (en) Data processing method and device, storage medium and electronic equipment
US8832666B2 (en) Dynamic instrumentation
CN110287146B (en) Method, device and computer storage medium for downloading application
CN109284108B (en) Unmanned vehicle data storage method and device, electronic equipment and storage medium
CN110929128A (en) Data crawling method, device, equipment and medium
CN111737564A (en) Information query method, device, equipment and medium
CN110975293A (en) Method, device, server and medium for establishing resource reference relation table
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
CN111818145B (en) File transmission method, device, system, equipment and storage medium
CN110134869B (en) Information pushing method, device, equipment and storage medium
CN112100092B (en) Information caching method, device, equipment and medium
CN110175128B (en) Similar code case acquisition method, device, equipment and storage medium
CN114205156A (en) Message detection method and device for tangent plane technology, electronic equipment and medium
CN109669790A (en) Data sharing method, device, shared platform and storage medium based on cloud platform
CN108399128A (en) A kind of generation method of user data, device, server and storage medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN112799760A (en) Form rendering method and device
CN112000491A (en) Application program interface calling method, device, equipment and storage medium
CN109189332A (en) A kind of disk hanging method, device, server and storage medium
CN107992457B (en) Information conversion method, device, terminal equipment and storage medium
CN113807056B (en) Document name sequence error correction method, device and equipment
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN114528509A (en) Page display processing method and device, electronic equipment and storage medium
CN110515807B (en) Database table monitoring method, device, equipment and storage medium
CN112416422A (en) Development version file submitting method, device, 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210212

RJ01 Rejection of invention patent application after publication