CN114579205A - Resource request processing method and device, electronic equipment and readable storage medium - Google Patents

Resource request processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114579205A
CN114579205A CN202210233063.6A CN202210233063A CN114579205A CN 114579205 A CN114579205 A CN 114579205A CN 202210233063 A CN202210233063 A CN 202210233063A CN 114579205 A CN114579205 A CN 114579205A
Authority
CN
China
Prior art keywords
configuration file
switch configuration
switch
blue
resource request
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
CN202210233063.6A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202210233063.6A priority Critical patent/CN114579205A/en
Publication of CN114579205A publication Critical patent/CN114579205A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a resource request processing method, a resource request processing device, electronic equipment and a readable storage medium, wherein the method comprises the following steps: directing the received resource request to a static resource service; receiving a feedback result of the static resource service, and determining a switch configuration file source according to the feedback result, wherein the switch configuration file source is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of a switch configuration file corresponding to the resource request; acquiring a switch configuration file from the determined source of the switch configuration file; and processing the resource request according to the configuration information of the switch configuration file. This application adopts the mode of visiting blue-green flow switch configuration file, has avoided all going to visit the condition of requesting blue-green flow interface at every turn, very big release server pressure, the mechanism of ingenious browser cache has been utilized, does not have obvious influence to target project page performance.

Description

