CN113867992A - Call chain resource isolation method and device, storage medium and electronic equipment - Google Patents

Call chain resource isolation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113867992A
CN113867992A CN202111467369.XA CN202111467369A CN113867992A CN 113867992 A CN113867992 A CN 113867992A CN 202111467369 A CN202111467369 A CN 202111467369A CN 113867992 A CN113867992 A CN 113867992A
Authority
CN
China
Prior art keywords
instance
resource
instance resource
tag value
call chain
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.)
Granted
Application number
CN202111467369.XA
Other languages
Chinese (zh)
Other versions
CN113867992B (en
Inventor
陈俊维
吕仁琦
周涛明
赖浩杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lianlian Hangzhou Information Technology Co ltd
Original Assignee
Lianlian Hangzhou Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lianlian Hangzhou Information Technology Co ltd filed Critical Lianlian Hangzhou Information Technology Co ltd
Priority to CN202111467369.XA priority Critical patent/CN113867992B/en
Publication of CN113867992A publication Critical patent/CN113867992A/en
Application granted granted Critical
Publication of CN113867992B publication Critical patent/CN113867992B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The disclosure relates to a call chain resource isolation method, a call chain resource isolation device, a storage medium and an electronic device. The method for isolating the call chain resources comprises the steps of determining at least two first instance resources related to a call chain, wherein each first instance resource is located at a different call chain node; acquiring a first label corresponding to the call chain, wherein the first label points to a partition corresponding to the call chain associated resource; for each first instance resource in the at least two first instance resources, injecting a label value corresponding to the first label into the first instance resource to obtain a second instance resource corresponding to the first instance resource; and calling at least two second instance resources to realize the calling of the calling chain. The method and the device can automatically finish rule customization of the isolated resources and automatic isolation of the call chain in the application starting stage without applying and deploying multiple sets of environments to realize the requirement of resource isolation and applying and maintaining centralized isolation rule configuration.

Description

Call chain resource isolation method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of resource isolation technologies, and in particular, to a method and an apparatus for isolating call chain resources, a storage medium, and an electronic device.
Background
Under the trend of micro-service development, a system architecture presents multiple modularization and complication, an application calling link becomes more tedious, and the change of the architecture causes the problem that the functional testing and publishing effect cannot be tracked in the process of multifunctional parallel testing and publishing of the application, so that the requirement of realizing resource isolation on limited application instance resources is generated.
In a traditional resource isolation method, server resource consumption is often caused by deployment of multiple sets of environments on a server, or an application is required to be subjected to invasive customized transformation, so that application access cost is increased.
Disclosure of Invention
In order to solve at least one technical problem proposed above, the present disclosure proposes a call chain resource isolation method, apparatus, storage medium, and electronic device.
According to an aspect of the present disclosure, there is provided a call chain resource isolation method, including:
determining at least two first instance resources associated with a call chain, each of the first instance resources being located at a different call chain node;
acquiring a first label corresponding to the call chain, wherein the first label points to a partition corresponding to the call chain associated resource;
for each first instance resource in the at least two first instance resources, injecting a label value corresponding to the first label into the first instance resource to obtain a second instance resource corresponding to the first instance resource;
and calling at least two second instance resources to realize the calling of the calling chain.
In some possible embodiments, the invoking at least two of the second instance resources to implement the invoking of the call chain includes:
responding to the condition of calling a first target second instance resource, acquiring a tag value in the first target second instance resource, and taking the tag value as a transfer tag value; acquiring a first node where the first target second instance resource is located, wherein the first target second instance resource is a second instance resource located in any calling chain node;
acquiring a second node, wherein the second node is determined based on the call chain, is positioned at the downstream of the first node and is adjacent to the first node;
searching a second instance resource with the transfer tag value in the instance resources associated with the second node;
and in response to the condition that the query result is not empty, calling the second instance resource with the transfer tag value.
In some possible embodiments, the method further comprises:
responding to the condition that the query result is empty;
determining a third instance resource into which a tag value is not injected among the instance resources associated with the second node;
invoking the third instance resource.
In some possible embodiments, after determining a third instance resource into which no tag value is injected, among the instance resources associated with the second node, the method further includes: injecting the transfer tag value into the third instance resource.
In some possible embodiments, the injecting the transfer tag value into the third instance resource includes:
in response to the third instance resource being an application instance and the third instance resource communicating based on a remote process call framework, storing the pass tag value in context information of the remote process call framework;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
In some possible embodiments, the injecting the transfer tag value into the third instance resource includes:
in response to the third instance resource being an application instance and the third instance resource communicating based on a hypertext transfer protocol, storing the transfer tag value in a header of the hypertext transfer protocol;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
In some possible embodiments, said passing said pass tag value to said third instance resource comprises:
in response to the third instance resource being message queue middleware, storing the transfer tag value in a key-value pair of a message attribute;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
In some possible embodiments, the injecting the tag value corresponding to the first tag into the first instance resource includes:
in response to the instance resource being an application instance and the first instance resource being generated, obtaining the tag value from an environment variable, the environment variable being a variable accessed by a byte enhanced proxy plug-in for storing the tag value, and injecting the tag value into the first instance resource.
According to a second aspect of the present disclosure, there is provided a call chain resource isolation apparatus, the apparatus comprising:
a first instance resource determining module, configured to determine at least two first instance resources associated with a call chain, where each first instance resource is located at a different call chain node;
a first tag obtaining module, configured to obtain a first tag corresponding to the call chain, where the first tag points to a partition corresponding to the call chain associated resource;
a tag value injection module, configured to inject, for each first instance resource of the at least two first instance resources, a tag value corresponding to the first tag into the first instance resource, so as to obtain a second instance resource corresponding to the first instance resource;
and the call chain realization module is used for calling at least two second instance resources so as to realize the calling of the call chain.
In some possible embodiments, the call chain module includes:
a tag value obtaining unit, configured to obtain, in response to a call to a starting second instance resource, a tag value of the starting second instance resource as a transfer tag value, where the starting second instance resource is one of call chain nodes in the call chain;
a second instance resource determining unit, configured to determine, according to the transfer tag value, whether there are other second instance resources in a downstream instance resource;
and the downstream instance resource calling unit is used for calling the second instance resource if the second instance resource exists so as to realize the calling of the calling chain.
According to a third aspect of the present disclosure, there is provided an electronic device comprising at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the call chain resource isolation method according to any one of the first aspect by executing the instructions stored by the memory.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having at least one instruction or at least one program stored therein, the at least one instruction or at least one program being loaded and executed by a processor to implement the call chain resource isolation method according to any one of the first aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The implementation of the present disclosure has the following beneficial effects:
according to the method, the requirement of resource isolation is realized without application deployment of multiple sets of environments and centralized isolation rule configuration is maintained by application, the rule customization of the isolated resources and the automatic isolation of a calling chain can be automatically completed in an application starting stage, the isolation of instance resources in the calling chain is realized in a non-invasive mode, and the accessed application does not need secondary customization and transformation; the isolation of limited application example resources in a micro-service scene is realized, and the isolation requirements of the application example resources in application scenes such as multifunctional parallel test, link voltage test, gray scale release, blue-green release and the like in the software development process are met.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without inventive efforts.
FIG. 1 shows a flow diagram of a call chain resource isolation method according to an embodiment of the present disclosure;
FIG. 2 illustrates a structural schematic diagram of an application isolation partition, according to an embodiment of the present disclosure;
FIG. 3 shows a schematic structural diagram of a message queue sequestered partition, according to an embodiment of the disclosure;
FIG. 4 is a schematic diagram illustrating a structure of a call chain resource isolation apparatus according to an embodiment of the present disclosure;
FIG. 5 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 6 shows a block diagram of another electronic device in accordance with an embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments in the present description, belong to the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
The method involves partitioning instance resources on a server in a call chain of request processing in an isolated manner, wherein the server instance resources in the call chain comprise an application program (APP) instance running on the server and a message middleware instance running on the server in the call chain.
Fig. 1 is a schematic flowchart illustrating a call chain resource isolation method according to an embodiment of the present disclosure, where as shown in fig. 1, the method includes:
s101, determining at least two first instance resources associated with a call chain, wherein each first instance resource is located at a different call chain node;
in each stage of project development, the development environments of each stage need to be isolated or marked from each other to meet the requirements of users in different application scenarios. According to the application requirements of users, determining to divide the instance resources on each application program into a plurality of partitions, wherein one partition corresponds to one call chain, and determining at least two first instance resources in the same call chain according to the user requirements, wherein the first instance resources are nodes of the call chain.
S102, acquiring a first label corresponding to the call chain, wherein the first label points to a partition corresponding to the call chain associated resource;
if the example resource on the application program is divided into several partitions, for example, three partitions, three corresponding label values are set, and the same label value is injected into the example resource in the same partition. And acquiring a first label, wherein the first label points to a partition corresponding to the call chain associated resource, and the call chain comprises a first instance resource. The first tag may be obtained from an Environment variable of the server, for example, the server a sets a key-value pair of the Environment variable Environment as a first tag "IsoLabel = Zone 1", and the other server B sets a key-value pair of the Environment variable Environment as another tag "IsoLabel = Zone 2";
s103, aiming at each first instance resource in the at least two first instance resources, injecting a label value corresponding to the first label into the first instance resource to obtain a second instance resource corresponding to the first instance resource;
the method comprises the steps of using Skywalking-Agent and Skywalking-Agent Dubbo framework plug-ins of a service programming language JAVA as agents, obtaining a label value 'Zone 1' corresponding to a first label from a server A through a byte code enhancement technology when instance resources run on the server A, injecting a label value 'Zone 1' corresponding to the first label into a first instance resource running on the server A, and injecting the first instance resource of the label value corresponding to the first label as a second instance resource. The isolation of instance resources in a calling link is realized by adopting a non-invasive mode, and the accessed application resources do not need to be customized and modified for the second time;
and S104, calling at least two second instance resources to realize the calling of the calling chain.
When the second instance resource calls the downstream instance resource, calling the instance resource with the same label value as the second instance resource in the downstream instance resource, if the downstream instance resource does not have the same label value as the second instance resource, calling any instance resource without the label value, and transferring the label value of the second instance resource to the instance resource, so that the instance resource without the label value is searched for the instance resource with the same label value as the second instance resource in the downstream instance resource of the second instance resource according to the transferred label value. Under the condition of limited server instance resources, different instance resource partitions are isolated, and further the requirements of joint debugging test, gray scale function release, link pressure test and the like of different application functions can be met in different resource partitions.
In one embodiment, a first instance resource is determined, a Skywalk-Agent and a Skywalk-Agent Dubbo framework plug-in of a programming language JAVA are configured on a server, when an application is started, the Skywalk-Agent and the Skywalk-Agent Dubbo framework plug-in are used as agents, when the first instance resource runs on the server, when the application is started, a byte code enhancement technology is utilized, and when the first instance resource is generated and is registered in a system, a tag value, such as a tag value Zone1, is obtained from an environment variable and is injected into the first instance resource, so that the application does not need to be customized and modified, and recompilation and packaging are not needed. If the application program APP is realized by the programming language JAVA, parameter configuration of attribute property is carried out in a starting command of the JAVA application program APP in a mode of adding an attribute-D of the programming language JAVA, a tag value is obtained from the-D attribute when the application program is started, and a tag value is injected in a non-perception mode in the running process of the application program in a byte code enhancement mode. Under the condition of limited server instance resources, different instance resource partitions are isolated, and further the requirements of joint debugging test, gray scale function release, link pressure test and the like of different application functions can be met in different resource partitions.
In one embodiment, said invoking at least two of said second instance resources to implement the invocation of said call chain comprises:
responding to the condition of calling a first target second instance resource, acquiring a tag value in the first target second instance resource, and taking the tag value as a transfer tag value; acquiring a first node where the first target second instance resource is located, wherein the first target second instance resource is a second instance resource located in any calling chain node;
acquiring a second node, wherein the second node is determined based on the call chain, is positioned at the downstream of the first node and is adjacent to the first node;
searching a second instance resource with the transfer tag value in the instance resources associated with the second node;
and in response to the condition that the query result is not empty, calling the second instance resource with the transfer tag value.
In one embodiment, when a first target second instance resource is called, a tag value of the first target second instance resource is obtained, the tag value is used as a transfer tag value, when a second node in an instance resource in the downstream of the first target second instance resource is called, whether a second instance resource with the same tag value as the transfer tag value exists in the instance resource in the downstream is searched, and if the second instance resource with the same transfer tag value is searched, the second instance resource with the transfer tag value is called.
In one embodiment, aiming at an application program APP instance with an instance resource, an open-source distributed service framework Dubbo is adopted to realize a remote process call framework RPC, and the remote process call framework RPC is realized by expanding a route extension point of the Dubbo framework, when an upstream application instance calls a downstream application instance, instances are screened, the instances with the same label are called preferentially, and under the condition that the upstream application instance does not have the same label instance, any other application instance without the label in the downstream is called as a downstream application instance, the downstream application instance continues to transmit the label value to the downstream, and the downstream application instance calls the downstream application instance with the same label value.
In one embodiment, as shown in fig. 2, if the instance resource is an application APP instance, the application APP instance includes a first application, a second application, a third application, and a fourth application, and the first application, the second application, and the third application all include a first instance, a second instance, and a third instance, where the first instance of the first application is injected with a first tag value, the second instance of the first application is not injected with any tag value, and the third instance of the first application is injected with a second tag value; the first instance of the second application is not injected with any tag value, the second instance of the second application is injected with a first tag value, the third instance of the second application is not injected with any tag value, the first instance of the third application is not injected with any tag value, the second instance of the third application is injected with a first tag value, the third instance of the third application is injected with a second tag value, the first instance of the fourth application is injected with a first tag value, the second instance of the fourth application is not injected with any tag value, the third instance of the fourth application is injected with a second tag value; when a first instance in a first application program is called, a first label value is obtained from the first instance, when an instance of a second application program is called, an instance with the first label value is searched, if the second instance in the second application program has the first label value, a second instance in the second application program is called, when an instance of a third application program is called, the instance with the first label value is continuously searched, if the second instance has the first label value, the second instance of the third application program is called, and similarly, the first instance in a fourth application program is called, and an isolated calling chain is formed.
In one embodiment, the method further comprises:
responding to the condition that the query result is empty;
determining a third instance resource into which a tag value is not injected among the instance resources associated with the second node;
when the first target second instance resource is called, the label value of the first target second instance resource is obtained, the label value is used as a transfer label value, if the instance resource with the transfer label value is not found in the instance resource associated with the second node, a third instance resource which is not injected with any label value in the instance resource associated with the second node is searched, and the third instance resource is called. If there are multiple third instance resources, then any of the third instance resources is invoked.
In one embodiment, after determining a third instance resource into which no tag value is injected among the instance resources associated with the second node, the method further comprises: injecting the transfer tag value into the third instance resource.
And calling a third instance resource which is not injected with any label value, wherein in order to ensure that the third instance resource continues to call the instance resource of the same partition with the first target instance resource when calling the downstream instance resource, the transfer label value needs to be transferred to the third instance resource, and the third instance resource calls the downstream instance resource according to the transfer label value.
In one embodiment, as shown in fig. 2, if the instance resource is an application instance, the application instance includes a first application, a second application, a third application and a fourth application, and the first application, the second application and the third application all include a first instance, a second instance and a third instance, where the first instance of the first application is injected with a first tag value, the second instance of the first application is not injected with any tag value, and the third instance of the first application is injected with a second tag value; the first instance of the second application is not injected with any tag value, the second instance of the second application is injected with a first tag value, the third instance of the second application is not injected with any tag value, the first instance of the third application is not injected with any tag value, the second instance of the third application is injected with a first tag value, the third instance of the third application is injected with a second tag value, the first instance of the fourth application is injected with a first tag value, the second instance of the fourth application is not injected with any tag value, the third instance of the fourth application is injected with a second tag value; when a third instance in the first application program is called, a second label value is obtained from the third instance, when the instance of the second application program is called, the instance with the second label value is searched, the instance in the second application program which is not searched has the second label value, the third instance in the second application is called without any tag value, of course, the first instance in the second application without any tag value may also be called, since no second tag value is present in the second application, the second tag value is passed to a third instance of the second application where, after running the third instance of the second application, the third instance of the third application program in which the second tag value exists may be continuously called according to the passed second tag value, and similarly, the third instance of the fourth application program in which the second tag value exists may be called. Forming an isolated call chain.
In one embodiment, said injecting said transfer tag value into said third instance resource comprises:
in response to the third instance resource being an application instance and the third instance resource communicating based on a remote process call framework, storing the pass tag value in context information of the remote process call framework;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
In one embodiment, said injecting said transfer tag value into said third instance resource comprises:
in response to the third instance resource being an application instance and the third instance resource communicating based on a hypertext transfer protocol, storing the transfer tag value in a header of the hypertext transfer protocol;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
In one embodiment, said communicating said transfer tag value to said third instance resource comprises:
in response to the third instance resource being message queue middleware, storing the transfer tag value in a key-value pair of a message attribute;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
In an embodiment, when the same label is injected into the instance resource of each link in the upstream and downstream of the call chain, the instance resource on the call chain can be ensured to belong to the same partition, but when the label is not injected into a certain instance resource or is omitted in the call chain, the label transmission is utilized to ensure that the label value of the upstream instance can be transmitted when the label of the intermediate instance resource is omitted, and when the downstream instance is called, the downstream instance resource can be screened according to the transmitted label, the instance in the same partition is screened out, then the call is carried out, and the instance resource in the downstream is ensured to be the same as the upstream.
For the case that a transfer label Value does not exist in a third instance resource to be called, the transfer label Value needs to be transferred to the third instance resource, for the implementation manner of transferring the label Value, if an instance in an application program APP during instance resource calls frame RPC communication through a remote process, context Rpcontext of the RPC in the remote process call frame can be put as a label transfer carrier to perform label transfer, specifically, the Key Value of the Rpcontext Property is put in, and if the application program communicates through a hypertext transfer protocol HTTP, a Header of HTTP can be used as the label transfer carrier to perform label transfer. And aiming at the Message queue middleware instance, putting the Message queue middleware instance into a Key Value of a specific Message attribute Message Property for transmission.
In one embodiment, the injecting the tag value corresponding to the first tag into the first instance resource includes:
in response to the instance resource being an application instance and the first instance resource being generated, obtaining the tag value from an environment variable, the environment variable being a variable accessed by a byte enhanced proxy plug-in for storing the tag value, and injecting the tag value into the first instance resource.
In one embodiment, defined tags are injected into instance resources running on a server, the instance resources including an application APP instance and a message middleware instance. As for the tag value injection manner, for the application program APP instance, the tag is injected in an imperceptible manner in the running process of the application program APP in a bytecode-enhanced manner, and for the message queue middleware instance, as shown in fig. 3, the tag is associated to different message queue instance resources in a manner of computing by a hash construction method hashselector (tag), where the instance resources of different message queues often represent different message queue instance fragments in a message queue design model. By using the byte code enhancement mode, the customized transformation of the application is not needed. The bytecode is mainly characterized in that Agent agents for Java program operation are uniformly configured when an application instance is started, and the Agent agents can perform secondary modification on the input parameters and the return result of the method on a specified program implementation method when the application is operated, so that the functions of non-perception label injection, label transmission and instance calling according to label screening are realized. However, in general customized implementation mode modification, research and development personnel are often required to make different code or configuration file modification schemes for each different application program, and recompile, package and issue the application after the code or configuration file modification is completed, which brings great cost to the application implementation of the call chain resource isolation partition.
Referring to fig. 4, according to a second aspect of the present disclosure, there is provided a call chain resource isolation apparatus, including:
a first instance resource determining module 10, configured to determine at least two first instance resources associated with a call chain, where each first instance resource is located at a different call chain node;
a first tag obtaining module 20, configured to obtain a first tag corresponding to the call chain, where the first tag points to a partition corresponding to the call chain associated resource;
a tag value injection module 30, configured to inject, for each first instance resource of the at least two first instance resources, a tag value corresponding to the first tag into the first instance resource, so as to obtain a second instance resource corresponding to the first instance resource;
a call chain implementation module 40, configured to invoke at least two of the second instance resources to implement the call of the call chain.
In one embodiment, in each stage of project development, the development environments of each stage need to be isolated or marked from each other to meet the requirements of users in different application scenarios. According to the application requirements of users, determining to divide the instance resources on each application program into a plurality of partitions, determining which partition each instance resource on each application program belongs to, and setting corresponding number of label values, if three partitions need to be isolated in the instance resources, determining three label values.
In one embodiment, the call chain module comprises:
a tag value obtaining unit, configured to obtain, in response to a call to a starting second instance resource, a tag value of the starting second instance resource as a transfer tag value, where the starting second instance resource is one of call chain nodes in the call chain;
a second instance resource determining unit, configured to determine, according to the transfer tag value, whether there are other second instance resources in a downstream instance resource;
and the downstream instance resource calling unit is used for calling the second instance resource if the second instance resource exists so as to realize the calling of the calling chain.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
The embodiment of the present disclosure also provides a computer-readable storage medium, where at least one instruction or at least one program is stored in the computer-readable storage medium, and the at least one instruction or the at least one program is loaded by a processor and executed to implement the method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 5 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 5, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user as described above. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of the touch or slide action but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the above-mentioned communication component 816 further comprises a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 6 shows a block diagram of another electronic device in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 6, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions 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). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, 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/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (12)

