CN117130979A - Service resource migration method and device and electronic equipment - Google Patents

Service resource migration method and device and electronic equipment Download PDF

Info

Publication number
CN117130979A
CN117130979A CN202310922119.3A CN202310922119A CN117130979A CN 117130979 A CN117130979 A CN 117130979A CN 202310922119 A CN202310922119 A CN 202310922119A CN 117130979 A CN117130979 A CN 117130979A
Authority
CN
China
Prior art keywords
migrated
nodes
node
migration
determining
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
CN202310922119.3A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202310922119.3A priority Critical patent/CN117130979A/en
Publication of CN117130979A publication Critical patent/CN117130979A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a service resource migration method, a service resource migration device and electronic equipment, which are applied to the technical field of computers, and the method comprises the following steps: determining the dependency information of each part to be migrated in the current service resource to be migrated; determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node; determining the migration sequence of each part to be migrated according to the hierarchy of each node; and for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated. By the scheme, the blank of the service resource in the service resource migration process can be reduced.

Description

Service resource migration method and device and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for migrating service resources, and an electronic device.
Background
With the development of corporate services, there is often a need to migrate a service resource stored in an electronic device such as a computer or a server, for example, from an electronic device in one room to an electronic device in another room.
Since the bandwidth for migration is limited, and the electronic device for receiving the migrated service resources is often provided in batches, the service resources to be migrated need to be divided into a plurality of portions, and then each portion is migrated in batches. However, in the migration process, after some resources are migrated to a new machine room, other service resources on which the migrated partial resources depend are not migrated yet, so that the migrated partial resources cannot be normally operated, which results in a blank of the migrated service resources and is not beneficial to the development of company services.
Therefore, how to reduce the idle space of the service resources in the service resource migration process is a problem to be solved.
Disclosure of Invention
The embodiment of the invention aims to provide a service resource migration method, a service resource migration device and electronic equipment, so as to reduce the blank of service resources in the service resource migration process. The specific technical scheme is as follows:
In a first aspect of the present invention, a method for migrating service resources is provided; the method comprises the following steps:
determining the dependency information of each part to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
determining the migration sequence of each part to be migrated according to the hierarchy of each node; the migration sequence is consistent with the sequence from small to large of the levels of the nodes corresponding to the parts to be migrated;
and for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated.
Optionally, determining the migration sequence of each portion to be migrated according to the hierarchy of each node includes:
For any two nodes, if the levels of the two nodes are different, determining that the migration sequence of the part to be migrated, which is represented by the node with the larger level, is positioned behind the part to be migrated, which is represented by the other node;
for any two nodes, if the levels of the two nodes are the same, determining the migration sequence between the portions to be migrated represented by the two nodes according to the number of times of use and/or the dependence attribute of the portions to be migrated represented by the two nodes;
wherein the dependency attribute of one portion to be migrated is used to represent other portions to be migrated that depend on the portion to be migrated.
Optionally, if the levels of the two nodes are the same for any two nodes, determining the migration sequence between the portions to be migrated, which are characterized by the two nodes, according to the number of times of use and/or the dependency attribute of the portions to be migrated, which are characterized by the two nodes, includes:
judging the size of the dependency attribute of the part to be migrated, which is characterized by any two nodes, if the levels of the two nodes are the same;
under the condition that the dependent attributes of the parts to be migrated, which are represented by the two nodes, are different, determining that the migration sequence of the part to be migrated with larger dependent attributes is positioned before the other part to be migrated;
And under the condition that the dependency attributes of the parts to be migrated represented by the two nodes are the same, judging the number of times of use of the parts to be migrated represented by the two nodes, and determining that the migration sequence of the parts to be migrated with larger number of times of use is positioned before the other part to be migrated.
Optionally, the dependency attribute of a portion to be migrated represents: and the sum value of the preset weights of other parts to be migrated of the part to be migrated is dependent.
Optionally, for each portion to be migrated, migrating the portion to be migrated according to the determined migration order of the portion to be migrated, including:
selecting at least one part to be migrated with the forefront migration sequence from the parts to be migrated which are not migrated currently; the sum of the data volume of the at least one selected part to be migrated does not exceed the available storage space of the electronic equipment currently used for receiving the migrated service resources;
and migrating the selected at least one part to be migrated, and returning to execute the step of selecting at least one part to be migrated with the highest migration sequence from the parts to be migrated which are not migrated currently.
Optionally, before the migration of each portion to be migrated according to the determined migration order of the portion to be migrated, the method further includes:
And for each part to be migrated, if the data volume of the part to be migrated is larger than a preset threshold, determining the part to be migrated as the current service resource to be migrated, and returning to the step of executing the dependent information of each part to be migrated in the determined current service resource to be migrated.
In a second aspect of the present invention, a migration apparatus for a service resource is also provided; the device comprises:
the information determining module is used for determining the dependency information of each part to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
the diagram determining module is used for determining a directed acyclic diagram taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
the sequence determining module is used for determining the migration sequence of each part to be migrated according to the hierarchy of each node; the migration sequence is consistent with the sequence from small to large of the levels of the nodes corresponding to the parts to be migrated;
And the migration module is used for migrating each part to be migrated according to the determined migration sequence of the part to be migrated.
Optionally, the sequence determining module is specifically configured to:
for any two nodes, if the levels of the two nodes are different, determining that the migration sequence of the part to be migrated, which is represented by the node with the larger level, is positioned behind the part to be migrated, which is represented by the other node;
for any two nodes, if the levels of the two nodes are the same, determining the migration sequence between the portions to be migrated represented by the two nodes according to the number of times of use and/or the dependence attribute of the portions to be migrated represented by the two nodes;
wherein the dependency attribute of one portion to be migrated is used to represent other portions to be migrated that depend on the portion to be migrated.
Optionally, the order determining module determines, for any two nodes, a migration order between portions to be migrated represented by the two nodes according to the number of times of use and/or the dependency attribute of the portions to be migrated represented by the two nodes if the levels of the two nodes are the same, including:
judging the size of the dependency attribute of the part to be migrated, which is characterized by any two nodes, if the levels of the two nodes are the same; under the condition that the dependent attributes of the parts to be migrated, which are represented by the two nodes, are different, determining that the migration sequence of the part to be migrated with larger dependent attributes is positioned before the other part to be migrated; and under the condition that the dependency attributes of the parts to be migrated represented by the two nodes are the same, judging the number of times of use of the parts to be migrated represented by the two nodes, and determining that the migration sequence of the parts to be migrated with larger number of times of use is positioned before the other part to be migrated.
Optionally, the dependency attribute of a portion to be migrated represents: and the sum value of the preset weights of other parts to be migrated of the part to be migrated is dependent.
Optionally, the migration module includes:
the selecting submodule is used for selecting at least one part to be migrated with the highest migration sequence from the parts to be migrated which are not migrated at present; the sum of the data volume of the at least one selected part to be migrated does not exceed the available storage space of the electronic equipment currently used for receiving the migrated service resources;
and the migration submodule is used for migrating the selected at least one part to be migrated and triggering the selection submodule to execute the step of selecting at least one part to be migrated with the forefront migration sequence from all the parts to be migrated which are not migrated at present.
In a first aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of the business resource migration method when executing the program stored in the memory.
In yet another aspect of the implementation of the present invention, there is also provided a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement a method for migrating a service resource according to any one of the above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of migrating a business resource as described in any one of the above.
The migration method of the service resources provided by the embodiment of the invention determines the dependency information of each part to be migrated in the current service resources to be migrated; the dependency information of each part to be migrated represents the dependency relationship of service data and/or service codes between the part to be migrated and other parts to be migrated; determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node; determining the migration sequence of each part to be migrated according to the hierarchy of each node; the sequence of the to-be-migrated parts represented by the nodes with large levels is positioned behind the to-be-migrated parts represented by the nodes with small levels; and for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated. Therefore, the migration sequence of each part to be migrated is determined according to the level of each node, so that the migration sequence of the part to be migrated, which is characterized by the node with the large level, is positioned behind the part to be migrated, which is characterized by the node with the small level, and each module to be migrated can be migrated behind the part to be migrated, which is characterized by the node with the small level, when migration is performed, so that the part to be migrated, which is dependent on other parts to be migrated, can normally operate after migration, and therefore, the blank of service resources can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flowchart of a method for migrating a service resource according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a directed acyclic graph in an embodiment of the invention;
FIG. 3 is another flowchart of a method for migrating a service resource according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a service resource migration device in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
In order to reduce the empty space of service resources and accurately identify abnormal equipment in the service resource migration process, the embodiment of the invention provides service resource migration, a device and electronic equipment. In a specific application, the migration of the service resource provided by the embodiment of the invention can be applied to various electronic devices, such as personal computers, servers, mobile phones and other devices with data processing capability. Moreover, the migration of the service resources provided by the embodiment of the invention can be realized by software, hardware or a combination of software and hardware.
The following first describes a method for migrating service resources provided by an embodiment of the present invention, where the method may include the following steps:
determining the dependency information of each part to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated represents the dependency relationship of service data and/or service codes between the part to be migrated and other parts to be migrated;
determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
determining the migration sequence of each part to be migrated according to the hierarchy of each node; the sequence of the to-be-migrated parts represented by the nodes with large levels is positioned behind the to-be-migrated parts represented by the nodes with small levels;
and for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated.
In this embodiment, between every two nodes in the established directed acyclic graph, the portion to be migrated represented by the directed node depends on the portion to be migrated represented by another node, and the level of the directed node is greater than that of the other node, so that according to the level of each node, the migration order of each portion to be migrated is determined, so that the migration order of the portion to be migrated represented by the node with a large level is located behind the portion to be migrated represented by the node with a small level, and each module to be migrated can be migrated behind the portion to be migrated on which it depends when performing migration, so that the portion to be migrated depending on the other portion to be migrated can operate normally after migration, and therefore, the empty space of service resources can be reduced.
The following describes an exemplary method for identifying abnormal devices according to an embodiment of the present invention with reference to the accompanying drawings.
As shown in fig. 1, the migration method of service resources provided by the embodiment of the present invention may include the following steps:
s101, determining the dependency information of each part to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
the service resource may be a data resource stored in the electronic device for supporting a service of a company, and the data resource may include: service data, service codes, etc., wherein the service data may be data in a database, and the service codes may be codes of a program. The service resource to be migrated can be any service resource with a migration requirement.
In the migration process, the service resource can be divided into a plurality of parts to be migrated according to functions, so that each part to be migrated can be used for realizing one or more functions. For example, data in one database or data in multiple databases in the service resource may be used as a portion to be migrated, and one or more programs may be used as a portion to be migrated, or, of course, a combination of data and programs in the databases may be used as a portion to be migrated. Further, for the data in the database, the data may be further divided according to a time period of data generation, for example, data generated in 1 month in one database is divided into one portion to be migrated, and data generated in 2 months is divided into another portion to be migrated; code in a program may also be divided into a plurality of code segments for the program, wherein each of the divided code segments may be used to implement one or more functions.
The above-mentioned dependency relationship may be a dependency relationship of service data or a dependency relationship of service codes. For example, if the operation of one to-be-migrated part needs to access the data in another to-be-migrated part, then there is a dependency relationship of service data between the two to-be-migrated parts, and the dependency relationship is characterized in that the to-be-migrated part depends on the to-be-migrated part accessed by the to-be-migrated part; or, if the code in another portion to be migrated needs to be called by the operation of one portion to be migrated, a dependency relationship of the service code exists between the two portions to be migrated, and the dependency relationship is characterized in that the portion to be migrated depends on the portion to be migrated to which the called code belongs.
In one implementation manner, in order to determine the dependency information of the portion to be migrated, the determining may be implemented by querying log information of the current service resource to be migrated, for example, if the log information records that the portion to be migrated accesses another portion to be migrated, then it may be determined that a dependency relationship exists between the two portions to be migrated. Alternatively, the code of the portion to be migrated may be analyzed, for example, if it is detected that there is code calling an API (Application Programming Interface, application program interface) of another portion to be migrated in the code of the portion to be migrated, it may be determined that the portion to be migrated depends on the portion to be migrated pointed to by the API.
S102, determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
after the dependency information of each portion to be migrated, a directed acyclic graph may be generated with each portion to be migrated as a node according to the dependency information of each portion to be migrated, and the directed acyclic graph may be illustrated in fig. 2. In the directed acyclic graph, each two nodes with a pointing relationship exist, and a part to be migrated, which is characterized by the pointed node, depends on a part to be migrated, which is characterized by another node, so that the directed acyclic graph can characterize the dependency relationship among the parts to be migrated.
To determine the hierarchy of the various nodes in the directed acyclic graph, the directed acyclic graph can be topologically ordered. For example, in one implementation, a node that is not pointed to by other nodes in each node may be determined as a node with the smallest hierarchy in the current directed acyclic graph, after that, the node with the smallest hierarchy in the current directed acyclic graph is deleted, and the step of determining, for the current directed acyclic graph, a node that is not pointed to by other nodes in each node as a node with the smallest hierarchy in the current directed acyclic graph is performed back until the remaining nodes in the current directed acyclic graph are not pointed to by any other nodes, where the remaining nodes are the nodes with the highest hierarchy in the directed acyclic graph.
For example, as shown in fig. 2, for the current directed acyclic graph, the nodes that are not pointed to by other nodes in each node, namely, node 1, node 3, node 5, node 7, node 9, node 11 and node 13, may be determined as the node with the smallest hierarchy in the current directed acyclic graph, namely, the hierarchy 1; after deleting the node 1, the node 3, the node 5, the node 7, the node 9, the node 11 and the node 13, the nodes which are not pointed by other nodes in the deleted directed acyclic graph, namely the node 2, the node 4, the node 6, the node 8 and the node 10, can be determined as the node with the minimum hierarchy in the current directed acyclic graph, namely the level 2; after deleting the node 2, the node 4, the node 6, the node 8 and the node 10, determining the node which is not pointed by other nodes in the current directed acyclic graph, namely the node 12, and determining the node with the minimum hierarchy in the current directed acyclic graph, namely the node 3; and so on, node 14 is then determined to be level 4 and node 15 is determined to be level 5.
S103, determining the migration sequence of each part to be migrated according to the hierarchy of each node; the migration sequence is consistent with the sequence from small to large of the levels of the nodes corresponding to the parts to be migrated;
In one implementation, for any two nodes, if the levels of the two nodes are the same, the migration sequence of the portion to be migrated represented by any one of the two nodes may be randomly determined and located before the portion to be migrated represented by the other node. In another implementation manner, for any two nodes, if the levels of the two nodes are the same, a specified index of the portion to be migrated, which is represented by the two nodes, may be considered, so as to determine the migration sequence of the two nodes, where the specified index may be the number of times and/or the dependence attribute of the portion to be migrated, which is represented by the two nodes, and the dependence attribute of one portion to be migrated is used to represent other portions to be migrated that depend on the portion to be migrated. This specific determination will be described below and will not be described in detail here.
S104, for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated.
In this step, when determining the migration sequence of each portion to be migrated, each portion to be migrated may be migrated according to the migration sequence, that is, for each portion to be migrated, the portion to be migrated may be migrated from the currently stored electronic device to another electronic device, and any data migration manner may be adopted during migration, for example, the portion to be migrated may be transferred from the stored electronic device to another electronic device by using a network dedicated line.
Because the electronic devices for receiving the post-migration service resources are often provided in batches in the migration process, the electronic devices can be migrated in batches according to the resources of the electronic devices in the current batch and the migration sequence of each part to be migrated, so that the part to be migrated in the batch does not exceed the receiving capacity of the electronic devices, and in one implementation manner, at least one part to be migrated with the forefront migration sequence can be selected from all the parts to be migrated which are not migrated at present; the sum of the data volume of the at least one selected part to be migrated does not exceed the available storage space of the electronic equipment currently used for receiving the migrated service resources; and further, the selected at least one part to be migrated is migrated, and the step of selecting at least one part to be migrated with the forefront migration sequence from all the parts to be migrated which are not migrated currently is executed back.
The storage space available to the electronic device may be disk storage space. If the available storage space of the current electronic device for receiving the migrated service resource is smaller than the data size of the forefront portion to be migrated in the portions to be migrated which are not migrated at present, a new batch of electronic devices can be waited for to be used for receiving the migrated service resource, and then the portions to be migrated are migrated.
In addition, other machine resources such as CPU computing power, memory space of a memory, network bandwidth and the like, which are required to be occupied by the at least one currently selected part to be migrated, can be considered, so that the machine resources required to be occupied by the at least one currently selected part to be migrated do not exceed the machine resources provided by the electronic equipment currently used for receiving the service resources after migration.
In the related art, the migration sequence of each part to be migrated needs to be determined after manual communication, coordination of each business department and manual combing of the dependency relationship, and through the embodiment, the migration of the business resources can be standardized, the migration sequence of each part to be migrated can be automatically determined, and the migration can be automatically performed, so that the migration efficiency of the business resources can be greatly improved, and the labor cost is reduced.
In this embodiment, between every two nodes having a pointing relationship in the established directed acyclic graph, the portion to be migrated represented by the pointed node depends on the portion to be migrated represented by another node, and the level of the pointed node is greater than that of the other node, so that the migration order of each portion to be migrated is determined according to the level of each node, so that the order of the portion to be migrated represented by the node with a large level is located after the portion to be migrated represented by the node with a small level, and when migration is performed, the migration order of the module to be migrated which depends on other modules is located after the module which depends on the module to be migrated, so that the module to be migrated which depends on other modules can normally operate after migration, and therefore, the empty space of service resources can be reduced.
Optionally, in another embodiment of the present invention, determining the migration sequence of each portion to be migrated according to the level of each node may include the following steps:
for any two nodes, if the levels of the two nodes are different, determining that the migration sequence of the part to be migrated, which is represented by the node with the larger level, is positioned behind the part to be migrated, which is represented by the other node;
for any two nodes, if the levels of the two nodes are the same, determining the migration sequence between the portions to be migrated represented by the two nodes according to the number of times of use and/or the dependence attribute of the portions to be migrated represented by the two nodes; wherein the dependency attribute of one portion to be migrated is used to represent other portions to be migrated that depend on the portion to be migrated.
The number of times of the portion to be migrated may be the number of times the portion to be migrated is used by other portions to be migrated in the current service resource to be migrated in a specified period of time, and the number of times of the portion to be migrated may also be determined by querying log information of the current service resource to be migrated. The specified period of time may be determined empirically and on demand, and may be, for example, the number of times used in the past week or in the past month.
For example, when the data or the code in the portion to be migrated is called by another portion to be migrated, the portion to be migrated may be regarded as being used by another portion to be migrated, and when the number of times of use of the portion to be migrated is determined, the number of call requests received by the portion to be migrated in a specified period of time and sent by other portions to be migrated in the current service resource to be migrated may be detected, and the determined number of call requests is taken as the number of times of use of the portion to be migrated, where each call request may be a request for calling one piece of data or multiple pieces of data, a request for calling one piece of code or multiple pieces of code, or a request for calling data and code simultaneously.
The dependency attribute of the portion to be migrated may be the number of other portions to be migrated depending on the portion to be migrated, which may be used to characterize the degree of dependency of the portion to be migrated. To determine the dependency properties of the portion to be migrated, the determined directed acyclic graph may be queried, e.g., as shown in FIG. 2, where node 14 is dependent on 4 other nodes, then the dependency properties of the portion to be migrated characterized by node 14 may be determined to be 4. Further, in one implementation, a dependency attribute of a portion to be migrated represents: depending on the sum value of the preset weights of the other to-be-migrated parts of the to-be-migrated part, for example, the to-be-migrated part a is relied on by the to-be-migrated part B, the to-be-migrated part C and the to-be-migrated part D, and the preset weights of the to-be-migrated part B, the to-be-migrated part C and the to-be-migrated part D are respectively 0.7, 0.8 and 0.9, the dependent attribute of the to-be-migrated part a may be: 0.7+0.8+0.9=2.4.
The preset weight may be set according to the importance degree of each portion to be migrated, for example, if there are two portions to be migrated, where one portion to be migrated is user data, the other portion to be migrated is program code, and the user data is more important for the company to which the current service resource to be migrated belongs, the preset weight of the portion to be migrated that is user data may be set to a higher value, and the portion to be migrated that is program code may be set to a lower value. It can be seen that by setting the preset weight of the portion to be migrated, the importance degree of the portion to be migrated can be more accurately determined.
In this embodiment, for any two nodes, if the levels of the two nodes are the same, at least one of the following four ways may be adopted to determine the migration order of the portions to be migrated, which are represented by the two nodes:
mode one: determining the migration sequence between the portions to be migrated represented by the two nodes only according to the number of times of the portions to be migrated represented by the two nodes, wherein the migration sequence of the portions to be migrated with large number of times of use can be arranged before the portions to be migrated with small number of times of use; if the number of times of the two portions to be migrated is the same, the migration sequence between the two portions to be migrated may be randomly determined.
Determining a migration sequence between the portions to be migrated represented by the two nodes only according to the dependence attributes of the portions to be migrated represented by the two nodes, wherein the migration sequence of the portions to be migrated with large dependence attributes can be arranged in front of the portions to be migrated with small dependence attributes; if the dependency properties of the two portions to be migrated are the same, the migration sequence between the two portions to be migrated may be randomly determined.
Judging the number of times of the to-be-migrated parts represented by the two nodes, and determining that the migration sequence of the to-be-migrated part with larger number of times of use is positioned before the other to-be-migrated part under the condition that the number of times of the to-be-migrated parts represented by the two nodes are different; judging the size of the dependent attribute of the to-be-migrated part characterized by the two nodes under the condition that the number of times of the to-be-migrated parts characterized by the two nodes is the same, and determining that the migration sequence of the to-be-migrated part using the dependent attribute is positioned before the other to-be-migrated part;
judging the size of the dependence attribute of the part to be migrated, which is characterized by the two nodes; under the condition that the dependent attributes of the parts to be migrated, which are represented by the two nodes, are different, determining that the migration sequence of the part to be migrated with larger dependent attributes is positioned before the other part to be migrated; and under the condition that the dependency attributes of the parts to be migrated represented by the two nodes are the same, judging the number of times of use of the parts to be migrated represented by the two nodes, and determining that the migration sequence of the parts to be migrated with larger number of times of use is positioned before the other part to be migrated.
In this embodiment, the migration order of the to-be-migrated portion may be determined in the fourth preferred manner, that is, the dependency attribute of the to-be-migrated portion represented by the two nodes is preferentially considered, so as to ensure that the to-be-migrated portion with higher dependency degree is preferentially migrated.
In this embodiment, the idle space of the service resource can be reduced. Further, in the case that the levels of any two nodes are the same, the migration sequence between the portions to be migrated represented by the two nodes is determined according to the number of times of use and/or the dependence attribute of the portions to be migrated represented by the two nodes, so that an implementation basis is provided for determining the migration sequence of each portion to be migrated in the case that the nodes with the same level exist in the determined directed acyclic graph, and the portions to be migrated with higher importance can be guaranteed to be preferentially migrated.
Optionally, in another embodiment of the present invention, before the migration of each portion to be migrated according to the determined migration order of the portion to be migrated, the method may further include the following steps:
if the data volume of the to-be-migrated part is larger than a preset threshold, determining the to-be-migrated part as a current to-be-migrated service resource, and returning to execute the step of determining the dependency information of each to-be-migrated part in the current to-be-migrated service resource.
In this embodiment, when the data size of a portion to be migrated is larger, the migration difficulty is often larger, so a preset threshold may be set, and the preset threshold may be determined according to experience and requirements, so when the data size of the portion to be migrated is larger than the preset threshold, the portion to be migrated is regarded as a current service resource to be migrated, so that further splitting is performed, and further the migration sequence of each split portion is determined, batch migration of the portion to be migrated with a large data size is realized, so that migration efficiency is further improved. The manner of splitting may also be as above. For example, the service resource to be migrated currently contains a plurality of databases, and each of the databases can be used as a portion to be migrated; the current service resource to be migrated is data generated in 1 month, and data generated every 10 days in the data generated in 1 month can be used as a portion to be migrated respectively. The splitting method is not limited thereto.
In this embodiment, the idle space of the service resource can be reduced. Further, under the condition that the data volume of the part to be migrated is larger than a preset threshold, the part to be migrated is determined to be the current service resource to be migrated, so that the migration sequence of each part to be migrated in the current service resource to be migrated is determined, batch migration of the part to be migrated with large data volume is further realized, and the migration efficiency can be further improved.
For easy understanding, the following describes a method for migrating service resources according to an embodiment of the present invention with reference to fig. 3, where, as shown in fig. 3, the method may include:
s301, determining the dependency information of each part to be migrated in the current service resource to be migrated;
the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
s302, determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated;
wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
the steps S301 to S302 are similar to the steps S101 to S102, and are not repeated here.
S303, judging the level of any two nodes; if not, executing step S304; if so, step S305 is performed;
s304, determining that the migration sequence of the part to be migrated, which is characterized by the node with the larger hierarchy, is positioned behind the part to be migrated, which is characterized by the other node;
S305, judging the sizes of the dependency attributes of the represented portions to be migrated of the two nodes; if not, executing step S306; if so, executing step S307;
s306, determining that the migration sequence of the part to be migrated with larger dependence attribute is positioned before the other part to be migrated;
s307, determining that the migration sequence of the to-be-migrated part with larger times of use is positioned before another to-be-migrated part;
in this embodiment, when the levels of the two nodes are the same, the dependency properties of the portions to be migrated represented by the two nodes may be compared first, and if the levels of the two nodes are the same and the dependency properties of the represented portions to be migrated are also the same, the migration order between the two portions to be migrated is determined according to the number of times of use of the two portions to be migrated, that is, the migration order of the portion to be migrated with a large number of times of use is determined to be located before the portion to be migrated with a small number of times of use.
S308, for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated.
This step is similar to step S104 described above, and will not be described again here.
In this embodiment, the idle space of the service resource can be reduced. Further, under the condition that the levels of any two nodes are the same, the dependence attributes of the parts to be migrated, which are represented by the two nodes, are compared, and then the number of times of use of the two parts to be migrated is compared.
Based on the same inventive concept, the embodiment of the invention also provides a service resource migration device, as shown in fig. 4, which comprises:
an information determining module 401, configured to determine dependency information of each portion to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
a graph determining module 402, configured to determine, according to the dependency information of each portion to be migrated, a directed acyclic graph that uses each portion to be migrated as a node; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
a sequence determining module 403, configured to determine a migration sequence of each portion to be migrated according to a hierarchy of each node; the migration sequence is consistent with the sequence from small to large of the levels of the nodes corresponding to the parts to be migrated;
the migration module 404 migrates, for each portion to be migrated, the portion to be migrated according to the determined migration order of the portion to be migrated.
Optionally, the sequence determining module is specifically configured to:
for any two nodes, if the levels of the two nodes are different, determining that the migration sequence of the part to be migrated, which is represented by the node with the larger level, is positioned behind the part to be migrated, which is represented by the other node;
for any two nodes, if the levels of the two nodes are the same, determining the migration sequence between the portions to be migrated represented by the two nodes according to the number of times of use and/or the dependence attribute of the portions to be migrated represented by the two nodes;
wherein the dependency attribute of one portion to be migrated is used to represent other portions to be migrated that depend on the portion to be migrated.
Optionally, the order determining module determines, for any two nodes, a migration order between portions to be migrated represented by the two nodes according to the number of times of use and/or the dependency attribute of the portions to be migrated represented by the two nodes if the levels of the two nodes are the same, including:
judging the size of the dependency attribute of the part to be migrated, which is characterized by any two nodes, if the levels of the two nodes are the same; under the condition that the dependent attributes of the parts to be migrated, which are represented by the two nodes, are different, determining that the migration sequence of the part to be migrated with larger dependent attributes is positioned before the other part to be migrated; and under the condition that the dependency attributes of the parts to be migrated represented by the two nodes are the same, judging the number of times of use of the parts to be migrated represented by the two nodes, and determining that the migration sequence of the parts to be migrated with larger number of times of use is positioned before the other part to be migrated.
Optionally, the dependency attribute of a portion to be migrated represents: and the sum value of the preset weights of other parts to be migrated of the part to be migrated is dependent.
Optionally, the migration module includes:
the selecting submodule is used for selecting at least one part to be migrated with the highest migration sequence from the parts to be migrated which are not migrated at present; the sum of the data volume of the at least one selected part to be migrated does not exceed the available storage space of the electronic equipment currently used for receiving the migrated service resources;
and the migration submodule is used for migrating the selected at least one part to be migrated and triggering the selection submodule to execute the step of selecting at least one part to be migrated with the forefront migration sequence from all the parts to be migrated which are not migrated at present.
Optionally, the migration module is further configured to: before the migration of the to-be-migrated parts according to the determined migration sequence, if the data volume of the to-be-migrated parts is larger than a preset threshold, determining the to-be-migrated parts as current to-be-migrated service resources, and triggering the information module to execute the step of determining the dependency information of each to-be-migrated part in the current to-be-migrated service resources.
The embodiment of the invention also provides an electronic device, as shown in fig. 5, which comprises a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501 is configured to implement the steps of the service resource migration method when executing the program stored in the memory 503.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, where a computer program is stored, where the computer program is executed by a processor to implement the service resource migration method according to any one of the foregoing embodiments.
In yet another embodiment of the present invention, a computer program product containing instructions that, when executed on a computer, cause the computer to perform the method for migrating a service resource according to any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (9)