Resource request processing method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a resource request, an electronic device, and a readable storage medium.
Background
At present, in the IT field, in the process of publishing a large-scale software project, in order to ensure that the problem can be found in time and the affected customers can be reduced as far as possible, a blue-green publishing mode is adopted. That is, in the process of publishing, new and old resources exist in production (for convenience of description, the blue resource is a new version resource, and the green resource is a previous version resource). In the process of publishing, the traffic is continuously switched to blue resources by shunting of the server, so that the client gradually starts to use newly published resources. Common flow switching phases are 1%, 10%, 50% and 100%. In the process of flow switching, only after one stage passes verification, the flow is switched to the next larger flow proportion.
In this publishing process, there is a problem, for example, when the traffic is switched from 50% to 100% in this stage, there is a batch of clients requesting green services through green front-end resources in the 50% traffic stage, and at this time, the traffic is suddenly switched to the blue environment, there is a case where the green front-end resources request blue services, which is equivalent to requesting front-end resources of a new version using front-end resources of the previous version, and in this case, if a service developer does not make this part compatible in the case of writing and modifying new demand codes, an abnormal problem occurs.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present application provide a resource request processing method and apparatus, an electronic device, and a readable storage medium to request processing of a resource, so as to overcome or partially overcome the disadvantages of the prior art.
In a first aspect, a method for processing a resource request is provided, including:
directing the received resource request to a static resource service;
receiving a feedback result of the static resource service, and determining a source of a switch configuration file according to the feedback result, wherein the source of the switch configuration file is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of the switch configuration file corresponding to the resource request;
acquiring a switch configuration file from the determined source of the switch configuration file;
and processing the resource request according to the configuration information of the switch configuration file.
In a second aspect, there is provided a resource request processing apparatus, the apparatus comprising:
a directing unit for directing the received resource request to a static resource service;
a receiving unit, configured to receive a feedback result of the static resource service, and determine a switch configuration file source according to the feedback result, where the switch configuration file source is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of a switch configuration file corresponding to the resource request;
the acquisition unit is used for acquiring the switch configuration file from the determined switch configuration file source;
and the processing unit is used for processing the resource request according to the configuration information of the switch configuration file.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform any of the methods described above.
In a fourth aspect, this application embodiment also provides a computer-readable storage medium storing one or more programs which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform any of the methods described above.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
aiming at the situation that green resource requests blue service possibly occur in the replacement of new and old versions and cannot be compatible, the application provides a method for combining the static resource service of a server with browser cache, and the received resource requests are guided to the static resource service; and reading the switch configuration file from the browser cache or the static resource service according to a feedback result returned by the static resource service, and feeding back the resource request according to the configuration information of the switch configuration file. According to the method and the system, a developer does not need to modify the flow control platform and other service terminals, the problem that a target project is compatible from a green resource request to a blue environment in a blue-green edition sending stage can be solved, and the burden of workers is greatly reduced; the mode of accessing the blue-green flow switch configuration file is adopted, the condition that a request blue-green flow interface is accessed every time is avoided, the pressure of a server is greatly released, a cache mechanism of a browser is skillfully utilized, and the page performance of a target project is not obviously influenced; in addition, because the code logic and the service logic of the method are completely decoupled, the execution of the existing service logic code cannot be influenced, and meanwhile, the code quantity of the tool pack is extremely small, the pressure on the size of the existing front-end resource pack cannot be caused, and the phenomenon that the resource loading speed is slowed down after the use is avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 shows a flow diagram of a resource request processing method according to an embodiment of the application;
FIG. 2 shows a flow diagram of a resource request processing method according to another embodiment of the present application;
FIG. 3 shows a schematic structural diagram of a resource request processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
The process of applying the version sending, that is, the process of replacing the existing old version of the user terminal with the new version, is a process executed step by step, the common traffic switching stages are 1%, 10%, 50%, and 100%, and only when the new version replaced in one stage is verified, the next traffic switching stage is entered. It should be noted that, in the art, the old version is generally defined as green resource, and the new version is defined as blue resource, and the definition of the industry convention is used in the following statement of the present application.
In the release process, there is a problem that when the traffic switching stage is switched from 50% to 100%, there are some customers that originally request the green service through the green front-end resource in the 50% traffic stage, but because the traffic is suddenly switched to the blue environment of 100%, there is a case that the green front-end resource requests the blue service, which is equivalent to using the old version of the front-end resource, and requesting the new version of the blue service. In this case, if the service development worker does not do compatible work when writing and modifying the new required code, an abnormal problem may occur.
Fig. 1 is a flowchart illustrating a resource request processing method according to an embodiment of the present application, and as can be seen from fig. 1, at least steps S110 to S140 of the present application:
step S110: the received resource request is directed to a static resource service.
The architecture of the internet is based on a client and server model, that is, various resources are stored on a server, and a user accesses the resources on the server through the client, and a specific access process is realized through an HTTP (Hypertext transfer protocol) protocol.
The HTTP protocol is based on a request/response mode, and the basic working principle is as follows: the user sends a resource request at the client, the request is made to the server through the HTTP, the server transmits the data requested by the client to the client after receiving the resource request from the client, the action is called response, the client extracts the received data and carries out corresponding loading, displaying, playing and the like, and the user obtains the required information.
In the prior art, the resource request is usually performed by the user through the interface of the server based on the request/response mode, that is, the user needs to access the traffic interface of the request blue-green resource each time when requesting the blue-green resource, which causes a great pressure on the server.
The method is different from the prior art, and the static resource service of the server and the browser cache are ingeniously combined, so that a large amount of accesses to the server interface are avoided.
Specifically, after receiving a resource request sent by a user at a terminal device, a server guides the resource request to a static resource service, and a latest switch configuration file is stored in the static resource service and contains configuration information related to blue-green resource conversion.
The configuration information can be configured by a service development worker, and includes but is not limited to a blue-green flow proportional switch file address, an interface request method of a target project and the like.
Step S120: and receiving a feedback result of the static resource service, and determining a switch configuration file source according to the feedback result, wherein the switch configuration file source is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of a switch configuration file corresponding to the resource request.
And after receiving the resource request, the static resource service reads a switch configuration file corresponding to the resource request, wherein the switch configuration file belongs to one of the static resources, and determines a feedback result according to the updating condition of the switch configuration file and returns the feedback result.
Specifically, in some embodiments of the present application, the static resource service stores the current latest switch configuration file and the last requested switch configuration file, and if the current latest switch configuration file and the last requested switch configuration file are consistent, it indicates that the switch configuration file is not updated after the last processing of the related resource request, and the switch configuration file in the browser cache is valid at this time, in this case, the static resource service returns a first feedback result, and the result may be understood that the switch configuration file is not updated.
If the two are not consistent, the switch configuration file is updated after the last time of processing the related resource request, and the switch configuration file in the browser cache is invalid at this time, in this case, the static resource service returns a second feedback result, and the result can be understood that the switch configuration file is updated.
It should be noted that, the browser has a cache, and the cache is cached in the browser cache after each request of the switch configuration file, and the cache is usually implemented in an overlay manner. Except the switch configuration file, the browser also caches a blue-green identifier of the existing version of the user terminal, if the existing version is the old version, the blue-green identifier is green, and the resource requested by the user terminal is green resource at the moment; if the existing version is the new version, the blue-green identifier is blue, which indicates that the resource requested by the user terminal is a blue resource at this time.
After receiving a request feedback result of the static resource service, determining a source of the switch configuration file according to the result, specifically, if the request feedback result is a first request feedback result, determining that the source of the switch configuration file is a browser cache; and if the request feedback result is a second request feedback result, determining that the source of the switch configuration file is the static resource service.
It should be noted that the switch configuration file needs to be added to the root directory of the target item corresponding to the switch configuration file in advance. In an actual application scenario, the method of the present application forms a tool, and the tool is integrally introduced into the root directory of the target item, and specifically, but not limited to, in the command line (in case of a mac system, in the terminal), the current item root directory is located, the command is executed, and the tool can be added into the current frame item.
Step S130: and acquiring the switch configuration file from the determined source of the switch configuration file.
Upon determining the switch profile source, the switch profile may be obtained from the corresponding source. If the source of the switch configuration file is the browser cache, directly reading the switch configuration file from the browser cache; and if the source of the switch configuration file is the static resource service, reading the switch configuration file from the static resource service, and then updating the existing switch configuration file in the browser cache so as to enable the switch configuration file to be consistent with the latest switch configuration file.
Step S140: and processing the resource request according to the configuration information of the switch configuration file.
And finally, feeding back the resource request according to the configuration information of the switch configuration file.
In the configuration information, the current blue-green flow switching stage can be obtained, if the current blue-green flow switching stage is 10% blue, the process that the flow switching stage is converted from 50% to 100% is not yet achieved, and at the moment, the resource request is fed back according to the original method
If the current node is 100% blue, it is described that the current node is the process of switching from 50% to 100% in the traffic switching stage, and at this time, the blue resource is obtained from the directional manner given by the configuration information, and is returned to the user terminal as the feedback of the resource request.
As can be seen from the method shown in fig. 1, the present application provides a method for combining a static resource service of a server with a browser cache, for the situation that green resource requests for blue service may cause incompatibility in the replacement of new and old versions, by directing a received resource request to the static resource service; and reading the switch configuration file from the browser cache or the static resource service according to a feedback result returned by the static resource service, and feeding back the resource request according to the configuration information of the switch configuration file. According to the method and the system, a developer does not need to modify a flow control platform and other service terminals, the problem that a target project is compatible from a green resource request to a blue environment in a blue-green edition sending stage can be solved, and the burden of workers is greatly reduced; the method for accessing the blue-green flow switch configuration file is adopted, the condition that the blue-green flow interface is requested to be accessed every time is avoided, the pressure of a server is greatly released, a browser cache mechanism is skillfully utilized, and the page performance of a target project is not obviously influenced; in addition, because the code logic and the service logic of the method are completely decoupled, the execution of the existing service logic code cannot be influenced, and meanwhile, the code quantity of the tool pack is extremely small, the pressure on the size of the existing front-end resource pack cannot be caused, and the phenomenon that the resource loading speed is slowed down after the use is avoided.
In some embodiments of the present application, in the method, the determining a switch profile source according to the feedback result includes: if the feedback result is the first code, determining that the source of the switch configuration file is the browser cache; and if the feedback result is the second code, determining that the source of the switch configuration file is the static resource service.
Wherein the feedback result is determined by the static resource service according to the following method: if the switch configuration file in the static resource service is determined to be consistent with a historical switch configuration file, determining that the feedback result is a first code; and if the switch configuration file in the static resource service is determined to be inconsistent with the historical switch configuration file, determining that the feedback result is a second code.
The presentation of the feedback result by the static resource service is usually given in the form of a designated code, such as 304, 200, and the like, and when the static resource service determines that the switch configuration file in the static resource service is consistent with the last saved switch configuration file, the type of the switch cache returned by the static resource service is a negotiation cache, which is usually represented by a first code, such as 304, which indicates that the switch configuration file in the browser cache can be directly invoked. When the static resource service determines that the switch configuration file in the static resource service is not consistent with the saved last switch configuration file, the switch configuration file is considered to be updated, and a second code is returned at this time, such as 200, which indicates that the latest switch configuration file needs to be acquired from the static resource service.
In some embodiments of the present application, in the method described above, the processing the resource request according to the configuration information of the switch configuration file includes: reading information of the switch configuration file, wherein the information of the switch configuration file comprises: blue-green flow proportional switch file address, target project interface request method; adopting a homonymy function to package an interface request method of the target project; based on the homonymous function, acquiring a blue-green flow proportional switch file according to the blue-green flow proportional switch file address; and determining whether the first identifier of the blue-green flow proportional switch file is 100% blue, and if not, executing an interface request method of the target project.
In the switch configuration file, the switch file may not be directly included, but only include a blue-green flow rate proportional switch file address, because the switch configuration file may be added to the root directory of the target item, if the switch configuration file directly includes the blue-green flow rate proportional switch file, each time the worker wants to modify the switch configuration file, the worker also needs to modify the file in the root directory, which is cumbersome. However, in some embodiments of the present application, the blue-green traffic proportion switch file is stored in a specific area, and the switch configuration file only contains an address for accessing the specific area, so that when the worker wants to modify the blue-green traffic proportion, the worker only needs to access the specific area to modify the blue-green traffic proportion, and does not need to enter the root directory of the project.
When the resource request is fed back according to the configuration information of the switch configuration file, firstly, the address of the blue-green flow proportional switch file is read from the switch configuration file, and then, the blue-green flow proportional switch file is accessed and read according to the address, wherein the blue-green flow proportional switch file includes but is not limited to flow, blue-green identification and the like, and if the blue-green flow proportional switch file includes:
{
flow rate: 10 percent of
Blue-green label: blue (B)
}。
In the switch configuration file, the method also comprises an interface request method of a target item, and currently, the method covers three most commonly used front-end interface request methods, namely an ajax method of Jquery, a third-party axios library recommended by vue and act currently, and a native fetch method carried by a new version browser. Any of the above methods is generally employed for a target project, although other interface request methods in the prior art are not excluded.
When a specific request method is read in the switch configuration file, the interface request method of the target project is encapsulated by adopting a homonymy function, specifically, the current interface request method is read and copied, and then the read interface request method is wrapped in a newly-built homonymy function to be used as the rewriting of the interface request method. When the method is executed, the outer layer function, namely the same-name function, is executed, and the interface request method of the inner package is executed only when needed.
Then, it is determined whether the first identifier of the blue-green flow rate proportional switch file is 100% blue, and in some embodiments of the present application, if the first identifier is not 100% blue, for example, 10% blue, it indicates that the stage of converting from 50% to 100% has not been reached, and at this time, the inner layer function wrapped by the same-name function is executed, that is, the interface request method of the original target item.
In some embodiments of the present application, in the method, the processing the resource request according to the configuration information of the switch configuration file further includes: if the first identifier of the blue-green flow proportional switch file is 100% blue, reading a second identifier in a browser cache; and if the blue-green label in the second identifier is blue, executing the inner layer function wrapped by the homonymy function.
If the blue-green label in the second identifier is blue, it indicates that the resource requested by the user terminal is originally a blue resource, and at this time, the inner layer function wrapped by the same-name function is executed, that is, the interface request method of the original target project.
In some embodiments of the present application, the processing the resource request according to the configuration information of the switch configuration file further includes: if the blue-green label in the second identification is green, reading an interface with overtime login in the configuration information of the switch configuration file and returning analog data; and determining an application entry address according to the simulated data returned by the interface with the overtime login, and feeding back the application entry address to the request terminal.
In other embodiments of the present application, the processing the resource request according to the configuration information of the switch configuration file further includes: if the blue-green label in the second identifier is green, reading an application entry address in the configuration information of the switch configuration file; and feeding back the application entry address to the request terminal.
That is, if the cyan label in the second identifier is green, it indicates that a terminal requests a blue service using a green resource, and in this case, the terminal can perform processing in any one of the following two ways:
firstly, reading an interface returning simulation data of login timeout in configuration information of a switch configuration file, determining an application entry address according to the interface returning simulation data of login timeout, and feeding the application entry address back to the terminal.
The interface return simulation data which is about to be logged in overtime is used as the data requested by the current interface and directly returned to the caller, and when the caller acquires the state of logging in overtime, the caller can guide the page to jump to the login interface. At this time, the user enters from the entrance again, and the subsequent process is performed after the latest blue resource is loaded successfully.
And secondly, reading an application entry address in the configuration information of the switch configuration file, and feeding back the application entry address to the terminal.
That is, if the entry address is directly configured in the switch configuration file, for example, a login page is found, the method for jumping to the page is directly called, the user jumps to the entry page, and then the user performs the subsequent process after requesting new resources to come again.
Fig. 2 is a schematic flowchart illustrating a resource request processing method according to another embodiment of the present application, and as can be seen from fig. 2, the present embodiment includes:
and configuring a switch configuration file, and adding the switch configuration file into a root directory of the target item, wherein the switch configuration file comprises a blue-green flow proportion switch file address, an interface request method of the target item, and simulated data returned by an interface with overtime login.
A resource request is received and directed to a static resource service.
Determining whether the feedback result of the static resource service is a first code or a second code, if the feedback result is the first code, determining that the source of the switch configuration file is a browser cache, and reading the switch configuration file from the browser cache; and if the code is the second code, determining that the source of the switch configuration file is the static resource service, and reading the switch configuration file from the switch configuration file.
Reading a blue-green flow proportional switch file address from the switch configuration file, and reading the blue-green flow proportional switch file according to the address; and reading and copying an interface request method of the target item from the switch configuration file, and packaging the interface request method by adopting a homonymy function.
Determining whether a first identifier in a blue-green flow proportional switch file is 100% blue or not, if so, reading from a browser cache and determining whether a blue-green label in a second identifier is green or not; if yes, reading the interface with overtime login from the switch configuration file, returning analog data, determining the login interface according to the data, and returning to the value terminal, so that the user can obtain the blue resource according to the login interface.
And if the first identifier in the blue-green flow proportional switch file is not 100% blue or the blue-green label in the second identifier is read from the browser cache and determined not to be green, executing an interface request method of the target item wrapped in the homonymy function.
Fig. 3 is a schematic structural diagram of a resource request processing apparatus according to an embodiment of the present application, and as can be seen from fig. 3, the resource request processing apparatus 300 includes:
a directing unit 310 for directing the received resource request to a static resource service;
a receiving unit 320, configured to receive a feedback result of the static resource service, and determine a switch configuration file source according to the feedback result, where the switch configuration file source is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of a switch configuration file corresponding to the resource request;
an obtaining unit 330, configured to obtain a switch configuration file from the determined switch configuration file source;
the processing unit 340 is configured to process the resource request according to the configuration information of the switch configuration file.
In some embodiments of the present application, in the above apparatus, the receiving unit 320 is configured to determine that the switch configuration file is sourced from the browser cache if the feedback result is the first code; and if the feedback result is the second code, determining that the source of the switch configuration file is the static resource service.
In some embodiments of the present application, in the above apparatus, the feedback result is that the static resource service is determined according to the following method: if the switch configuration file in the static resource service is determined to be consistent with a historical switch configuration file, determining that the feedback result is a first code; and if the switch configuration file in the static resource service is determined to be inconsistent with the historical switch configuration file, determining that the feedback result is a second code.
In some embodiments of the present application, in the above apparatus, the processing unit 340 is configured to read information of the switch profile, where the information of the switch profile includes: blue-green flow proportional switch file address, target project interface request method; adopting a homonymy function to package an interface request method of the target project; based on the homonymous function, acquiring a blue-green flow proportional switch file according to the blue-green flow proportional switch file address; and determining whether the first identifier of the blue-green flow proportional switch file is 100% blue, and if not, executing an interface request method of the target project.
In some embodiments of the present application, in the above apparatus, the processing unit 340 is further configured to read a second identifier in the browser cache if the first identifier of the blue-green traffic proportional switch file is 100% blue; and if the blue-green label in the second identifier is blue, executing the inner layer function wrapped by the homonymy function.
In some embodiments of the present application, in the above apparatus, the processing unit 340 is further configured to, if the cyan tag in the second identifier is green, read the interface that is logged in the configuration information of the switch configuration file overtime and return analog data; and determining an application entry address according to the simulated data returned by the interface with the overtime login, and feeding back the application entry address to the request terminal.
In some embodiments of the present application, in the above apparatus, the processing unit 340 is further configured to read an application entry address in the configuration information of the switch configuration file if the cyan tag in the second identifier is green; and feeding back the application entry address to the request terminal. It can be understood that the resource request processing apparatus can implement the steps of the resource request processing method provided in the foregoing embodiment, and the related explanations about the resource request processing method are applicable to the resource request processing apparatus, and are not described herein again.
Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the resource request processing device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
directing the received resource request to a static resource service;
receiving a feedback result of the static resource service, and determining a switch configuration file source according to the feedback result, wherein the switch configuration file source is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of a switch configuration file corresponding to the resource request;
acquiring a switch configuration file from the determined source of the switch configuration file;
and processing the resource request according to the configuration information of the switch configuration file.
The method executed by the resource request processing apparatus according to the embodiment shown in fig. 3 of the present application may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method executed by the resource request processing apparatus in fig. 3, and implement the function of the resource request processing apparatus in the embodiment shown in fig. 3, which is not described herein again in this embodiment of the present application.
An embodiment of the present application further provides a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to perform the method performed by the resource request processing apparatus in the embodiment shown in fig. 3, and are specifically configured to perform:
directing the received resource request to a static resource service;
receiving a feedback result of the static resource service, and determining a source of a switch configuration file according to the feedback result, wherein the source of the switch configuration file is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of the switch configuration file corresponding to the resource request;
acquiring a switch configuration file from the determined source of the switch configuration file;
and processing the resource request according to the configuration information of the switch configuration file.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A resource request processing method is characterized by comprising the following steps:
directing the received resource request to a static resource service;
receiving a feedback result of the static resource service, and determining a source of a switch configuration file according to the feedback result, wherein the source of the switch configuration file is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of the switch configuration file corresponding to the resource request;
acquiring a switch configuration file from the determined source of the switch configuration file;
and processing the resource request according to the configuration information of the switch configuration file.
2. The method of claim 1, wherein determining a switch profile source based on the feedback comprises:
if the feedback result is the first code, determining that the source of the switch configuration file is the browser cache;
and if the feedback result is the second code, determining that the source of the switch configuration file is the static resource service.
3. The method of claim 2, wherein the feedback result is determined by the static resource service according to the following method:
if the switch configuration file in the static resource service is determined to be consistent with a historical switch configuration file, determining that the feedback result is a first code;
and if the switch configuration file in the static resource service is determined to be inconsistent with the historical switch configuration file, determining that the feedback result is a second code.
4. The method of claim 1, wherein processing the resource request according to the configuration information of the switch profile comprises:
reading information of the switch configuration file, wherein the information of the switch configuration file comprises: blue-green flow proportional switch file address, target project interface request method;
adopting a homonymy function to package an interface request method of the target project;
based on the homonymous function, acquiring a blue-green flow proportional switch file according to the blue-green flow proportional switch file address;
and determining whether the first identifier of the blue-green flow proportional switch file is 100% blue, and if not, executing an interface request method of the target project.
5. The method of claim 4, wherein processing the resource request according to the configuration information of the switch profile further comprises:
if the first identification of the blue-green flow proportional switch file is 100% blue, reading a second identification in the browser cache;
and if the blue-green label in the second identifier is blue, executing the inner layer function wrapped by the homonymy function.
6. The method of claim 5, wherein processing the resource request according to the configuration information of the switch profile further comprises:
if the blue-green label in the second identification is green, reading an interface with overtime login in the configuration information of the switch configuration file and returning analog data;
and determining an application entry address according to the simulated data returned by the interface with the overtime login, and feeding back the application entry address to the request terminal.
7. The method of claim 5, wherein processing the resource request according to the configuration information of the switch profile further comprises:
if the blue-green label in the second identifier is green, reading an application entry address in the configuration information of the switch configuration file;
and feeding back the application entry address to the request terminal.
8. A resource request processing apparatus, the apparatus comprising:
a directing unit for directing the received resource request to a static resource service;
a receiving unit, configured to receive a feedback result of the static resource service, and determine a switch configuration file source according to the feedback result, where the switch configuration file source is a browser cache or the static resource service, and the feedback result is determined by the static resource service according to an update condition of a switch configuration file corresponding to the resource request;
the acquisition unit is used for acquiring the switch configuration file from the determined switch configuration file source;
and the processing unit is used for processing the resource request according to the configuration information of the switch configuration file.
9. An electronic device, comprising:
a processor; and
a memory storing computer-executable instructions that, when executed, cause the processor to perform the method of any of claims 1-7.
10. A computer readable storage medium storing one or more computer programs which, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of any of claims 1-7.
CN202210233063.6A 2022-03-09 2022-03-09 Resource request processing method and device, electronic equipment and readable storage medium Pending CN114579205A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210233063.6A CN114579205A (en) 2022-03-09 2022-03-09 Resource request processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210233063.6A CN114579205A (en) 2022-03-09 2022-03-09 Resource request processing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114579205A true CN114579205A (en) 2022-06-03