1. A call chain resource isolation method, the method comprising:
determining at least two first instance resources associated with a call chain, each of the first instance resources being located at a different call chain node;
acquiring a first label corresponding to the call chain, wherein the first label points to a partition corresponding to the call chain associated resource;
for each first instance resource in the at least two first instance resources, injecting a label value corresponding to the first label into the first instance resource to obtain a second instance resource corresponding to the first instance resource;
and calling at least two second instance resources to realize the calling of the calling chain.
2. The method of claim 1, wherein said invoking at least two of said second instance resources to effect invocation of said call chain comprises:
responding to the condition of calling a first target second instance resource, acquiring a tag value in the first target second instance resource, and taking the tag value as a transfer tag value; acquiring a first node where the first target second instance resource is located, wherein the first target second instance resource is a second instance resource located in any calling chain node;
acquiring a second node, wherein the second node is determined based on the call chain, is positioned at the downstream of the first node and is adjacent to the first node;
searching a second instance resource with the transfer tag value in the instance resources associated with the second node;
and in response to the condition that the query result is not empty, calling the second instance resource with the transfer tag value.
3. The method of claim 2, further comprising:
responding to the condition that the query result is empty;
determining a third instance resource into which a tag value is not injected among the instance resources associated with the second node;
invoking the third instance resource.
4. The method of claim 3, wherein after determining a third instance resource that has not been injected with a tag value in the instance resources associated with the second node, the method further comprises: injecting the transfer tag value into the third instance resource.
5. The method of claim 4, wherein injecting the transfer tag value into the third instance resource comprises:
in response to the third instance resource being an application instance and the third instance resource communicating based on a remote process call framework, storing the pass tag value in context information of the remote process call framework;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
6. The method of claim 4, wherein injecting the transfer tag value into the third instance resource comprises:
in response to the third instance resource being an application instance and the third instance resource communicating based on a hypertext transfer protocol, storing the transfer tag value in a header of the hypertext transfer protocol;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
7. The method of claim 4, wherein said communicating the transfer tag value to the third instance resource comprises:
in response to the third instance resource being message queue middleware, storing the transfer tag value in a key-value pair of a message attribute;
passing the pass-tag value to the third instance resource in response to the third instance resource being called.
8. The method of claim 1, wherein injecting the tag value corresponding to the first tag into the first instance resource comprises:
in response to the instance resource being an application instance and the first instance resource being generated, obtaining the tag value from an environment variable, the environment variable being a variable accessed by a byte enhanced proxy plug-in for storing the tag value, and injecting the tag value into the first instance resource.
9. A call chain resource isolation apparatus, the apparatus comprising:
a first instance resource determining module, configured to determine at least two first instance resources associated with a call chain, where each first instance resource is located at a different call chain node;
a first tag obtaining module, configured to obtain a first tag corresponding to the call chain, where the first tag points to a partition corresponding to the call chain associated resource;
a tag value injection module, configured to inject, for each first instance resource of the at least two first instance resources, a tag value corresponding to the first tag into the first instance resource, so as to obtain a second instance resource corresponding to the first instance resource;
and the call chain realization module is used for calling at least two second instance resources so as to realize the calling of the call chain.
10. The apparatus of claim 9, wherein the call chain module comprises:
a tag value obtaining unit, configured to obtain, in response to a call to a starting second instance resource, a tag value of the starting second instance resource as a transfer tag value, where the starting second instance resource is one of call chain nodes in the call chain;
a second instance resource determining unit, configured to determine, according to the transfer tag value, whether there are other second instance resources in a downstream instance resource;
and the downstream instance resource calling unit is used for calling the second instance resource if the second instance resource exists so as to realize the calling of the calling chain.
11. A computer-readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by a processor to implement the call chain resource isolation method according to any one of claims 1 to 8.
12. An electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the at least one processor implementing the call chain resource isolation method of any one of claims 1-8 by executing the instructions stored by the memory.
CN202111467369.XA 2021-12-03 2021-12-03 Call chain resource isolation method and device, storage medium and electronic equipment Active CN113867992B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111467369.XA CN113867992B (en) 2021-12-03 2021-12-03 Call chain resource isolation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111467369.XA CN113867992B (en) 2021-12-03 2021-12-03 Call chain resource isolation method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113867992A true CN113867992A (en) 2021-12-31
CN113867992B CN113867992B (en) 2022-03-25