1. A method for migrating a service resource, the method comprising:
determining the dependency information of each part to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
determining a directed acyclic graph taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
determining the migration sequence of each part to be migrated according to the hierarchy of each node; the migration sequence is consistent with the sequence from small to large of the levels of the nodes corresponding to the parts to be migrated;
and for each part to be migrated, migrating the part to be migrated according to the determined migration sequence of the part to be migrated.
2. The method according to claim 1, wherein determining the migration order of each portion to be migrated according to the hierarchy of each node comprises:
For any two nodes, if the levels of the two nodes are different, determining that the migration sequence of the part to be migrated, which is represented by the node with the larger level, is positioned behind the part to be migrated, which is represented by the other node;
for any two nodes, if the levels of the two nodes are the same, determining the migration sequence between the portions to be migrated represented by the two nodes according to the number of times of use and/or the dependence attribute of the portions to be migrated represented by the two nodes;
wherein the dependency attribute of one portion to be migrated is used to represent other portions to be migrated that depend on the portion to be migrated.
3. The method according to claim 2, wherein for any two nodes, if the levels of the two nodes are the same, determining the migration order between the portions to be migrated represented by the two nodes according to the number of times of use and/or the dependency attribute of the portions to be migrated represented by the two nodes includes:
judging the size of the dependency attribute of the part to be migrated, which is characterized by any two nodes, if the levels of the two nodes are the same;
under the condition that the dependent attributes of the parts to be migrated, which are represented by the two nodes, are different, determining that the migration sequence of the part to be migrated with larger dependent attributes is positioned before the other part to be migrated;
And under the condition that the dependency attributes of the parts to be migrated represented by the two nodes are the same, judging the number of times of use of the parts to be migrated represented by the two nodes, and determining that the migration sequence of the parts to be migrated with larger number of times of use is positioned before the other part to be migrated.
4. The method of claim 2, wherein the dependent attribute of a portion to be migrated represents: and the sum value of the preset weights of other parts to be migrated of the part to be migrated is dependent.
5. The method according to claim 1, wherein for each portion to be migrated, migrating the portion to be migrated according to the determined migration order of the portion to be migrated includes:
selecting at least one part to be migrated with the forefront migration sequence from the parts to be migrated which are not migrated currently; the sum of the data volume of the at least one selected part to be migrated does not exceed the available storage space of the electronic equipment currently used for receiving the migrated service resources;
and migrating the selected at least one part to be migrated, and returning to execute the step of selecting at least one part to be migrated with the highest migration sequence from the parts to be migrated which are not migrated currently.
6. The method according to claim 1, wherein before said migrating the portion to be migrated in the determined migration order of the portion to be migrated for each portion to be migrated, the method further comprises:
and for each part to be migrated, if the data volume of the part to be migrated is larger than a preset threshold, determining the part to be migrated as the current service resource to be migrated, and returning to the step of executing the dependent information of each part to be migrated in the determined current service resource to be migrated.
7. A traffic resource migration apparatus, the apparatus comprising:
the information determining module is used for determining the dependency information of each part to be migrated in the current service resource to be migrated; the dependency information of each part to be migrated characterizes the dependency relationship between the part to be migrated and other parts to be migrated;
the diagram determining module is used for determining a directed acyclic diagram taking each part to be migrated as a node according to the dependency information of each part to be migrated; wherein, in the determined directed acyclic graph, between every two nodes with directed relations, the part to be migrated, which is characterized by the directed node, depends on the part to be migrated, which is characterized by another node, and the level of the directed node is larger than that of the other node;
The sequence determining module is used for determining the migration sequence of each part to be migrated according to the hierarchy of each node; the migration sequence is consistent with the sequence from small to large of the levels of the nodes corresponding to the parts to be migrated;
and the migration module is used for migrating each part to be migrated according to the determined migration sequence of the part to be migrated.
8. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-6 when executing a program stored on a memory.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-6.
CN202310922119.3A 2023-07-26 2023-07-26 Service resource migration method and device and electronic equipment Pending CN117130979A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310922119.3A CN117130979A (en) 2023-07-26 2023-07-26 Service resource migration method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310922119.3A CN117130979A (en) 2023-07-26 2023-07-26 Service resource migration method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117130979A true CN117130979A (en) 2023-11-28