Family

ID=81779342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210233063.6A Pending CN114579205A (en) 2022-03-09 2022-03-09 Resource request processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114579205A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103257973A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and system for updating browser cache
CN103677845A (en) * 2013-12-24 2014-03-26 广联达软件股份有限公司 Website application deployment method
CN106775859A (en) * 2016-12-08 2017-05-31 上海亿账通互联网科技有限公司 Gray scale dissemination method and system
CN108882277A (en) * 2018-05-28 2018-11-23 新华三技术有限公司 A kind of method and device of edition upgrading
CN109669719A (en) * 2018-09-26 2019-04-23 深圳壹账通智能科技有限公司 Using gray scale dissemination method, device, equipment and readable storage medium storing program for executing
CN111290867A (en) * 2020-02-27 2020-06-16 北京三快在线科技有限公司 Traffic scheduling method, service server, storage medium and traffic scheduling system
CN112333096A (en) * 2020-10-16 2021-02-05 济南浪潮数据技术有限公司 Micro-service traffic scheduling method and related components
CN112363751A (en) * 2020-11-10 2021-02-12 平安普惠企业管理有限公司 Software product gray level release method, device, equipment and medium
US11102056B1 (en) * 2020-06-29 2021-08-24 Unify Patente Gmbh & Co. Kg Method for requesting connection in a blue-green deployment, method for performing a switchover in a blue-green deployment, and client-server system configured for blue-green deployment
CN113676548A (en) * 2021-09-02 2021-11-19 上海浦东发展银行股份有限公司 Micro-service flow switching method, device and medium based on configuration distribution deployment
CN113986334A (en) * 2021-11-01 2022-01-28 上海中通吉网络技术有限公司 Blue-green automatic publishing method based on automatic publishing platform

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103257973A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and system for updating browser cache
CN103677845A (en) * 2013-12-24 2014-03-26 广联达软件股份有限公司 Website application deployment method
CN106775859A (en) * 2016-12-08 2017-05-31 上海亿账通互联网科技有限公司 Gray scale dissemination method and system
CN108882277A (en) * 2018-05-28 2018-11-23 新华三技术有限公司 A kind of method and device of edition upgrading
CN109669719A (en) * 2018-09-26 2019-04-23 深圳壹账通智能科技有限公司 Using gray scale dissemination method, device, equipment and readable storage medium storing program for executing
CN111290867A (en) * 2020-02-27 2020-06-16 北京三快在线科技有限公司 Traffic scheduling method, service server, storage medium and traffic scheduling system
US11102056B1 (en) * 2020-06-29 2021-08-24 Unify Patente Gmbh & Co. Kg Method for requesting connection in a blue-green deployment, method for performing a switchover in a blue-green deployment, and client-server system configured for blue-green deployment
CN112333096A (en) * 2020-10-16 2021-02-05 济南浪潮数据技术有限公司 Micro-service traffic scheduling method and related components
CN112363751A (en) * 2020-11-10 2021-02-12 平安普惠企业管理有限公司 Software product gray level release method, device, equipment and medium
CN113676548A (en) * 2021-09-02 2021-11-19 上海浦东发展银行股份有限公司 Micro-service flow switching method, device and medium based on configuration distribution deployment
CN113986334A (en) * 2021-11-01 2022-01-28 上海中通吉网络技术有限公司 Blue-green automatic publishing method based on automatic publishing platform

