A system interaction method and device
By using resource identifier generation templates in the Hadoop system and storing resource identifiers in the target database, the problem of maintaining multiple resource correspondences between different systems is solved, thereby reducing interaction costs and system pressure.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING IQIYI TECH CO LTD
- Filing Date
- 2022-07-13
- Publication Date
- 2026-07-31
AI Technical Summary
In Hadoop-based systems, different systems need to maintain multiple mapping relationships because upstream systems have different agreements on the mapping between empty files and resources for different resources, which increases the interaction cost.
By responding to the resource identifier generation request sent by the first system when the resource is in an available state, a resource identifier generation template is sent to the first system to generate the resource identifier of the resource and store it in the target database. By using the resource identifier generation template generated by the set platform system, the resource identifier of the target database can be queried, reducing the maintenance of the correspondence between different resources.
It reduces the interaction cost between the first and second systems, reduces the pressure on the NameNode in the Hadoop system, and simplifies the generation and querying process of resource identifiers by setting up unified management of the platform system.
Smart Images

Figure CN115374093B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a system interaction method and apparatus. Background Technology
[0002] In Hadoop-based systems, different systems may have interrelationships; for example, a downstream system may depend on resources from an upstream system to perform tasks. In this context, the upstream system typically creates empty files to identify available resources and establishes a mapping between these empty files and available resources with the downstream system. The downstream system then checks the existence of the empty files based on this mapping to determine whether the resource is available.
[0003] However, upstream systems typically agree on different correspondences between empty files and resources for different resources, which means that upstream and downstream systems need to maintain multiple correspondences to detect the existence of different empty files, resulting in high interaction costs. Summary of the Invention
[0004] This application provides the following technical solution:
[0005] This application provides a system interaction method for setting up a platform system, the method comprising:
[0006] In response to a resource identifier generation request sent by the first system when the resource is available, a resource identifier generation template is sent to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0007] Obtain the resource identifier of the resource and store the resource identifier of the resource in the target database;
[0008] If it is determined that a resource identifier corresponding to the target resource exists in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that has an association with the second system.
[0009] Optionally, the method further includes:
[0010] Send a quality verification request for the target resource to the quality verification system, so that the quality verification system responds to the quality verification request, performs quality verification on the target resource, and obtains the quality verification result;
[0011] Obtain the quality verification result and return the quality verification result to the second system.
[0012] Optionally, the method further includes:
[0013] Based on the quality verification results, a quality verification identifier is generated;
[0014] The quality verification identifier is associated with the resource identifier corresponding to the target resource and stored in the target database.
[0015] Optionally, the method further includes:
[0016] Generate first log information, which is information recorded when executing the first target step and the steps prior to executing the first target step. The first target step is to store the resource identifier of the resource in the target database.
[0017] The first log information is stored in the target database.
[0018] Optionally, the method further includes:
[0019] The updated resource identifier is obtained from the first system. The updated resource identifier is the resource identifier of the restored resource generated by the first system based on the resource identifier generation template when the resource is restored and the restored resource is obtained.
[0020] The updated resource identifier is overwritten with the resource identifier of the resource in the target database;
[0021] The action information is sent to the second system, and the action information represents the action of overwriting the resource identifier of the resource in the target database with the updated resource identifier.
[0022] Optionally, the method further includes:
[0023] Generate second log information, which is information recorded when executing the second objective step and the third objective step. The second objective step is to obtain the updated resource identifier from the first system, and the third objective step is to overwrite the resource identifier of the resource in the target database with the updated resource identifier.
[0024] The second log information is stored in the target database.
[0025] Optionally, storing the resource identifier of the resource in the target database includes:
[0026] Store the resource identifier of the resource in the cache;
[0027] The resource identifier of the resource is obtained from the cache and stored in the target database.
[0028] Optionally, the target database contains a process for determining the resource identifier corresponding to the target resource, including:
[0029] The resource identifier corresponding to the target resource is searched in the cache, which contains the resource identifier of the resource that was previously obtained from the target database;
[0030] If found, it is determined that a resource identifier corresponding to the target resource exists in the target database.
[0031] Optionally, the step of returning the first target result to the second system when it is determined that a resource identifier corresponding to the target resource exists in the target database includes:
[0032] In response to a query request for a target resource sent by the second system, the system searches for a resource identifier corresponding to the target resource in the target database.
[0033] If found, the first target result is returned to the second system;
[0034] Alternatively, if an operation to store the resource identifier of the target resource in the target database is intercepted, the first target result is returned to the second system.
[0035] This application also provides a system interaction method applied to a first system, the method comprising:
[0036] Once it is determined that the resource is in an available state, a resource identifier generation request is sent to the setting platform system, so that the setting platform system responds to the resource identifier generation request and sends a resource identifier generation template to the first system;
[0037] Based on the resource identifier generation template, generate the resource identifier for the resource;
[0038] The resource identifier of the resource is sent to the designated platform system so that the designated platform system can obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0039] A third aspect of this application provides a system interaction device, comprising:
[0040] The first sending module is configured to respond to a resource identifier generation request sent by the first system when the resource is in an available state, and send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template;
[0041] The first storage module is used to obtain the resource identifier of the resource and store the resource identifier of the resource in the target database;
[0042] The first return module is used to return a first target result to the second system when it is determined that there is a resource identifier corresponding to the target resource in the target database. The first target result is used to indicate that the target resource is available, and the target resource is a resource that has an association relationship with the second system.
[0043] A fourth aspect of this application provides a system interaction device, comprising:
[0044] The request sending module is used to send a resource identifier generation request to the setting platform system when it is determined that the resource is in an available state, so that the setting platform system responds to the resource identifier generation request and sends a resource identifier generation template to the first system;
[0045] The resource identifier generation module is used to generate a resource identifier for the resource based on the resource identifier generation template.
[0046] The identifier sending module is used to send the resource identifier of the resource to the designated platform system, so that the designated platform system can obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0047] Compared with the prior art, the beneficial effects of this application are as follows:
[0048] In this application, a resource identifier generation template is sent to the first system in response to a resource identifier generation request sent when the resource is available. This allows the first system to generate resource identifiers for different resources based on the template, eliminating the need to maintain mappings between different resources. After obtaining and storing the resource identifiers in the target database, the platform system, based on the template, has the ability to query the target database. Specifically, it can determine if a resource identifier corresponding to the target resource exists in the database. Upon confirming the existence of such an identifier, the platform system returns the first target result to the second system. This eliminates the need for the second system to maintain mappings between different resources agreed upon by the first system, ensuring that the interaction between the first and second systems does not require agreeing on multiple resource mappings, thereby reducing the interaction cost between the two systems. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is a flowchart illustrating a system interaction method provided in Embodiment 1 of this application;
[0051] Figure 2 This is a flowchart illustrating a system interaction method provided in Embodiment 2 of this application;
[0052] Figure 3 This is a flowchart illustrating a system interaction method provided in Embodiment 3 of this application;
[0053] Figure 4 This is a flowchart illustrating a system interaction method provided in Embodiment 4 of this application;
[0054] Figure 5 This is a schematic diagram of an interactive scenario of a setting platform system provided in this application;
[0055] Figure 6 This is a flowchart illustrating a system interaction method provided in Embodiment 5 of this application;
[0056] Figure 7 This is a flowchart illustrating a system interaction method provided in Embodiment 6 of this application;
[0057] Figure 8 This is a schematic diagram of the structure of a system interaction device provided in this application. Detailed Implementation
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0060] Reference Figure 1 This is a flowchart illustrating a system interaction method provided in Embodiment 1 of this application. This method can be applied to setting up a platform system, such as... Figure 1As shown, the method may include, but is not limited to, the following steps:
[0061] Step S11: In response to the resource identifier generation request sent by the first system when the resource is in an available state, send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0062] When the resource is available, the first system can send a resource identifier generation request to the configuration platform system. Correspondingly, the configuration platform system responds to the resource identifier generation request by sending a resource identifier generation template to the first system.
[0063] The resource identifier generation template is pre-defined and is used to generate resource identifiers for resources.
[0064] Understandably, the first system includes various types of resources. For each type of resource, a resource identifier generation request can be sent to the designated platform system when the resource is in an available state.
[0065] The different types of resources included in the first system are not limited in this application.
[0066] Resource identifier generation templates can be, but are not limited to, resource identifier generation templates based on schema (XML Schema). For example, a resource identifier generation template can be: Resource type: / / <cluster name> / <database name> / ( / <tag>).in, <tag>As an extension item, the first system can choose to use extension items or not. For example, the first system can use extension items to store the production date of resources. For instance, if a resource is resource A of resource type mysql, the first system generates a template based on the resource identifier, and the generated resource identifier for resource A is: mysql: / / bd.nervitest.w.qiyi.db:1488 / nervi_lite_bi / account_balance@2021-11-20.
[0067] It should be noted that, in this embodiment, the generated resource identifier is an identifier indicating that the resource is in an available state. The resource identifier is different from the identity identifier (e.g., name) that indicates the resource.
[0068] In this embodiment, the first system can be, but is not limited to, one of the systems based on Hadoop.
[0069] Step S12: Obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0070] Storing the resource identifier of the resource in the target database may include, but is not limited to, associating the resource identifier of the resource with the identity identifier of the resource. Specifically, associating the resource identifier of the resource with the identity identifier of the resource allows determining whether the resource identifier of the resource exists in the target database based on the identity identifier of the resource.
[0071] The first system can call the write interface of the setting platform system to send the resource identifier of the resource to the setting platform system, and correspondingly, the setting platform system obtains the resource identifier of the resource.
[0072] The first system can, but is not limited to, calling the write interface of the platform system via HTTP or REST.
[0073] Storing the resource identifier of the resource in the target database may include:
[0074] S121. The resource identifier of the resource is directly stored in the target database.
[0075] Of course, storing the resource identifier of the resource in the target database may also include, but is not limited to:
[0076] S122. Store the resource identifier of the resource in the cache.
[0077] S123. Obtain the resource identifier of the resource from the cache and store the resource identifier of the resource in the target database.
[0078] In this embodiment, by executing steps S122-S123, the pressure of write operations on the target database can be reduced.
[0079] The resource identifier of the resource is stored in the target database, ensuring that the target database stores the resource identifier of the resource that is in an available state.
[0080] In this embodiment, the target database can be, but is not limited to, a MySQL database.
[0081] Step S13: If it is determined that there is a resource identifier corresponding to the target resource in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that has an association with the second system.
[0082] In this embodiment, there is a correlation between the first system and the second system. For example, the result of task execution in the first system serves as the input data for tasks in the second system.
[0083] Resources in the first system that are associated with the second system can be, but are not limited to, resources in the first system that can serve as input data for tasks in the second system.
[0084] Wherein, the step of returning the first target result to the second system when it is determined that a resource identifier corresponding to the target resource exists in the target database may include, but is not limited to:
[0085] S131. In response to the query request for the target resource sent by the second system, search for the resource identifier corresponding to the target resource in the target database.
[0086] The second system can send query requests for target resources to the designated platform system by calling its read interface. The second system can call the platform system's read interface using, but is not limited to, HTTP or REST methods.
[0087] Searching for the resource identifier corresponding to the target resource in the target database may include, but is not limited to:
[0088] S1311. Search for the resource identifier corresponding to the target resource in the cache, wherein the cache contains the resource identifier of the resource obtained in advance from the target database.
[0089] Searching for the resource identifier corresponding to the target resource in the cache may include, but is not limited to, searching for the resource identifier corresponding to the identity identifier of the target resource in the cache.
[0090] If found, it is determined that a resource identifier corresponding to the target resource exists in the target database, and step S132 is executed.
[0091] S132. Return the first target result to the second system.
[0092] By obtaining the resource identifier of the resource from the target database in advance, storing the resource identifier of the resource in the cache, and searching for the resource identifier corresponding to the target resource in the cache, the pressure of read operations on the target database can be reduced.
[0093] In this embodiment, the step of returning the first target result to the second system when it is determined that a resource identifier corresponding to the target resource exists in the target database may include, but is not limited to:
[0094] S133. If the operation of storing the resource identifier of the target resource into the target database is intercepted, the first target result is returned to the second system.
[0095] In this embodiment, each resource in the first system that has a relationship with the second system, i.e., each target resource, can be predetermined. Based on the predetermined target resources, step S133 may include, but is not limited to:
[0096] Based on AOP (Aspect-Oriented Programming), the operation of storing the resource identifier of a resource in the target database is intercepted to obtain the operation information, and the operation information is written to MQ (Message Queue). If the resource identifier contained in the operation information in MQ is the resource identifier of the target resource, the first target result is returned to the second system.
[0097] In this embodiment, in response to a resource identifier generation request sent by the first system when the resource is available, a resource identifier generation template is sent to the first system. This allows the first system to generate resource identifiers for different resources based on the template, eliminating the need to maintain the mapping relationships between different resources. After obtaining and storing the resource identifiers in the target database, the platform system, since the resource identifiers are generated based on the template, has the ability to query resource identifiers in the target database. Specifically, the platform system can determine whether a resource identifier corresponding to the target resource exists in the target database. Upon confirming the existence of such a resource identifier, the platform system returns the first target result to the second system. This eliminates the need for the second system to maintain the mapping relationships between different resources agreed upon by the first system, ensuring that the interaction between the first and second systems does not require agreeing on multiple resource mapping relationships, thereby reducing the interaction cost between the two systems.
[0098] Furthermore, using the resource identifier of the target database to store resources can reduce a large number of small files compared to using HDFS storage, thus reducing the pressure on the NameNode in the Hadoop-based system.
[0099] Furthermore, the platform system is set as an independently developed system with fully controllable code, facilitating integration with more systems.
[0100] As another optional embodiment of this application, refer to Figure 2 This is a flowchart illustrating a system interaction method embodiment 2 provided in this application. This embodiment is mainly an extension of the system interaction method described in embodiment 1 above. The method may include, but is not limited to, the following steps:
[0101] Step S21: In response to the resource identifier generation request sent by the first system when the resource is in an available state, send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0102] Step S22: Obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0103] Step S23: If it is determined that there is a resource identifier corresponding to the target resource in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that has an association with the second system.
[0104] For detailed procedures of steps S21-S23, please refer to the relevant description of steps S11-S13 in Example 1, which will not be repeated here.
[0105] Step S24: Send a quality verification request for the target resource to the quality verification system, so that the quality verification system responds to the quality verification request, performs quality verification on the target resource, and obtains the quality verification result.
[0106] In this application, there are no restrictions on the specific implementation of the quality verification system responding to the quality verification request and performing quality verification on the target resource.
[0107] Step S25: Obtain the quality verification result and return the quality verification result to the second system.
[0108] In this embodiment, in response to a resource identifier generation request sent by the first system when the resource is available, a resource identifier generation template is sent to the first system. This allows the first system to generate resource identifiers for different resources based on the template, eliminating the need to maintain the mapping relationships between different resources. After obtaining and storing the resource identifiers in the target database, the platform system, since the resource identifiers are generated based on the template, has the ability to query resource identifiers in the target database. Specifically, the platform system can determine whether a resource identifier corresponding to the target resource exists in the target database. Upon confirming the existence of such an identifier, the platform system returns the first target result to the second system. This eliminates the need for the second system to maintain the mapping relationships between different resources agreed upon by the first system, ensuring that the interaction between the first and second systems does not require agreeing on multiple resource mapping relationships, thereby reducing the interaction cost between the two systems.
[0109] Furthermore, by sending a quality verification request for the target resource to the quality verification system, the quality verification system responds to the quality verification request, performs quality verification on the target resource, obtains the quality verification result, acquires the quality verification result, returns the quality verification result to the second system, and simultaneously indicates the availability of the target resource and the quality verification status of the target resource, so that the second system can determine whether to use the target resource based on the availability of the target resource and the quality verification status of the target resource.
[0110] As another optional embodiment of this application, refer to Figure 3 This is a flowchart illustrating a system interaction method embodiment 3 provided in this application. This embodiment is mainly an extension of the system interaction method described in embodiment 2 above. The method may include, but is not limited to, the following steps:
[0111] Step S31: In response to the resource identifier generation request sent by the first system when the resource is in an available state, send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0112] Step S32: Obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0113] Step S33: If it is determined that there is a resource identifier corresponding to the target resource in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that has an association with the second system.
[0114] Step S34: Send a quality verification request for the target resource to the quality verification system, so that the quality verification system responds to the quality verification request, performs quality verification on the target resource, and obtains the quality verification result.
[0115] Step S35: Obtain the quality verification result and return the quality verification result to the second system.
[0116] For a detailed description of steps S31-S35, please refer to the relevant description of steps S21-S25 in Example 2, which will not be repeated here.
[0117] Step S36: Generate a quality verification identifier based on the quality verification result.
[0118] In this embodiment, a quality verification identifier generation template can be pre-set. Upon obtaining the quality verification result, a quality verification identifier is generated based on the quality verification result and the quality verification identifier generation template. For example, the quality verification identifier generation template can be: +P for resources that pass the quality verification; and -P for resources that fail the quality verification.
[0119] Step S37: Associate the quality verification identifier with the resource identifier corresponding to the target resource and store it in the target database.
[0120] In this embodiment, the quality verification identifier and the resource identifier corresponding to the target resource can be stored in different fields of the target database, and the fields are related to each other.
[0121] Of course, the quality verification identifier can also be combined with the resource identifier corresponding to the target resource to obtain a combined identifier, which is then stored in the target database. For example, if the resource identifier corresponding to the target resource is mysql: / / bd.nervitest.w.qiyi.db:1488 / nervi_lite_bi / account_balance@2021-11-20, and the quality verification result of the target resource is passed, then the combined identifier would be mysql: / / bd.nervitest.w.qiyi.db:1488 / nervi_lite_bi / account_balance@2021-11-20@+p.
[0122] In this embodiment, in response to a resource identifier generation request sent by the first system when the resource is available, a resource identifier generation template is sent to the first system. This allows the first system to generate resource identifiers for different resources based on the template, eliminating the need to maintain the mapping relationships between different resources. After obtaining and storing the resource identifiers in the target database, the platform system, since the resource identifiers are generated based on the template, has the ability to query resource identifiers in the target database. Specifically, the platform system can determine whether a resource identifier corresponding to the target resource exists in the target database. Upon confirming the existence of such a resource identifier, the platform system returns the first target result to the second system. This eliminates the need for the second system to maintain the mapping relationships between different resources agreed upon by the first system, ensuring that the interaction between the first and second systems does not require agreeing on multiple resource mapping relationships, thereby reducing the interaction cost between the two systems.
[0123] Furthermore, by sending a quality verification request for the target resource to the quality verification system, the quality verification system responds to the quality verification request, performs quality verification on the target resource, obtains the quality verification result, acquires the quality verification result, returns the quality verification result to the second system, and simultaneously indicates that the target resource is available and the quality verification status of the target resource.
[0124] Furthermore, based on the quality verification result, a quality verification identifier is generated, and the quality verification identifier is associated with the resource identifier corresponding to the target resource and stored in the target database. This ensures that the availability of the target resource and the quality verification result of the target resource can be queried in the target database, providing more reference information for the second system and ensuring the reliability of the second system's use of the target resource.
[0125] As another optional embodiment of this application, refer to Figure 4 This is a flowchart illustrating a system interaction method embodiment 4 provided by this application. This embodiment is mainly an extension of the system interaction method described in embodiment 1 above. The method may include, but is not limited to, the following steps:
[0126] Step S41: In response to the resource identifier generation request sent by the first system when the resource is in an available state, send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0127] Step S42: Obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0128] Step S43: If it is determined that there is a resource identifier corresponding to the target resource in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that has an association with the second system.
[0129] For detailed procedures of steps S41-S43, please refer to the relevant description of steps S11-S13 in Example 1, which will not be repeated here.
[0130] Step S44: Generate first log information. The first log information is the information recorded when executing the first target step and the steps before executing the first target step. The first target step is to store the resource identifier of the resource in the target database.
[0131] When performing the first objective step and the steps preceding it, information may be recorded as needed to obtain first log information. This application does not limit the types of information recorded. For example, the information recorded during the execution of the first objective step may include, but is not limited to, information about the first system that generated the resource identifier and the storage time of the resource identifier.
[0132] Step S45: Store the first log information in the target database.
[0133] In this embodiment, in response to a resource identifier generation request sent by the first system when the resource is available, a resource identifier generation template is sent to the first system. This allows the first system to generate resource identifiers for different resources based on the template, eliminating the need to maintain the mapping relationships between different resources. After obtaining and storing the resource identifiers in the target database, the platform system, since the resource identifiers are generated based on the template, has the ability to query resource identifiers in the target database. Specifically, the platform system can determine whether a resource identifier corresponding to the target resource exists in the target database. Upon confirming the existence of such a resource identifier, the platform system returns the first target result to the second system. This eliminates the need for the second system to maintain the mapping relationships between different resources agreed upon by the first system, ensuring that the interaction between the first and second systems does not require agreeing on multiple resource mapping relationships, thereby reducing the interaction cost between the two systems.
[0134] Furthermore, by generating first log information, which contains information recorded during the execution of the first target step and the steps preceding the first target step, and storing the first log information in the target database, users can easily query the history of the execution of the first target step and the steps preceding the first target step at any time, facilitating troubleshooting.
[0135] For example, such as Figure 5 As shown, the platform system can respond to the resource identifier generation request sent by the first system by sending a resource identifier generation template based on the schema to the first system. The first system generates a resource identifier based on the resource identifier generation template and calls the write interface to send the resource identifier to the platform system. The platform system can first store the resource identifier in the cache and then store the resource identifier in the cache in the data storage table of the target database. The second system can call the read interface to send a query request for the target resource to the platform system. The platform system responds to the query request, searches for the resource identifier corresponding to the target resource in the cache, and if found, returns the first target result to the second system through read-write routing.
[0136] Furthermore, the platform system is configured to connect to the target database based on AOP to access resource identifiers and obtain operation information, which is then written to the MQ table in the target database. The platform system can also generate initial log information and write it to the log table in the target database.
[0137] As another optional embodiment of this application, refer to Figure 6 This is a flowchart illustrating a system interaction method embodiment 5 provided in this application. This embodiment is mainly an extension of the system interaction method described in embodiment 1 above. The method may include, but is not limited to, the following steps:
[0138] Step S51: In response to the resource identifier generation request sent by the first system when the resource is in an available state, send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0139] Step S52: Obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0140] Step S53: If it is determined that there is a resource identifier corresponding to the target resource in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that has an association with the second system.
[0141] For detailed procedures of steps S51-S53, please refer to the relevant description of steps S11-S13 in Example 1, which will not be repeated here.
[0142] Step S54: Obtain the updated resource identifier from the first system. The updated resource identifier is the resource identifier of the restored resource generated by the first system based on the resource identifier generation template when the resource is restored and the restored resource is obtained.
[0143] In this embodiment, the first system may perform the resource recovery operation in, but is not limited to, the following situations:
[0144] (1) If the system associated with the first system is restarted, the execution result of the task in the system associated with the first system will affect the execution of the task in the first system; (2) The execution strategy of the task in the first system changes, such as the adjustment of the calculation rules for certain indicators.
[0145] The first system performs a recovery operation on the resource, and the recovered resource may include, but is not limited to: the first system re-executes the task corresponding to the resource according to the original task execution logic, and obtains the resource determined by the re-execution of the task corresponding to the resource, and uses the determined resource as the recovered resource.
[0146] Of course, the first system may perform a recovery operation on the resource to obtain the recovered resource, which may include, but is not limited to: the first system re-executes the task corresponding to the resource according to the updated task execution logic to obtain the resource determined by the re-execution of the task corresponding to the resource, and uses the determined resource as the recovered resource.
[0147] Step S55: Overwrite the resource identifier of the resource in the target database with the updated resource identifier.
[0148] Step S56: Send action information to the second system, wherein the action information represents the action of overwriting the resource identifier of the resource in the target database with the updated resource identifier.
[0149] This step may include, but is not limited to: intercepting the action of overwriting the resource identifier of the resource in the target database with the updated resource identifier based on AOP, obtaining action information, writing the action information into MQ, reading the action information from MQ, and sending the action information to the second system.
[0150] Step S57: Generate second log information. The second log information is the information recorded when executing the second target step and the third target step. The second target step is to obtain the updated resource identifier from the first system. The third target step is to overwrite the resource identifier of the resource in the target database with the updated resource identifier.
[0151] When performing the second objective step and the third objective step, information may be recorded as needed to obtain second log information. This application does not limit the types of information recorded. For example, the information recorded during the second objective step may include, but is not limited to, information about the first system and the time of obtaining the updated resource identifier; the information recorded during the third objective step may include, but is not limited to, the time when the updated resource identifier overwrites the resource identifier in the target database.
[0152] Step S58: Store the second log information in the target database.
[0153] In this embodiment, in response to a resource identifier generation request sent by the first system when the resource is available, a resource identifier generation template is sent to the first system. This allows the first system to generate resource identifiers for different resources based on the template, eliminating the need to maintain the mapping relationships between different resources. After obtaining and storing the resource identifiers in the target database, the platform system, since the resource identifiers are generated based on the template, has the ability to query resource identifiers in the target database. Specifically, the platform system can determine whether a resource identifier corresponding to the target resource exists in the target database. Upon confirming the existence of such a resource identifier, the platform system returns the first target result to the second system. This eliminates the need for the second system to maintain the mapping relationships between different resources agreed upon by the first system, ensuring that the interaction between the first and second systems does not require agreeing on multiple resource mapping relationships, thereby reducing the interaction cost between the two systems.
[0154] Furthermore, the updated resource identifier is obtained from the first system. The updated resource identifier is the resource identifier of the restored resource generated by the first system based on the resource identifier generation template when the resource is restored. The updated resource identifier is then overwritten with the resource identifier of the resource in the target database to ensure the reliability of the resource identifier in the target database.
[0155] In addition, the action information is sent to the second system to promptly notify the second system that resources have changed.
[0156] Furthermore, by generating second log information, which is the information recorded when executing the second target step and the third target step, and storing the second log information in the target database, users can easily query the history of executing the second target step and the third target step at any time, which facilitates troubleshooting.
[0157] Reference Figure 7 This is a flowchart illustrating a system interaction method provided in Embodiment 6 of this application. This method can be applied to a first system, such as... Figure 7 As shown, the method may include, but is not limited to, the following steps:
[0158] Step S61: When it is determined that the resource is in an available state, a resource identifier generation request is sent to the setting platform system, so that the setting platform system responds to the resource identifier generation request and sends a resource identifier generation template to the first system.
[0159] Step S62: Generate the resource identifier of the resource based on the resource identifier generation template.
[0160] Step S63: Send the resource identifier of the resource to the setting platform system so that the setting platform system can obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0161] In this embodiment, when the first system determines that the resource is available, it sends a resource identifier generation request to the designated platform system. The designated platform system then responds to the resource identifier generation request by sending a resource identifier generation template to the first system. Based on the resource identifier generation template, the first system generates the resource identifier of the resource, ensuring that the resource identifier is generated in a unified manner. This allows the first system to maintain only one method for generating resource identifiers and then send the resource identifiers to the designated platform system, reducing the interaction cost of the first system.
[0162] The following section describes a system interaction device provided in this application. The system interaction device described below can be referred to in correspondence with the system interaction method described above.
[0163] Please see Figure 8 The system interaction device includes: a first sending module 100, a first storage module 200, and a first return module 300.
[0164] The first sending module 100 is used to respond to a resource identifier generation request sent by the first system when the resource is in an available state, and send a resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template.
[0165] The first storage module 200 is used to obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0166] The process by which the first storage module 200 stores the resource identifier of the resource in the target database may specifically include:
[0167] Store the resource identifier of the resource in the cache;
[0168] The resource identifier of the resource is obtained from the cache and stored in the target database.
[0169] The first return module 300 is used to return a first target result to the second system when it is determined that there is a resource identifier corresponding to the target resource in the target database. The first target result is used to indicate that the target resource is available. The target resource is a resource among the resources that has an association relationship with the second system.
[0170] The process of determining the resource identifier corresponding to the target resource in the target database may include:
[0171] The resource identifier corresponding to the target resource is searched in the cache, which contains the resource identifier of the resource that was previously obtained from the target database;
[0172] If found, it is determined that a resource identifier corresponding to the target resource exists in the target database.
[0173] The first return module 300 can be used specifically for:
[0174] In response to a query request for a target resource sent by the second system, the system searches for a resource identifier corresponding to the target resource in the target database.
[0175] If found, the first target result is returned to the second system;
[0176] Alternatively, if an operation to store the resource identifier of the target resource in the target database is intercepted, the first target result is returned to the second system.
[0177] In this embodiment, the system interaction device may further include:
[0178] The second sending module is used to send a quality verification request for the target resource to the quality verification system, so that the quality verification system responds to the quality verification request, performs quality verification on the target resource, and obtains a quality verification result.
[0179] The second return module is used to obtain the quality verification result and return the quality verification result to the second system.
[0180] In this embodiment, the system interaction device may further include:
[0181] The first generation module is used to generate a quality verification identifier based on the quality verification result;
[0182] The second storage module is used to associate the quality verification identifier with the resource identifier corresponding to the target resource and store it in the target database.
[0183] In this embodiment, the system interaction device may further include:
[0184] The second generation module is used to generate first log information, which is information recorded when executing the first target step and the steps before executing the first target step. The first target step is to store the resource identifier of the resource in the target database.
[0185] The third storage module is used to store the first log information into the target database.
[0186] In this embodiment, the system interaction device may further include:
[0187] The acquisition module is used to acquire the updated resource identifier from the first system. The updated resource identifier is the resource identifier of the restored resource generated by the first system based on the resource identifier generation template when the resource is restored and the restored resource is obtained by performing a restoration operation on the resource.
[0188] The fourth storage module is used to overwrite the resource identifier of the resource in the target database with the updated resource identifier;
[0189] The third sending module is used to send action information to the second system, wherein the action information represents the action of overwriting the resource identifier of the resource in the target database with the updated resource identifier.
[0190] In this embodiment, the system interaction device may further include:
[0191] The third generation module is used to generate second log information, which is information recorded when executing the second target step and the third target step. The second target step is to obtain the updated resource identifier from the first system, and the third target step is to overwrite the resource identifier of the resource in the target database with the updated resource identifier.
[0192] The fifth storage module is used to store the second log information into the target database.
[0193] In another embodiment of this application, a different system interaction device is provided, which includes: a request sending module, a resource identifier generation module, and an identifier sending module.
[0194] The request sending module is used to send a resource identifier generation request to the setting platform system when it is determined that the resource is in an available state, so that the setting platform system responds to the resource identifier generation request and sends a resource identifier generation template to the first system;
[0195] The resource identifier generation module is used to generate a resource identifier for the resource based on the resource identifier generation template.
[0196] The identifier sending module is used to send the resource identifier of the resource to the designated platform system, so that the designated platform system can obtain the resource identifier of the resource and store the resource identifier of the resource in the target database.
[0197] It should be noted that each embodiment focuses on describing the differences from other embodiments, and the same or similar parts between the embodiments can be referred to accordingly. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
[0198] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0199] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0200] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0201] The above provides a detailed description of a system interaction method and apparatus provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.< / tag> < / tag>
Claims
1. A system interaction method, characterized in that, Applied to setting up a platform system, the method includes: In response to a resource identifier generation request sent by a first system in a Hadoop-based system when the resource is available, a pre-set resource identifier generation template is sent to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template. Obtain the resource identifier of the resource and store it in the cache; then obtain the resource identifier of the resource from the cache and store it in the target database. If it is determined that a resource identifier corresponding to the target resource exists in the target database, a first target result is returned to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that is associated with the second system. The result of task execution in the first system is used as input data for the task in the second system.
2. The method according to claim 1, characterized in that, The method further includes: Send a quality verification request for the target resource to the quality verification system, so that the quality verification system responds to the quality verification request, performs quality verification on the target resource, and obtains the quality verification result; Obtain the quality verification result and return the quality verification result to the second system.
3. The method according to claim 2, characterized in that, The method further includes: Based on the quality verification results, a quality verification identifier is generated; The quality verification identifier is associated with the resource identifier corresponding to the target resource and stored in the target database.
4. The method according to claim 1, characterized in that, The method further includes: Generate first log information, which is information recorded when executing the first target step and the steps prior to executing the first target step. The first target step is to store the resource identifier of the resource in the target database. The first log information is stored in the target database.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: The updated resource identifier is obtained from the first system. The updated resource identifier is the resource identifier of the restored resource generated by the first system based on the resource identifier generation template when the resource is restored and the restored resource is obtained. The updated resource identifier is overwritten with the resource identifier of the resource in the target database; The action information is sent to the second system, and the action information represents the action of overwriting the resource identifier of the resource in the target database with the updated resource identifier.
6. The method according to claim 5, characterized in that, The method further includes: Generate second log information, which is information recorded when executing the second objective step and the third objective step. The second objective step is to obtain the updated resource identifier from the first system, and the third objective step is to overwrite the resource identifier of the resource in the target database with the updated resource identifier. The second log information is stored in the target database.
7. The method according to claim 1, characterized in that, The step of returning a first target result to the second system when it is determined that a resource identifier corresponding to the target resource exists in the target database includes: In response to a query request for a target resource sent by the second system, the system searches for a resource identifier corresponding to the target resource in the target database. If found, the first target result is returned to the second system; Alternatively, if an operation to store the resource identifier of the target resource in the target database is intercepted, the first target result is returned to the second system.
8. A system interaction method, characterized in that, The first system applied to Hadoop-based systems includes the following methods: Once it is determined that the resource is in an available state, a resource identifier generation request is sent to the setting platform system, so that the setting platform system responds to the resource identifier generation request and sends a pre-set resource identifier generation template to the first system; Based on the resource identifier generation template, generate the resource identifier for the resource; The resource identifier of the resource is sent to the setting platform system, so that the setting platform system can obtain the resource identifier of the resource and store it in the cache, retrieve the resource identifier of the resource from the cache and store it in the target database, and if it is determined that there is a resource identifier corresponding to the target resource in the target database, return a first target result to the second system; the first target result is used to indicate that the target resource is available, the target resource is a resource in the first system that has an association with the second system, and the result of task execution in the first system is used as the input data of the task in the second system.
9. A system interaction device, characterized in that, include: The first sending module is used to respond to a resource identifier generation request sent by the first system in the Hadoop-based system when the resource is in an available state, and to send a pre-set resource identifier generation template to the first system so that the first system generates a resource identifier for the resource based on the resource identifier generation template. The first storage module is used to obtain the resource identifier of the resource and store it in the cache, and to obtain the resource identifier of the resource from the cache and store it in the target database; The first return module is used to return a first target result to the second system when it is determined that there is a resource identifier corresponding to the target resource in the target database. The first target result is used to indicate that the target resource is available. The target resource is a resource that has an association relationship with the second system. The result of task execution in the first system is used as the input data of the task in the second system.
10. A system interaction device, characterized in that, include: The request sending module is used to send a resource identifier generation request to the designated platform system when it is determined that the resource is in an available state, so that the designated platform system responds to the resource identifier generation request and sends a pre-set resource identifier generation template to the first system in the Hadoop-based system. The resource identifier generation module is used to generate a resource identifier for the resource based on the resource identifier generation template. The identifier sending module is used to send the resource identifier of the resource to the setting platform system, so that the setting platform system can obtain the resource identifier of the resource and store it in the cache, obtain the resource identifier of the resource from the cache and store it in the target database, and if it is determined that there is a resource identifier corresponding to the target resource in the target database, return the first target result to the second system. The first target result is used to indicate that the target resource is available. The target resource is a resource in the first system that is associated with the second system. The result of task execution in the first system is used as input data for tasks in the second system.