Family

ID=78985751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111467369.XA Active CN113867992B (en) 2021-12-03 2021-12-03 Call chain resource isolation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113867992B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075381A1 (en) * 2004-09-30 2006-04-06 Citrix Systems, Inc. Method and apparatus for isolating execution of software applications
CN112118565A (en) * 2020-08-14 2020-12-22 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method and device, computer equipment and storage medium
CN112631804A (en) * 2020-12-25 2021-04-09 杭州涂鸦信息技术有限公司 Service call request processing method based on isolation environment and computer equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075381A1 (en) * 2004-09-30 2006-04-06 Citrix Systems, Inc. Method and apparatus for isolating execution of software applications
CN112118565A (en) * 2020-08-14 2020-12-22 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method and device, computer equipment and storage medium
CN112631804A (en) * 2020-12-25 2021-04-09 杭州涂鸦信息技术有限公司 Service call request processing method based on isolation environment and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
小江: "微服务中台技术解析之项目环境隔离", 《HTTPS://XIE.INFOQ.CN/ARTICLE/FE11521FB2FEE493E69E73C42》 *

Also Published As

Publication number Publication date
CN113867992B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN111026396B (en) Page rendering method and device, electronic equipment and storage medium
CN110471738B (en) Theme switching method and device of application program, electronic equipment and storage medium
CN110188871B (en) Operation method, device and related product
CN110851108A (en) Electronic equipment operation method and device, electronic equipment and storage medium
CN111078325B (en) Application program running method and device, electronic equipment and storage medium
CN107463372B (en) Data-driven page updating method and device
CN114741292A (en) Test script management method and device, electronic equipment and storage medium
US11210449B2 (en) Page display method and device and storage medium
CN109471714B (en) Platform deployment method, device, equipment and storage medium
CN111221613B (en) Program calling method and device and storage medium
CN111596980B (en) Information processing method and device
CN115373763B (en) Plug-in loading method and device, electronic equipment and storage medium
CN110809036B (en) Resource updating method and device
CN112328330A (en) iOS component calling method, device, middleware, electronic equipment and medium
CN113867992B (en) Call chain resource isolation method and device, storage medium and electronic equipment
CN111104110B (en) Global style sharing method, global style sharing device and electronic device
CN111104183B (en) Application program running method and device, electronic equipment and storage medium
CN109933357B (en) Application program upgrading method and device
CN110311968B (en) Method and device for loading file in streaming mode and intelligent equipment
CN112083981A (en) Method and device for creating page view component
CN111596949B (en) Method and device for developing application program
CN114416084B (en) Data processing method and device, electronic equipment and storage medium
CN113095485B (en) Performance index determination method, device, system, electronic equipment and storage medium
CN116954713A (en) Component generation method, device, electronic equipment and storage medium
CN114461265A (en) Business 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
GR01 Patent grant
GR01 Patent grant