Similar Documents

Publication Publication Date Title
CN110704037B (en) Rule engine implementation method and device
JP2019520624A (en) Page component dynamic layout
CN111131352B (en) Theme switching method and device
CN107092475B (en) Calling method and device of interactive control
EP3457666A1 (en) Method and system for starting application
CN111914194B (en) Business system changing method and device, electronic equipment and storage medium
CN111639278A (en) Webpage loading method and device
CN112612982A (en) Webpage preloading method and device and computer equipment
CN112559934A (en) Page popup display method and device
CN110908657A (en) Product generation method and device
CN111723314A (en) Webpage display method and device, electronic equipment and computer readable storage medium
CN113553214A (en) Idempotent checking method and device
CN113253999A (en) Plug-in data access method, data source management system and interface access method
CN114579205A (en) Resource request processing method and device, electronic equipment and readable storage medium
CN110022351B (en) Service request processing method and device
CN116541116A (en) Application interface rendering method, device, medium and equipment of cloud native system
CN111338655A (en) Installation package distribution method and system
CN111695060A (en) Page switching method, device, equipment and storage medium
US9088463B1 (en) Container contract for data dependencies
CN114547422A (en) Method and device for preventing repeated clicking of page elements
CN112423117B (en) Web end video playing method and device and computer equipment
CN113791766A (en) Method for combining data interfaces, electronic device and readable storage medium
CN111796864A (en) Data verification method and device
CN110209973A (en) A kind of web game loading method and device
CN113448588B (en) Data security processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240507