Family

ID=88851800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310922119.3A Pending CN117130979A (en) 2023-07-26 2023-07-26 Service resource migration method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117130979A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117742604A (en) * 2023-12-20 2024-03-22 北京火山引擎科技有限公司 Data storage control method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117742604A (en) * 2023-12-20 2024-03-22 北京火山引擎科技有限公司 Data storage control method and device

Similar Documents

Publication Publication Date Title
CN107622091B (en) Database query method and device
CN109800204B (en) Data distribution method and related product
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN117130979A (en) Service resource migration method and device and electronic equipment
CN111581502A (en) Information notification method and device
CN111858586B (en) Data processing method and device
CN111562884B (en) Data storage method and device and electronic equipment
CN111026765A (en) Dynamic processing method, equipment, storage medium and device for strictly balanced binary tree
CN110555144A (en) stream clustering method and device, electronic equipment and medium
CN111125240B (en) Distributed transaction realization method and device, electronic equipment and storage medium
CN110929131A (en) Data export method, device, equipment and storage medium
CN112732711B (en) Data storage method and device and electronic equipment
CN112558872A (en) Data processing method and device, storage medium and electronic equipment
CN115190010B (en) Distributed recommendation method and device based on software service dependency relationship
CN110852603A (en) High-throughput wind control data processing method, device, equipment and storage medium
CN107291864B (en) Searching method and device and electronic equipment
WO2020000724A1 (en) Method, electronic device and medium for processing communication load between hosts of cloud platform
CN114090268B (en) Container management method and container management system
CN116151631A (en) Service decision processing system, service decision processing method and device
CN111884932B (en) Link determining method, device, equipment and computer readable storage medium
CN115580522A (en) Method and device for monitoring running state of container cloud platform
CN115438020A (en) Database resource scheduling method, device, equipment and medium
CN109543079B (en) Data query method and device, computing equipment and storage medium
CN112181831A (en) Script performance verification method, device and equipment based on keywords and storage medium
CN111124712A (en) Event notification method, device, server 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