Resource issuing method and device, electronic equipment and storage medium
By providing the recipient with a resource acquisition strategy of primary address and backup address, it solves the problem of differences in resource delivery between different platforms, improves versatility and security, and ensures the accessibility of resources under a single domain name ban.
Patent Information
- Application Number
- CN202310477207.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2024-10-29
AI Technical Summary
Existing resource delivery methods differ between different platforms and are less versatile, making it difficult to ensure the accessibility and security of resources, especially when a single domain name is banned.
By determining the resource acquisition address based on the device identification of the recipient, providing the primary address and backup address, ensuring that the backup address is available when the primary address fails, and sending the acquisition address to the recipient to improve versatility and security.
It improves the versatility and security of resource distribution, ensures resource accessibility when a single domain name is blocked, and ensures reliable acquisition of resources.
Smart Images

Figure CN118869809A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for delivering resources. Background Art
[0002] Currently, accessible cloud tags have been connected to different platforms. The implementation of accessible cloud tags requires the distribution of various resources required by the platform from the cloud, such as the software development kit (SDK) of each platform, label annotation and other resources.
[0003] In response to the resource requirements of different platforms, there are certain differences in the existing resource distribution methods, and their universality is poor. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for delivering resources, so as to improve the versatility of delivering resources.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for delivering resources, including:
[0006] Determine the resources to be issued for the target function;
[0007] Determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails;
[0008] The resource acquisition address is sent to the recipient.
[0009] In a second aspect, the embodiment of the present disclosure further provides a resource delivery device, including:
[0010] A first determination module is used to determine the resources to be issued for the target function;
[0011] A second determination module is used to determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails;
[0012] A sending module is used to send the resource acquisition address to the receiving party.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
[0014] one or more processors;
[0015] a memory for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the resource delivery method as described in the embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method for delivering resources as described in the embodiment of the present disclosure is implemented.
[0018] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for sending resources, the method comprising: determining the resources to be sent for the target function; determining the resource acquisition address of the resources to be sent according to the device identification of the recipient, the resource acquisition address including a primary address and a backup address, the backup address being used for the recipient to obtain the resources to be sent when the primary address fails; sending the resource acquisition address to the recipient. Utilizing the above technical solution, by determining the resource acquisition address of the resources to be sent according to the device identification of the recipient, different recipients can obtain resources, thereby improving the versatility of resource sending; by sending the resource acquisition address containing both the primary address and the backup address to the recipient, the accessibility of resources under a single domain name ban can be guaranteed, and the security of resource sending is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A schematic diagram of a flow chart of a method for issuing resources provided in an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of a rollback process provided by an embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of a process of publishing resources to be published for a target function provided in an embodiment of the present disclosure;
[0023] Figure 4 A flowchart of another resource delivery method provided in an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of resource information provided by an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of a resource distribution process provided by an embodiment of the present disclosure;
[0026] Figure 7 A system architecture diagram of a resource delivery method provided in an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of the structure of a resource delivery device provided in an embodiment of the present disclosure;
[0028] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0036] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0037] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0039] Figure 1 A flow chart of a resource distribution method provided in an embodiment of the present disclosure, the method can be applicable to the situation of distributing resources to different platforms, the method can be executed by a resource distribution device, wherein the device can be implemented by software and / or hardware and is generally integrated on an electronic device. In this embodiment, the electronic device includes but is not limited to: computers, mobile phones, tablet computers and other devices.
[0040] like Figure 1 As shown, a method for delivering resources provided by an embodiment of the present disclosure includes the following steps:
[0041] S110: Determine the resources to be issued for the target function.
[0042] The specific content of the target function is not limited. For example, the target function may be a function corresponding to a preset business, which is pre-set by the configuration personnel. The resources to be sent may include configuration information of the target function and / or an SDK for configuration. Exemplarily, the target function may be an accessibility function, and the resources to be sent may include accessibility configuration information and / or an SDK for accessibility attribute configuration.
[0043] This step can first determine the resources to be sent for the target function, and then perform the subsequent step of sending the resource acquisition address after the resources to be sent are determined. There is no limit to the way of determining the resources to be sent. For example, different target functions can correspond to different ways of determining the resources to be sent. You can also first obtain the resource information of the latest full resources and / or the latest grayscale resources corresponding to the target function, and determine the resources to be sent based on the obtained resource information.
[0044] It should be noted that there is no limitation on the timing of determining the resources to be issued. For example, it can be executed when a resource update request is received, or the resources to be issued can be determined when a resource rollback request is received. The resource update request and the resource rollback request can be actively triggered by relevant personnel to generate. The resource update request can refer to a request for resource update, and the resource rollback request can refer to a request to roll back the resource to the last effective version.
[0045] S120. Determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to acquire the resource to be delivered when the primary address fails.
[0046] The receiver can be understood as the object that receives the resources. The type of receiver is not limited. For example, the receiver can be a web page, lynx or client, etc. The device identifier is the identifier of the device used by the receiver. The resource acquisition address is used to represent the address for obtaining the resources to be sent. For example, the resource acquisition address can include a primary address and a backup address. The primary address can be considered as the address that is preferentially selected when obtaining the resources to be sent. The backup address can refer to the backup address for obtaining the resources to be sent, which is used for the receiver to obtain the resources to be sent when the primary address fails.
[0047] In order to reduce the risk of domain name unavailability, after the resources to be delivered are determined, the resource acquisition address of the resources to be delivered can be determined according to the device identification of the recipient. The resource acquisition address can include a primary address and a backup address, so that the recipient can obtain the resources to be delivered based on the resource acquisition address. The process of determining the resource acquisition address can, for example, be to select a suitable content delivery network (Content Delivery Network, CDN) address as the resource acquisition address of the resources to be delivered according to the device identification of the recipient and the name of the resource to be delivered, or to directly generate the resource acquisition address of the resources to be delivered according to the device identification of the recipient, which is not limited in this embodiment.
[0048] In one embodiment, determining the resource acquisition address of the resource to be delivered according to the device identification of the recipient includes:
[0049] Determine a primary domain name index and a backup domain name index according to the device identifier of the receiver;
[0050] Acquire a primary domain name corresponding to the primary domain name index and a backup domain name corresponding to the backup domain name index;
[0051] The primary address is generated based on the primary domain name, and the backup address is generated based on the backup domain name.
[0052] The primary domain name index may refer to an index representing the primary domain name, and the backup domain name index may refer to an index representing the backup domain name.
[0053] The primary domain name may refer to a preferred location identifier for a device when resources are sent down, and the backup domain name may refer to a backup location identifier for a device when resources are sent down. Since IP addresses are not easy to remember and cannot display the name and nature of address organizations, domain names and IP addresses can be mapped to each other through the Domain Name System (DNS) to facilitate Internet access. In this embodiment, both the primary domain name and the backup domain name are valid domain names, not invalid domain names.
[0054] Specifically, in the process of determining the resource acquisition address, the primary domain name index and the backup domain name index can be determined first. For example, when sending resources, the primary domain name index and the backup domain name index can be calculated based on the device identifier of the recipient to determine the primary and backup domain name indexes. Then, based on the correspondence between the index and the domain name, the primary domain name corresponding to the primary domain name index and the backup domain name corresponding to the backup domain name index are obtained, and the primary address is generated based on the primary domain name, and the backup address is generated based on the backup domain name, so as to configure all selectable CDN addresses. Among them, the method of generating the primary address and the backup address is not limited, such as assembling them according to the set rules to generate the corresponding CDN address.
[0055] S130: Send the resource acquisition address to the recipient.
[0056] After the resource acquisition address of the resource to be delivered is determined based on the above steps, the resource acquisition address may be sent to the receiver, so that the receiver can acquire the required resource to be delivered based on the resource acquisition address.
[0057] Furthermore, resource information can also be sent to the receiver, so that after receiving the resource information, the receiver first determines whether it needs to be updated according to the resource information. If it needs to be updated, the receiver obtains the resource to be issued according to the primary address in the resource acquisition address, or obtains the resource to be issued according to the backup address when the primary address fails; if it does not need to be updated, it means that the resource information is consistent with the current resource information and does not need to be updated. At this time, the receiver can ignore the resource acquisition address or keep the resource acquisition address as a backup. Resource information can include information related to the resource, such as resource information including resource version information, and can also include other information in addition to resource version information. Resource version information can be used to characterize the version of the resource, such as version number or version name.
[0058] In one embodiment, after sending the resource acquisition address to the recipient, the method further includes:
[0059] When a resource rollback request is received, the resource state of the resource to be delivered is modified to a second invalid state, and the resource to be delivered is rolled back.
[0060] The second failure state may be used to indicate that the resource to be delivered has failed. For example, the second failure state may be a rolled back state.
[0061] It can be considered that after the resource acquisition address is sent to the recipient, the recipient can update the current resource information or maintain the current resource information based on the resource acquisition address, and when there is a problem with the current resource information, the operator or developer can trigger a resource rollback request to the server to enable the server to reload the resources to be sent.
[0062] In one embodiment, when a resource rollback request is received, the resource state of the resource to be sent can be modified to the second invalid state, and the resource to be sent can be rolled back. The rollback process can be determined according to the type of the receiver, or according to the current running state of the receiver. Exemplarily, if the receiver is not a client, or the receiver is a client but the client is not in running state, then when a resource update request is further received, the steps of determining the resource to be sent and the resource acquisition address of the resource to be sent can be returned to achieve the purpose of rollback when responding to the resource update request.
[0063] Furthermore, after the resource status of the to-be-delivered resource is modified to the second invalid status, the to-be-delivered resource in the cache may be further cleared.
[0064] In one embodiment, the rolling back of the to-be-delivered resources includes:
[0065] If the recipient is a client and the client is in a running state, returning to the operation of performing the determination of the resource to be sent of the target function, so as to re-determine the resource to be sent and the resource acquisition address of the resource to be sent;
[0066] The sending the resource acquisition address to the recipient includes:
[0067] Sending update information carrying the re-determined resource acquisition address to the recipient.
[0068] In one embodiment, when a resource rollback request is received, if the recipient is a client and the client is in operation, it can directly return to the operation of determining the resources to be sent for the target function, so as to redetermine the resources to be sent and the resource acquisition address of the resources to be sent, and send update information carrying the redetermined resource acquisition address to the recipient.
[0069] Figure 2 A schematic diagram of a rollback process provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the rollback process of resources can be implemented in real time by combining push and pull. Specifically, after the operator or developer calls the resource rollback interface, the resource distribution service can first obtain the resource information to be rolled back (i.e., the resource to be sent) according to the application ID and resource version, modify the resource status to be rolled back (i.e., modify the resource status of the resource to be sent to the second invalid state), and clean up the resources in the cache. For web / lynx resources, after the rollback, the user actively refreshes the page to reload the resources (i.e., when receiving a resource update request, return to execute the steps of determining the resource to be sent and the resource acquisition address of the resource to be sent). For client resources, the client will cache the resources loaded this time when loading, and each request will verify whether the resource information of the currently sent resource is consistent with the locally cached resource information, such as verifying whether the version number of the currently sent resource is consistent with the cached version number. If they are inconsistent, new resources will be loaded, otherwise no resources will be requested. For the scenario in client use, ByteSync pushes update messages (i.e., sends update information carrying the re-determined resource acquisition address to the recipient). After receiving the update message, the client can also verify whether the version number in the cache is consistent with the received message version number. If they are inconsistent, the resource is pulled again.
[0070] The disclosed embodiment provides a method for sending resources, which determines the resources to be sent for the target function; determines the resource acquisition address of the resources to be sent according to the device identification of the recipient, the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resources to be sent when the primary address fails; and sends the resource acquisition address to the recipient. Utilizing this method, by determining the resource acquisition address of the resources to be sent according to the device identification of the recipient, different recipients can obtain resources, thereby improving the versatility of resource sending; by sending the resource acquisition address that includes both the primary address and the backup address to the recipient, the accessibility of resources under a single domain name ban can be guaranteed, and the security of resource sending is guaranteed.
[0071] In one embodiment, the method further comprises:
[0072] Release the resources to be released of the target function, where the resources to be released are full resources or grayscale resources.
[0073] The resources to be released may be resources that are about to be released. For example, the resources to be released may be full resources or grayscale resources. Full resources may refer to resources that are fully released, and grayscale resources may refer to resources in grayscale.
[0074] In one implementation, the to-be-published resources of the target function may be published, such as uploaded to a source library of a server, to achieve storage and backup of the resources.
[0075] In one embodiment, the resources to be published for publishing the target function include:
[0076] Acquire the original resource to be published from a data source corresponding to the resource type of the resource to be published;
[0077] Parsing the original resource to obtain the resource to be published;
[0078] The resource to be released is released, and a resource release record of the resource to be released is generated, wherein the resource release record includes resource information of the resource to be released.
[0079] Among them, the original resources can be understood as the original data stored in each data source, and the data source may include SCM, MySQL, TOS, etc.; the resource type of the resource to be released can be considered as the type of the recipient to which the resource to be released is applied, such as the resource type can be web, lynx or client, etc.; the resource release record is used to record the information of resource release, such as the resource release record may include the resource information of the resource to be released, and may also include the name of the resource to be released, etc.
[0080] In one embodiment, the resource to be released is a grayscale resource, and the resource release record further includes a second grayscale strategy for the resource to be released.
[0081] When the resource to be released is a grayscale resource, the resource release record may further include a second grayscale strategy for the resource to be released. The second grayscale strategy may include, for example, how to determine grayscale users and the proportion of grayscale users.
[0082] Specifically, first, the original resource to be released can be obtained from the data source corresponding to the resource type of the resource to be released. For example, the original resource produced in the background can be obtained from multiple data sources such as SCM, MySQL, TOS, etc. according to the resource type; after obtaining the original resource, the original resource can be parsed according to the preset parsing rules to obtain the resource to be released. For example, the original resource can be decompressed before parsing the original resource, and then the decompressed original resource can be parsed according to the preset parsing rules to parse out the corresponding resource content, and the parsed resource content can be repackaged to obtain the resource to be released, wherein the preset parsing rules can correspond to the type of the receiver, such as the preset parsing rules can include how to parse and package, and the location to be released. Finally, the resource to be released can be released, and a resource release record of the resource to be released can be generated.
[0083] In one embodiment, after publishing the to-be-published resource, the method further includes:
[0084] Performing validity detection on the resources to be released;
[0085] When it is detected that there is an invalid domain name among the domain names corresponding to the resources to be released, marking the invalid domain name;
[0086] When it is detected that the resource to be released is invalid, the resource state of the resource to be released is modified to a first invalid state.
[0087] The first failure state may be used to indicate that the resource to be released has failed. For example, the first failure state may be a disabled state.
[0088] In one embodiment, after the resources to be released are released, the validity check of the resources to be released may also be performed. The content of the validity check may include, for example, whether the content can be accessed normally, whether the content is in a set format, and / or whether there are invalid domain names in the domain names corresponding to the resources to be released, etc. For example, when it is detected that there are invalid domain names in the domain names corresponding to the resources to be released, the invalid domain names may be marked to filter out the invalid domain names when the primary domain name and the backup domain name are subsequently determined; and when it is detected that the resources to be released are invalid, the resource status of the resources to be released may be modified to a first invalid status to automatically take the resources to be released offline.
[0089] It should be noted that there is no limitation on the timing of executing the above-mentioned validity check step for the resources to be released. For example, the validity check can be performed when the release of the resources to be released is completed, or it can be performed at a scheduled time after the release of the resources to be released. At the same time, the invalid domain names corresponding to different execution times are different. For example, when the release of the resources to be released is completed, it is detected that there is an invalid domain name in the domain name corresponding to the resources to be released. At this time, the invalid domain name is the domain name of the source library to which it is released; and when it is detected at a scheduled time that there is an invalid domain name in the domain name corresponding to the resources to be released, the invalid domain name is the domain name of the corresponding node, that is, the domain name of the CDN node.
[0090] Figure 3 A schematic diagram of a process of publishing resources to be published for a target function provided by an embodiment of the present disclosure, such as Figure 3 As shown, the process of publishing resources can be executed by modules such as pulling resource information, decompressing resources, packaging resources on different ends, and detecting resources. Specifically, first, the unified resource pulling interface can obtain various resources produced by the management background from various data sources such as SCM, MySQL, TOS, etc. according to the resource type (that is, obtaining the original resources to be published from the data source corresponding to the resource type of the resource to be published), and the resource decompression module decompresses them and parses the corresponding resource content according to the platform parsing rules. The resource packaging module repackages and uploads the parsed resources (that is, parses the original resources to obtain the resources to be published; publishes the resources to be published), and generates a resource publishing record, which may include resource version information, resource name, and grayscale strategy (that is, generates a resource publishing record of the resource to be published, and the resource publishing record includes resource information of the resource to be published). After the upload is completed, the scheduled task of the resource detection module starts to detect whether the resource is valid (that is, after the resource to be released is released, it also includes: performing validity detection on the resource to be released), and the failed domain name will be written into the invalidation queue, and the domain name will be filtered during CDN scheduling (that is, when it is detected that there is an invalid domain name in the domain name corresponding to the resource to be released, the invalid domain name is marked); at the same time, if the file is detected to be invalid, the resource will be automatically offline (that is, when it is detected that the resource to be released is invalid, the resource status of the resource to be released is modified to the first invalidation status).
[0091] Figure 4A flow chart of another resource distribution method provided for an embodiment of the present disclosure. The scheme in this embodiment can be combined with one or more optional schemes in the above-mentioned embodiments. Optionally, the determination of the resources to be distributed for the target function includes: obtaining first resource information and second resource information corresponding to the target function, the first resource information being the resource information of the target full resources, the target full resources being the latest effective full resources, and the second resource information being the resource information of the target grayscale resources, the target grayscale resources being the latest effective grayscale resources; if the second resource information is successfully obtained and the recipient meets the preset grayscale condition, the target grayscale resource is determined as the resource to be distributed for the target function; otherwise, the target full resources are determined as the resource to be distributed for the target function.
[0092] like Figure 4 As shown, a method for delivering resources provided by an embodiment of the present disclosure includes the following steps:
[0093] S210. Obtain first resource information and second resource information corresponding to the target function, wherein the first resource information is resource information of the target full resources, and the target full resources are the latest effective full resources; the second resource information is resource information of the target grayscale resources, and the target grayscale resources are the latest effective grayscale resources.
[0094] Among them, the first resource information can be the resource information of the target full resources, and the target full resources are the latest effective full resources, such as the latest released full resources that are not marked as invalid; the second resource information can be the resource information of the target grayscale resources, and the target grayscale resources are the latest effective grayscale resources, such as the latest released grayscale resources that are not marked as invalid.
[0095] In this embodiment, the first resource information and the second resource information corresponding to the target function may be obtained first, and then the final resource to be issued may be determined according to the obtained situation. The specific process of obtaining the first resource information and the second resource information is not limited here, such as obtaining according to a preset search strategy, or corresponding to different obtaining processes according to different types of receivers, as long as the first resource information and the second resource information can be obtained.
[0096] In one embodiment, the acquiring of the first resource information and the second resource information corresponding to the target function includes:
[0097] For each type of resource, the client information of the recipient is used as the current client information, and the resource is the target full resource or the target grayscale resource;
[0098] Obtain the latest resource information corresponding to the current client information;
[0099] If the acquisition is successful, the acquired resource information is used as the resource information of the resource;
[0100] If the acquisition fails, the previous client information of the current client information is used as the current client information, and the operation of acquiring the latest effective resource information corresponding to the current client information is returned to be executed until there is no previous client information or the resource information is successfully acquired.
[0101] The current client information can be considered as the current client information of the receiver, and the previous client information can be considered as the client information before and adjacent to the current client information. The client information can include relevant information of the client, such as the version number or version name of the client.
[0102] Exemplarily, when the type of the receiver is a client, the client information of the receiver can be used as the current client information for different resources, such as target full resources or target grayscale resources, and then the resource information corresponding to the current client information and the most recent effective time is obtained, and the resource information of the resource, that is, the first resource information or the second resource information, is determined based on the acquisition result. For example, when the acquisition is successful, it means that the resource information corresponding to the current client information is in a valid state. At this time, the acquired resource information can be used as the resource information of the resource; when the acquisition fails, it means that the resource information corresponding to the current client information is not in a valid state or there is no resource information corresponding to the current client information. At this time, the previous client information of the current client information can be used as the current client information, and the operation of obtaining the resource information corresponding to the current client information and the most recent effective time is repeated until the previous client information does not exist or the resource information is successfully acquired.
[0103] Figure 5 A schematic diagram of resource information provided by an embodiment of the present disclosure, such as Figure 5 As shown, when the type of the receiver is a client, the resource information needs to be bound to the client information and iterated based on the latest resource of the current client information or the previous client information. For example, when obtaining the resource information of the latest effective full resource, the search strategy is to first find the latest resource corresponding to the current client information (that is, obtain the resource information corresponding to the current client information and the latest effective. If the acquisition is successful, the obtained resource information is used as the resource information of the resource). If it does not exist, return to obtain the latest resource of the previous client information (that is, if the acquisition fails, the previous client information of the current client information is used as the current client information, and return to execute the operation of obtaining the resource information corresponding to the current client information and the latest effective, until the previous client information does not exist or the resource information is successfully acquired).
[0104] like Figure 5 , take the resource information as the resource version information and the client information as the client version number as an example for explanation. Assuming the client version number is 1.0.2 and the resource version information is v2, during iteration, if you want to release the resource version information with the client version number of 1.0.3, you need to modify it based on the v2 resource version information to release the latest resource version information v3. At this time, if you release the resource with the client version number of 1.0.2 again, you need to modify it based on v2 to release the resource version information v4. Similarly, when releasing a resource with a client version number of 1.0.5, you need to release the latest resource version information v8 based on the resource version information v7 of 1.0.4.
[0105] Furthermore, when searching for resource version information according to the client version number, assuming that the client version number to be issued is 1.0.4, the search order can be v7, v6, v5, v3, v4, v2, v1.
[0106] S220. Determine whether the second resource information is successfully acquired and whether the recipient meets a preset grayscale condition. If so, execute step S230; otherwise, execute step S240.
[0107] The preset grayscale condition may be a pre-set grayscale condition used to determine the resources to be issued. The specific content may be determined by the configuration personnel according to the actual situation. For example, the preset grayscale condition may be that the grayscale identifier is greater than a preset value.
[0108] It can be considered that after executing the steps of obtaining the first resource information and the second resource information corresponding to the target function, the first resource information and the second resource information can be obtained, or only the first resource information can be obtained. Therefore, in this step, it can be further judged whether the second resource information is successfully obtained and whether the recipient meets the preset grayscale conditions, and different resources to be sent are determined according to the judgment results.
[0109] In one embodiment, after acquiring the first resource information and the second resource information corresponding to the target function, the method further includes:
[0110] Calculating the grayscale identification of the receiver using a first grayscale strategy corresponding to the second resource information;
[0111] If the second resource information is successfully acquired and the recipient satisfies a preset grayscale condition, determining the target grayscale resource as a to-be-delivered resource of a target function includes:
[0112] If the second resource information is successfully acquired and the grayscale identifier meets a preset grayscale condition, the target grayscale resource is determined as a resource to be issued for the target function.
[0113] Among them, the first grayscale strategy may include a calculation method for the grayscale identifier. The calculation method may, for example, be which parameters are used to calculate the grayscale identifier using which operation method. The parameters may include the device information of the recipient and the resource identifier of the grayscale resource. The device information may include the device identifier or device location information. The device location information is used to characterize the location of the device used by the recipient. The first grayscale strategy may also include preset grayscale conditions, etc.
[0114] In one embodiment, after obtaining the first resource information and the second resource information corresponding to the target function, the first grayscale strategy corresponding to the second resource information can be used to calculate the grayscale identifier of the recipient, and the calculated grayscale identifier can be used to determine whether the recipient meets the preset grayscale conditions. For example, when the second resource information is successfully obtained and the grayscale identifier meets the preset grayscale conditions, it means that the second resource information exists and the recipient meets the expected conditions, then step S230 can be executed, that is, the target grayscale resource is determined as the resource to be sent for the target function; otherwise, if the second resource information fails to be obtained and / or the grayscale identifier does not meet the preset grayscale conditions, then step S240 can be executed, that is, the target full resources are determined as the resource to be sent for the target function.
[0115] S230: Determine the target grayscale resource as a resource to be issued for a target function.
[0116] S240: Determine the target full amount of resources as the resources to be issued for the target function.
[0117] Figure 6 A schematic diagram of a resource delivery process provided by an embodiment of the present disclosure, such as Figure 6 As shown, the resource delivery process may include a delivery module, a grayscale module, and a CND address scheduling module. Specifically, the delivery module may first obtain the two latest effective resource information, one of which is a fully released resource, and the other may be a resource in the grayscale (i.e., obtaining the first resource information and the second resource information corresponding to the target function, the first resource information is the resource information of the target full resource, the target full resource is the latest effective full resource, the second resource information is the resource information of the target grayscale resource, the target grayscale resource is the latest effective grayscale resource), the two resources found need to be strictly guaranteed to be in order, the latest released resources are ranked in front, and the grayscale resource priority is guaranteed. The delivery module includes a three-level cache, which first searches from the local Local cache, searches from Redis if not found, and finally returns to Mysql.
[0118] If the two resources found contain grayscale resources, the grayscale module starts to parse the grayscale strategy of the grayscale resource, and then calculates the grayscale ID according to the grayscale strategy. The grayscale ID can be calculated based on the resource ID and the device ID (that is, the first grayscale strategy corresponding to the second resource information is used to calculate the grayscale identification of the receiver). Since the device ID generation rules of each platform are different, in order to achieve the purpose of random allocation, the calculation of the grayscale ID can be, for example: Wherein, deviceId can be the device ID, resourceId can be the resource ID, m is the length of the device ID, and n is the length of the resource ID. Set the grayscale ratio of user devices to 10%. After obtaining the grayscale ID, if the grayscale ID is less than 10%, issue this grayscale resource (i.e., if the second resource information is successfully obtained and the grayscale identifier meets the preset grayscale condition, the target grayscale resource is determined as the resource to be issued for the target function). Otherwise, issue another full resource (i.e., determine the target full resource as the resource to be issued for the target function).
[0119] After obtaining the resource, in order to reduce the risk of domain name unavailability, the CDN address scheduling module will select a suitable CDN address according to the resource name and device ID. For example, all selectable CDN addresses are configured, and the primary and backup domain name indexes are first calculated (i.e., the primary domain name index and backup domain name index are determined according to the device identification of the receiver). The primary domain name index can be The backup domain name index can be backupIndex=(index+1)modm, and then the primary and backup CDN addresses are determined according to the primary and backup domain name indexes (i.e., the resource acquisition address of the resource to be sent is determined according to the device identification of the recipient, and the resource acquisition address includes the primary address and the backup address, and the backup address is used for the recipient to obtain the resource to be sent when the primary address fails). Finally, the encapsulated resource is returned, and the returned content includes the resource version, the primary CDN address and the backup CDN address (i.e., the resource acquisition address is sent to the recipient).
[0120] S250. Determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to acquire the resource to be delivered when the primary address fails.
[0121] S260: Send the resource acquisition address to the recipient.
[0122] The embodiment of the present disclosure provides a method for sending resources, which obtains first resource information and second resource information corresponding to a target function, wherein the first resource information is the resource information of the target full resource, and the target full resource is the latest effective full resource, and the second resource information is the resource information of the target grayscale resource, and the target grayscale resource is the latest effective grayscale resource; if the second resource information is successfully obtained and the receiver meets the preset grayscale condition, the target grayscale resource is determined as the resource to be sent for the target function; otherwise, the target full resource is determined as the resource to be sent for the target function; the resource acquisition address of the resource to be sent is determined according to the device identification of the receiver, and the resource acquisition address includes a primary address and a backup address, and the backup address is used for the receiver to obtain the resource to be sent when the primary address fails; and the resource acquisition address is sent to the receiver. By using this method, by obtaining the first resource information and the second resource information corresponding to the target function, and judging whether the second resource information is successfully obtained and the receiver meets the preset grayscale condition, the resource to be sent for the target function can be further determined, thereby improving the accuracy of resource sending.
[0123] Figure 7 A system architecture diagram of a resource delivery method provided by an embodiment of the present disclosure, such as Figure 7 As shown in the figure, the resource delivery service involves the cooperation of multiple modules, such as C-end, management background, service capabilities, service dependencies and security policies. The C-end is used to indicate the type of recipient, including Web, Lynx, Android and IOS. The management background involves resource publishing and resource approval. Service capabilities include resource pulling, grayscale strategy, resource detection, etc. Service dependencies include TOS file storage, CDN resources, data storage (MySQL, Redis) and ByteSync data synchronization components. Security policies are used to ensure the security of resource delivery.
[0124] It can be seen that the resource delivery method provided by the embodiment of the present disclosure can be used for the delivery of barrier-free resources, including a resource multi-source delivery process, a resource dynamic delivery process, a resource real-time rollback process, and resource multi-version management. Among them, since barrier-free resources include SDK resources packaged by SCM construction, and cloud tag resources directly stored in MySQL, this embodiment designs a resource multi-source delivery process, extracts resources from multiple data sources, and packages them into a unified CDN address. After delivery, the client can obtain specific resources by accessing the CDN.
[0125] After the resources are successfully released, in order to improve the security of the release process and meet the compatibility issues of various client versions, this embodiment designs a dynamic resource delivery process, that is, grayscale delivery is performed according to grayscale strategies, terminal versions and other delivery rules, to achieve smooth release. If an error occurs in the resources that have been delivered or an abnormality occurs in the resources in grayscale, the resource rollback process can be used to safely and in real time roll back to the last effective version. In addition, for multi-version clients, appropriate cloud tags can be delivered according to the client version, and automatic rollback of versions is supported, thereby solving the compatibility problem of multiple versions.
[0126] In order to solve the problem of CDN domain name failure during the delivery process, this embodiment designs a solution for CDN dynamic scheduling and switching between primary and backup domain names. Multiple domain names are configured through TCC, and available domain names are dynamically delivered according to the domain name detection situation during delivery, thus ensuring the availability under the ban of a single domain name. For example, when delivering domain names, both the primary domain name and the backup domain name are delivered at the same time. If the primary domain name is unavailable during access, it can be automatically switched to the backup domain name, further improving the accessibility of resources.
[0127] In summary, the resource distribution method provided by the embodiment of the present disclosure can provide multiple terminals such as web, lynx, android, ios, and pc for use by configuring resources at the same time, greatly reducing the manpower cost required for cross-terminal app development and testing barrier-free adaptation. In addition, resource acquisition mainly relies on CDN, which can greatly improve the latency and availability of resource acquisition, and the distribution process can ensure the security of resource distribution, providing the ability to withdraw resources.
[0128] Figure 8 A schematic diagram of the structure of a resource delivery device provided in an embodiment of the present disclosure, the device can be applicable to situations where resources are delivered to different platforms, wherein the device can be implemented by software and / or hardware and is generally integrated on an electronic device.
[0129] like Figure 8 As shown, the device comprises:
[0130] A first determination module 310 is used to determine the resources to be issued for the target function;
[0131] A second determination module 320 is used to determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails;
[0132] The sending module 330 is used to send the resource acquisition address to the recipient.
[0133] The disclosed embodiment provides a resource sending device, which determines the to-be-sent resource of the target function through a first determination module; determines the resource acquisition address of the to-be-sent resource according to the device identification of the recipient through a second determination module, the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the to-be-sent resource when the primary address fails; and sends the resource acquisition address to the recipient through a sending module. With this device, by determining the resource acquisition address of the to-be-sent resource according to the device identification of the recipient, different recipients can obtain resources, thereby improving the versatility of resource sending; by sending the resource acquisition address containing both the primary address and the backup address to the recipient, the accessibility of resources under a single domain name ban can be guaranteed, and the security of resource sending is ensured.
[0134] Optionally, the first determining module 310 includes:
[0135] A first acquisition unit is used to acquire first resource information and second resource information corresponding to a target function, wherein the first resource information is resource information of a target full resource, and the target full resource is the latest effective full resource; and the second resource information is resource information of a target grayscale resource, and the target grayscale resource is the latest effective grayscale resource;
[0136] A first determining unit, configured to determine the target grayscale resource as a resource to be issued for a target function if the second resource information is successfully acquired and the recipient satisfies a preset grayscale condition;
[0137] The second determining unit is used to determine the target full amount of resources as the resources to be issued for the target function.
[0138] Optionally, the first acquiring unit is specifically used for:
[0139] For each type of resource, the client information of the recipient is used as the current client information, and the resource is the target full resource or the target grayscale resource;
[0140] Obtain the latest resource information corresponding to the current client information;
[0141] If the acquisition is successful, the acquired resource information is used as the resource information of the resource;
[0142] If the acquisition fails, the previous client information of the current client information is used as the current client information, and the operation of acquiring the latest effective resource information corresponding to the current client information is returned to be executed until there is no previous client information or the resource information is successfully acquired.
[0143] Optionally, the first determining module 310 further includes:
[0144] an adopting unit, configured to calculate the grayscale identification of the receiver by adopting a first grayscale strategy corresponding to the second resource information after acquiring the first resource information and the second resource information corresponding to the target function;
[0145] The first determining unit is specifically configured to:
[0146] If the second resource information is successfully acquired and the grayscale identifier meets a preset grayscale condition, the target grayscale resource is determined as a resource to be issued for the target function.
[0147] Optionally, the second determining module 320 is specifically configured to:
[0148] Determine a primary domain name index and a backup domain name index according to the device identifier of the receiver;
[0149] Acquire a primary domain name corresponding to the primary domain name index and a backup domain name corresponding to the backup domain name index;
[0150] The primary address is generated based on the primary domain name, and the backup address is generated based on the backup domain name.
[0151] Optionally, a resource publishing device provided by an embodiment of the present disclosure further includes:
[0152] The publishing module is used to publish the to-be-published resources of the target function, where the to-be-published resources are full resources or grayscale resources.
[0153] Optionally, the publishing module includes:
[0154] A second acquisition unit, configured to acquire the original resource to be published from a data source corresponding to the resource type of the resource to be published;
[0155] A parsing unit, used for parsing the original resource to obtain the resource to be published;
[0156] The publishing unit is used to publish the resource to be published and generate a resource publishing record of the resource to be published, wherein the resource publishing record includes resource information of the resource to be published.
[0157] Optionally, the resource to be released is a grayscale resource, and the resource release record further includes a second grayscale strategy for the resource to be released.
[0158] Optionally, the publishing module further includes:
[0159] A detection unit, configured to perform validity detection on the resource to be released after the resource to be released is released;
[0160] a marking unit, configured to mark an invalid domain name when detecting that there is an invalid domain name among the domain names corresponding to the resources to be published after the resources to be published are published;
[0161] The modification unit is used for modifying the resource state of the resource to be released to a first invalid state after the resource to be released is released when it is detected that the resource to be released is invalid.
[0162] Optionally, a resource publishing device provided by an embodiment of the present disclosure further includes:
[0163] The modification module is used to modify the resource state of the resource to be sent to a second invalid state and roll back the resource to be sent when a resource rollback request is received after the resource acquisition address is sent to the recipient.
[0164] Optionally, the modification module is specifically used for:
[0165] If the recipient is a client and the client is in a running state, returning to the operation of performing the determination of the resource to be sent of the target function, so as to re-determine the resource to be sent and the resource acquisition address of the resource to be sent;
[0166] The sending the resource acquisition address to the recipient includes:
[0167] Sending update information carrying the re-determined resource acquisition address to the recipient.
[0168] The above-mentioned resource sending device can execute the resource sending method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0169] Reference below Fig. 9 , which shows a schematic diagram of the structure of an electronic device (e.g., terminal device) 400 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0170] like Fig. 9As shown, the electronic device 400 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processor 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0171] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0172] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 409, or installed from a storage device 408, or installed from a ROM 402. When the computer program is executed by the processor 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0173] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0174] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0175] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0176] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines the resources to be sent for the target function; determines the resource acquisition address of the resources to be sent according to the device identification of the recipient, and the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resources to be sent when the primary address fails; and sends the resource acquisition address to the recipient.
[0177] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0178] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0179] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, constitute a limitation on the unit itself.
[0180] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0181] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0182] According to one or more embodiments of the present disclosure, Example 1 provides a method for delivering resources, including:
[0183] Determine the resources to be issued for the target function;
[0184] Determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails;
[0185] The resource acquisition address is sent to the recipient.
[0186] According to one or more embodiments of the present disclosure, Example 2 is a method according to Example 1, wherein determining resources to be delivered of a target function includes:
[0187] Acquire first resource information and second resource information corresponding to the target function, wherein the first resource information is resource information of the target full resource, the target full resource is the latest effective full resource, and the second resource information is resource information of the target grayscale resource, the target grayscale resource is the latest effective grayscale resource;
[0188] If the second resource information is successfully acquired and the recipient meets the preset grayscale condition, the target grayscale resource is determined as the resource to be issued for the target function;
[0189] Otherwise, the target full amount of resources is determined as the resources to be issued for the target function.
[0190] According to one or more embodiments of the present disclosure, Example 3 is a method according to Example 2, wherein obtaining first resource information and second resource information corresponding to the target function includes:
[0191] For each type of resource, the client information of the recipient is used as the current client information, and the resource is the target full resource or the target grayscale resource;
[0192] Obtain the latest resource information corresponding to the current client information;
[0193] If the acquisition is successful, the acquired resource information is used as the resource information of the resource;
[0194] If the acquisition fails, the previous client information of the current client information is used as the current client information, and the operation of acquiring the latest effective resource information corresponding to the current client information is returned to be executed until there is no previous client information or the resource information is successfully acquired.
[0195] According to one or more embodiments of the present disclosure, Example 4 is the method according to Example 2, and after acquiring the first resource information and the second resource information corresponding to the target function, further includes:
[0196] Calculating the grayscale identification of the receiver using a first grayscale strategy corresponding to the second resource information;
[0197] If the second resource information is successfully acquired and the recipient satisfies a preset grayscale condition, determining the target grayscale resource as a to-be-delivered resource of a target function includes:
[0198] If the second resource information is successfully acquired and the grayscale identifier meets a preset grayscale condition, the target grayscale resource is determined as a resource to be issued for the target function.
[0199] According to one or more embodiments of the present disclosure, Example 5 is the method according to Example 1, wherein determining the resource acquisition address of the resource to be delivered according to the device identification of the recipient includes:
[0200] Determine a primary domain name index and a backup domain name index according to the device identifier of the receiver;
[0201] Acquire a primary domain name corresponding to the primary domain name index and a backup domain name corresponding to the backup domain name index;
[0202] The primary address is generated based on the primary domain name, and the backup address is generated based on the backup domain name.
[0203] According to one or more embodiments of the present disclosure, Example 6 is a method according to any one of Examples 1-5, further comprising:
[0204] Release the resources to be released of the target function, where the resources to be released are full resources or grayscale resources.
[0205] According to one or more embodiments of the present disclosure, Example 7 is the method according to Example 6, wherein the publishing resource to be published of the target function includes:
[0206] Acquire the original resource to be published from a data source corresponding to the resource type of the resource to be published;
[0207] Parsing the original resource to obtain the resource to be published;
[0208] The resource to be released is released, and a resource release record of the resource to be released is generated, wherein the resource release record includes resource information of the resource to be released.
[0209] According to one or more embodiments of the present disclosure, Example 8 is based on the method described in Example 7, wherein the resource to be released is a grayscale resource, and the resource release record further includes a second grayscale strategy for the resource to be released.
[0210] According to one or more embodiments of the present disclosure, Example 9 is the method according to Example 7, after publishing the to-be-published resource, further comprising:
[0211] Performing validity detection on the resources to be released;
[0212] When it is detected that there is an invalid domain name among the domain names corresponding to the resources to be released, marking the invalid domain name;
[0213] When it is detected that the resource to be released is invalid, the resource state of the resource to be released is modified to a first invalid state.
[0214] According to one or more embodiments of the present disclosure, Example 10 is a method according to any one of Examples 1-5, and after sending the resource acquisition address to the recipient, further includes:
[0215] When a resource rollback request is received, the resource state of the resource to be delivered is modified to a second invalid state, and the resource to be delivered is rolled back.
[0216] According to one or more embodiments of the present disclosure, Example 11 is the method according to Example 10, wherein the rolling back of the to-be-delivered resources includes:
[0217] If the recipient is a client and the client is in a running state, returning to the operation of performing the determination of the resource to be sent of the target function, so as to re-determine the resource to be sent and the resource acquisition address of the resource to be sent;
[0218] The sending the resource acquisition address to the recipient includes:
[0219] Sending update information carrying the re-determined resource acquisition address to the recipient.
[0220] According to one or more embodiments of the present disclosure, Example 12 provides a resource delivery device, including:
[0221] A first determination module is used to determine the resources to be issued for the target function;
[0222] A second determination module is used to determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails;
[0223] A sending module is used to send the resource acquisition address to the receiving party.
[0224] According to one or more embodiments of the present disclosure, Example 13 provides an electronic device, including:
[0225] one or more processors;
[0226] a memory for storing one or more programs,
[0227] When the one or more programs are executed by the one or more processors, the one or more processors implement the resource delivery method as described in any one of Examples 1-11.
[0228] According to one or more embodiments of the present disclosure, Example 14 provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the resource delivery method as described in any one of Examples 1-11.
[0229] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
[0230] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0231] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for delivering resources, characterized in that: include: Determine the resources to be issued for the target function; Determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails; The resource acquisition address is sent to the recipient.
2. The method according to claim 1, characterized in that The resources to be issued for determining the target function include: Acquire first resource information and second resource information corresponding to the target function, wherein the first resource information is resource information of the target full resource, the target full resource is the latest effective full resource, and the second resource information is resource information of the target grayscale resource, the target grayscale resource is the latest effective grayscale resource; If the second resource information is successfully acquired and the recipient meets the preset grayscale condition, the target grayscale resource is determined as the resource to be issued for the target function; Otherwise, the target full amount of resources is determined as the resources to be issued for the target function.
3. The method according to claim 2, characterized in that The acquiring of the first resource information and the second resource information corresponding to the target function includes: For each type of resource, the client information of the recipient is used as the current client information, and the resource is the target full resource or the target grayscale resource; Obtain the latest resource information corresponding to the current client information; If the acquisition is successful, the acquired resource information is used as the resource information of the resource; If the acquisition fails, the previous client information of the current client information is used as the current client information, and the operation of acquiring the latest effective resource information corresponding to the current client information is returned to be executed until there is no previous client information or the resource information is successfully acquired.
4. The method according to claim 2, characterized in that: After acquiring the first resource information and the second resource information corresponding to the target function, the method further includes: Calculating the grayscale identification of the receiver using a first grayscale strategy corresponding to the second resource information; If the second resource information is successfully acquired and the recipient satisfies a preset grayscale condition, determining the target grayscale resource as a to-be-delivered resource of a target function includes: If the second resource information is successfully acquired and the grayscale identifier meets a preset grayscale condition, the target grayscale resource is determined as a resource to be issued for the target function.
5. The method according to claim 1, characterized in that The determining, according to the device identification of the receiver, the resource acquisition address of the resource to be sent includes: Determine a primary domain name index and a backup domain name index according to the device identifier of the receiver; Acquire a primary domain name corresponding to the primary domain name index and a backup domain name corresponding to the backup domain name index; The primary address is generated based on the primary domain name, and the backup address is generated based on the backup domain name.
6. The method according to any one of claims 1 to 5, characterized in that: Also includes: Release the resources to be released of the target function, where the resources to be released are full resources or grayscale resources.
7. The method according to claim 6, characterized in that The resources to be released of the release target function include: Acquire the original resource to be published from a data source corresponding to the resource type of the resource to be published; Parsing the original resource to obtain the resource to be published; The resource to be released is released, and a resource release record of the resource to be released is generated, wherein the resource release record includes resource information of the resource to be released.
8. The method according to claim 7, characterized in that The resource to be released is a grayscale resource, and the resource release record also includes a second grayscale strategy for the resource to be released.
9. The method according to claim 7, characterized in that: After publishing the to-be-published resource, the method further includes: Performing validity detection on the resources to be released; When it is detected that there is an invalid domain name among the domain names corresponding to the resources to be released, marking the invalid domain name; When it is detected that the resource to be released is invalid, the resource state of the resource to be released is modified to a first invalid state.
10. The method according to any one of claims 1 to 5, characterized in that: After sending the resource acquisition address to the recipient, the method further includes: When a resource rollback request is received, the resource state of the resource to be delivered is modified to a second invalid state, and the resource to be delivered is rolled back.
11. The method according to claim 10, characterized in that The rolling back of the resources to be sent includes: If the recipient is a client and the client is in a running state, returning to the operation of performing the determination of the resource to be sent of the target function, so as to re-determine the resource to be sent and the resource acquisition address of the resource to be sent; The sending the resource acquisition address to the recipient includes: Sending update information carrying the re-determined resource acquisition address to the recipient.
12. A resource distribution device, characterized in that: include: A first determination module is used to determine the resources to be issued for the target function; A second determination module is used to determine a resource acquisition address of the resource to be delivered according to the device identification of the recipient, wherein the resource acquisition address includes a primary address and a backup address, and the backup address is used for the recipient to obtain the resource to be delivered when the primary address fails; A sending module is used to send the resource acquisition address to the receiving party.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the resource delivery method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the resource delivery method according to any one of claims 1 to 11 when executed.
