A network resource allocation method, apparatus, device, and storage medium
By determining the target resource subscription strategy based on the virtual relationship structure between resource subscribers in the e-government intranet and using multi-threaded resource sending, the message blocking problem caused by the complexity of resource allocation paths is solved, thereby improving resource allocation efficiency and message sending speed.
Patent Information
- Application Number
- CN202510007406.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-01-03
AI Technical Summary
In e-government intranets, the complex resource subscription relationships between resource management systems and business systems lead to message congestion, low resource allocation efficiency, and slow message sending.
The target resource subscription strategy is determined based on the virtual relationship structure between resource subscribers. The target control object is used to add a tag, the resource to be allocated is inserted into the message queue, and sent to the target resource subscriber using multi-threading.
It solves the message blocking problem caused by complex resource allocation paths, and improves resource allocation efficiency and message sending speed.
Smart Images

Figure CN119583497B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of message synchronization, in particular to a network resource allocation method and device, equipment and storage medium. BACKGROUND
[0002] There are two ways for resource management system in the e-government intranet to synchronize resources to business systems, including active subscription by the resource management system and active pulling by the business application system. In the application scenario of the e-government intranet, if full-pull is performed to update resources, this will cause resource waste of the message sender and receiver. If single-pull is performed, in the case of a large number of resources being subscribed, it may bring a burden to the operator. In order to ensure that the business application system can timely perceive the change of resources in the case of modification of resource attributes, the common solution is that the resource system actively subscribes and actively pushes the resources required by the business application.
[0003] Currently, the resource management system in the e-government intranet and other business systems usually adopt a message queue sequential synchronization model for resource subscription, and the interaction process is as follows: (1) the user first selects a certain resource for subscription, establishes the subscription relationship of the resource and a certain application, and queues the resource subscription message; (2) the user first selects all personnel under a certain organization for subscription, establishes the subscription relationship of these resources and a certain application, and queues the resource subscription message; (3) the user first selects all personnel meeting a certain attribute (such as gender-male) for subscription, establishes the subscription relationship of these resources and a certain application, and queues the resource subscription message. This will cause message blocking problems in the case of complex resource allocation paths, resulting in low resource allocation efficiency and slow message sending. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a network resource allocation method and device, equipment and storage medium, which can determine a target resource subscription strategy according to the virtual relationship structure between resource subscribers, and allocate resources through the target resource subscription strategy, solving the problem of message blocking caused by complex resource subscription relationships and scattered paths. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a network resource allocation method applied to an e-government intranet, comprising:
[0006] determining a target resource subscription strategy based on a target virtual relationship structure between resource subscribers, and determining the corresponding relationship between the to-be-allocated resources and the target resource subscribers according to the target resource subscription strategy;
[0007] adding a target mark for determining the corresponding relationship to the to-be-allocated resources in the preset resource management platform by using a target control object;
[0008] inserting the to-be-distributed resource into a target message queue, using different sending threads in a preset thread group, and sending the to-be-distributed resource in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target tag.
[0009] Optionally, before the target resource subscription strategy is determined based on the target virtual relationship structure between the resource subscribers, the method further includes:
[0010] extracting an initial resource from a preset database of the e-government intranet, verifying the legality of the initial resource, and converting the initial resource into the to-be-distributed resource conforming to preset memory structure characteristics according to a corresponding verification result;
[0011] storing the to-be-distributed resource corresponding to the initial resource in a preset search engine in the preset resource management platform.
[0012] Optionally, before the target resource subscription strategy is determined based on the target virtual relationship structure between the resource subscribers, the method further includes:
[0013] using a preset background thread of the e-government intranet to read the dependency relationship between the resource subscribers in sequence, and constructing an initial virtual relationship structure between the resource subscribers according to the dependency relationship;
[0014] judging whether the initial virtual relationship structure is legal, and determining the initial virtual relationship structure as the target virtual relationship structure based on a corresponding judgment result.
[0015] Optionally, the method further includes:
[0016] using a plurality of bits in the target control object to determine a process state generated in a resource subscription process, and adding the target tag for determining the corresponding relationship to the to-be-distributed resource in the preset resource management platform according to the process state.
[0017] Optionally, the method further includes:
[0018] using different sending threads in the preset thread group to obtain the to-be-distributed resource from the target message queue;
[0019] using the sending thread corresponding to the to-be-distributed resource and based on the target tag to send the to-be-distributed resource to the corresponding target resource subscriber.
[0020] Correspondingly, the network resource allocation method further comprises:
[0021] monitoring the resource sending process;
[0022] if any resource sending process is found to have a sending error, performing a corresponding resource re-sending operation to re-send the corresponding to-be-allocated resource in the target message queue to the corresponding target resource subscriber through the corresponding sending thread.
[0023] Optionally, if any resource sending process is found to have a sending error, performing a corresponding resource re-sending operation comprises:
[0024] if any resource sending process is found to have a sending error, re-storing the to-be-allocated resource corresponding to the sending error into the target message queue so as to re-send the to-be-allocated resource corresponding to the sending error.
[0025] Optionally, after sending the to-be-allocated resource in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target mark, the method further comprises:
[0026] storing the sent to-be-allocated resource into a preset sent queue in sequence, and checking the to-be-allocated resource in the preset sent queue to determine whether all the to-be-allocated resources have been sent to the corresponding target resource subscriber.
[0027] In a second aspect, the present application provides a network resource allocation device applied to an e-government intranet, comprising:
[0028] a corresponding relationship determination module configured to determine a target resource subscription strategy based on a target virtual relationship structure among resource subscribers, and determine a corresponding relationship between a to-be-allocated resource and a target resource subscriber according to the target resource subscription strategy;
[0029] a mark adding module configured to add a target mark for determining the corresponding relationship to the to-be-allocated resource in a preset resource management platform by using a target control object;
[0030] a resource sending module configured to insert the to-be-allocated resource into a target message queue, use a plurality of sending threads in a preset thread group, and send the to-be-allocated resource in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target mark.
[0031] In a third aspect, the present application provides an electronic device, comprising:
[0032] a memory for storing the computer program;
[0033] a processor for executing the computer program to implement the network resource allocation method.
[0034] In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program, which, when executed by a processor, implements the network resource allocation method.
[0035] The present application first determines a target resource subscription policy based on a target virtual relationship structure among resource subscribers, and determines a corresponding relationship between a to-be-allocated resource and a target resource subscriber according to the target resource subscription policy, then adds a target mark for determining the corresponding relationship to the to-be-allocated resource in a preset resource management platform by using a target control object, and finally inserts the to-be-allocated resource into a target message queue, sends the to-be-allocated resource in the target message queue to the corresponding target resource subscriber by using different sending threads in a preset thread group and based on the target resource subscription policy and the target mark. As can be seen, the present application determines a target resource subscription policy based on a virtual relationship structure among resource subscribers, allocates resources by using a resource subscription policy corresponding to the virtual relationship structure, solves the problem of message blocking in the case of complex resource allocation paths, and solves the problems of low resource allocation efficiency and slow message sending by allocating resources by using multiple threads. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on the provided drawings.
[0037] Figure 1 A network resource allocation method flow chart disclosed by the present application;
[0038] Figure 2 A specific network resource allocation method flow chart disclosed by the present application;
[0039] Figure 3 An entity internalization method flow chart disclosed by the present application;
[0040] Figure 4 A to-be-allocated resource internalization method flow chart disclosed by the present application;
[0041] Figure 5 A target resource subscriber entity internalization method flow chart disclosed by the present application;
[0042] Figure 6 A network resource allocation device structure diagram disclosed by the present application is shown in the figure.
[0043] Figure 7 An electronic equipment structure diagram disclosed by the present application is shown in the figure. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0045] At present, the resource allocation process in the e-government intranet is to establish a subscription relationship between a single user and a to-be-allocated resource respectively, and then allocate resources according to the subscription relationship. However, this resource allocation mode has the problem that when the resource subscription relationship is complex and the path is scattered, message blocking will occur. Therefore, the present application provides a network resource allocation method, which allocates resources by using a target resource subscription strategy determined according to a virtual relationship structure between resource subscribers, thereby solving the problem of message blocking caused by complex resource subscription relationship and scattered path.
[0046] Referring to Figure 1 The embodiment of the present application discloses a network resource allocation method, which comprises the following steps:
[0047] In step S11, a target resource subscription strategy is determined based on a target virtual relationship structure between resource subscribers, and a corresponding relationship between a to-be-allocated resource and a target resource subscriber is determined according to the target resource subscription strategy.
[0048] In the embodiment, before the target resource subscription strategy is determined based on the target virtual relationship structure between the resource subscribers, the method further comprises the following steps: extracting an initial resource from a preset database of the e-government intranet, verifying the legality of the initial resource, and converting the initial resource into a to-be-allocated resource conforming to the characteristics of a preset memory structure according to the corresponding verification result; and storing the corresponding to-be-allocated resource of the initial resource in a preset search engine in a preset resource management platform.
[0049] Before the target resource subscription policy is determined based on the target virtual relationship structure among the resource subscribers in the embodiment, the method further comprises: reading the dependency relationship among the resource subscribers in sequence by using a preset background thread of the e-government intranet, and constructing an initial virtual relationship structure among the resource subscribers according to the dependency relationship; judging whether the initial virtual relationship structure is legal, and determining the initial virtual relationship structure as the target virtual relationship structure based on the corresponding judgment result. The above process is: the entities in the e-government intranet are internalized, and the internal dependency relationship is explicitly saved as a specific memory data structure, that is, the entity content is stored in the memory model; for example, each organization explicitly saves its superior and subordinate organization set, all resource set under the organization, single selection subscription policy set of each subscriber, attribute subscription policy set of each subscriber, and subscription state and message state set of each subscriber in the memory. It can be understood that in the e-government intranet, the subscriber entities involved usually include institutions, organizations and users, and the three have internal mutual dependency relationship, such as the existence of superior and subordinate relationship between institutions, the existence of superior and subordinate relationship between organizations, the existence of containing relationship between institutions and organizations, the existence of belonging relationship between organizations and institutions, and the existence of belonging relationship between users and organizations. Therefore, when subscribing to resources, not only the subscription of a single entity itself needs to be considered, but also the subscription of its dependency relationship. By establishing a target virtual relationship structure of resource subscriber entities and their relationship, and storing the initial resource into the search engine as a to-be-allocated resource with preset memory structure characteristics, the efficiency of resource allocation is improved, and the problem of message blocking caused by complex resource allocation path is avoided.
[0050] In step S12, the target control object is used to add a target mark for determining the corresponding relationship to the to-be-allocated resource in the preset resource management platform.
[0051] In the embodiment, the process of adding a mark to the to-be-allocated resource by using the target control object can specifically include: determining a process state generated in a resource subscription process by using a plurality of bit positions in the target control object, and adding the target mark for determining the corresponding relationship to the to-be-allocated resource in the preset resource management platform according to the process state. In a specific implementation manner, a state control object Manipulator based on bit operation, that is, a target control object, is first constructed, the operation mode of which is based on bit operation and can efficiently and accurately operate in memory; the target control object uses eight bit positions to represent various process states that can be generated in a resource subscription process, and according to different process states, identifies the subscription relationship between resources and subscribers and the related state of a subscription policy. The target control object is also used to generate a resource subscription message in a resource allocation process. By using the target control object to mark the subscription relationship between the to-be-allocated resource and the resource subscriber, the reliability of the resource allocation process is ensured.
[0052] Step S13: Insert the resource to be allocated into the target message queue, utilize different sending threads in the preset thread group, and send the resource to be allocated in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target tag.
[0053] In this embodiment, the process of sending resources to be allocated to target resource subscribers using different sending threads in a preset thread group, based on the target resource subscription strategy and target tag, specifically includes: obtaining resources to be allocated from the target message queue using different sending threads in the preset thread group; sending the resources to be allocated to the corresponding target resource subscribers using the sending thread corresponding to the resources to be allocated and based on the target tag; correspondingly, this network resource allocation method also includes: monitoring the resource sending process; if a sending error is detected in any resource sending process, performing a corresponding resource retransmission operation to resend the corresponding resources to be allocated in the target message queue to the corresponding target resource subscribers through the corresponding sending thread. Figure 2 As shown, in one specific implementation, a sending thread retrieves the corresponding subscription node for the resource to be allocated from the target message queue, and the sending thread corresponding to the resource sends the resource to the corresponding target resource subscriber. The sending process is monitored. If there are no errors in the resource sending process, the successfully sent resource is stored in the sent queue. If a resource is sent incorrectly, the resource with the error is re-inserted into the tail of the target message queue so that the unsuccessfully sent resource can be sent again, ensuring that the resource is successfully allocated to the resource subscriber. If the resource is successfully sent to the target resource subscriber in the next message sending process, the resource is stored in the sent queue. By monitoring the resource sending process, it is ensured that the failed resource can re-enter the target message queue for re-allocation, reducing the possibility of resource loss during the resource allocation process.
[0054] In the embodiment, after sending the to-be-allocated resource to the corresponding target resource subscriber, the method further includes: sequentially storing the sent to-be-allocated resource into a preset sent queue, and checking the to-be-allocated resource in the preset sent queue to determine whether all the to-be-allocated resources have been sent to the corresponding target resource subscriber. In a specific implementation, the to-be-allocated resource in the sent queue is checked, if the sent queue contains all the to-be-allocated resources in the target message queue, it is proved that all the to-be-allocated resources have been sent; if the sent queue does not contain all the to-be-allocated resources in the target message queue, the missing to-be-allocated resource is determined, and corresponding safety measures are taken, for example, a message error warning is sent, and the state of the to-be-allocated resource that is not successfully sent is determined by manual investigation. By storing the sent to-be-allocated resource into the sent queue and checking the to-be-allocated resource in the sent queue, the problem that the information of the lost to-be-allocated resource due to message sending error cannot be determined is avoided, and the reliability of the resource allocation process is improved.
[0055] Therefore, the application establishes a target virtual relationship structure by the resource subscriber entity and the relationship therebetween, and stores the initial resource into the search engine as the to-be-allocated resource with the preset memory structure characteristics, thereby improving the efficiency of resource allocation and avoiding the problem of message blocking due to complex resource allocation path; by storing the sent to-be-allocated resource into the sent queue and checking the to-be-allocated resource in the sent queue, the problem that the information of the lost to-be-allocated resource due to message sending error cannot be determined is avoided, and the reliability of the resource allocation process is improved.
[0056] Referring to Figure 3 The embodiment of the application discloses an entity memory method, including:
[0057] In step S21, the initial resource is extracted from the preset database of the e-government intranet, and the initial resource is converted into the to-be-allocated resource conforming to the preset memory structure characteristics.
[0058] In the embodiment, the initial resource obtained from the e-government intranet is needed to generate the to-be-allocated resource conforming to the preset memory structure characteristics. For example, Figure 4As shown, in a specific embodiment, the initial resource is first saved, and the legality of the initial resource is verified. If the initial resource is legal, the internal dependency of the initial resource is further verified. Correspondingly, if the initial resource is not legal, the illegal initial resource is deleted. If the internal dependency of the initial resource is verified, the initial resource with the verified internal dependency is converted into a to-be-allocated resource conforming to the characteristics of a preset memory structure, and a service integrity record corresponding to the to-be-allocated resource is saved. In order to increase the search efficiency of the resource, the to-be-allocated resource and the service integrity record are written into a preset search engine, that is, an ES search engine (Elasticsearch, which is a search engine). After the to-be-allocated resource is saved to the preset search engine, the to-be-allocated resource also needs to be delivered to a service operation kernel of the ES search engine, so as to process the to-be-allocated resource based on the above service operation kernel. By storing the to-be-allocated resource in the preset search engine, the to-be-allocated resource can be quickly retrieved by the search engine during resource allocation, and the sending process of the to-be-allocated resource is performed, thereby improving the efficiency of resource allocation.
[0059] In step S22, the dependency relationship between the resource subscribers is read by using a preset background thread of the e-government intranet, and a target virtual relationship structure corresponding to the resource subscribers is constructed based on the dependency relationship.
[0060] In this embodiment, the target virtual relationship structure needs to be constructed by using the read dependency relationship between the resource subscribers. For example, as shown in Figure 5 As shown, in a specific embodiment, the related information of each resource subscriber, such as the dependency relationship between the resource subscribers, is read by using a background thread in sequence, and a preliminary internalization structure is established. It is judged whether the preliminary established internalization structure is legal. If the preliminary established internalization structure is not legal, an exception is thrown and the illegal initial internalization structure is deleted. If it is legal, the to-be-allocated resource is read by using an ES engine, and the internalization structure, that is, the target virtual relationship structure, is further established based on the read to-be-allocated resource and the initial internalization structure. The process of constructing the internalization structure of the whole system is as follows: resource internalization, execution of the reconstruction of the memory structure process after system restart, and then processing of the resources in the form of a queue. By constructing the target virtual relationship structure, the relationship between the to-be-allocated resource and the message subscriber, and the relationship between the message subscriber groups are clarified, and the reliability of the target resource subscription strategy determined according to the target virtual relationship structure is ensured.
[0061] Therefore, the application can quickly retrieve the to-be-allocated resource through the search engine and perform the sending process of the to-be-allocated resource, thereby improving the efficiency of resource allocation; by constructing the target virtual relationship structure, the relationship between the to-be-allocated resource and the message subscriber and the relationship between the message subscriber groups are determined, and the reliability of the target resource subscription strategy determined according to the target virtual relationship structure is ensured.
[0062] Referring to Figure 6 As shown in the figure, the embodiment of the application discloses a network resource allocation device applied to an e-government intranet, comprising:
[0063] The corresponding relationship determining module 11 is configured to determine a target resource subscription strategy based on a target virtual relationship structure between resource subscribers, and determine a corresponding relationship between a to-be-allocated resource and a target resource subscriber according to the target resource subscription strategy;
[0064] The mark adding module 12 is configured to add a target mark for determining the corresponding relationship to the to-be-allocated resource in the preset resource management platform by using a target control object;
[0065] The resource sending module 13 is configured to insert the to-be-allocated resource into a target message queue, send the to-be-allocated resource in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target mark by using a plurality of sending threads in a preset thread group.
[0066] Therefore, the application determines a target resource subscription strategy based on a virtual relationship structure between resource subscribers, performs resource allocation by using a resource subscription strategy corresponding to the virtual relationship structure, solves the problem of message blocking in the case of complex resource allocation paths, and solves the problems of low resource allocation efficiency and slow message sending by using a plurality of threads for resource allocation.
[0067] In some specific embodiments, the corresponding relationship determining module 11 further comprises:
[0068] The resource conversion unit is configured to extract an initial resource from a preset database of the e-government intranet, verify the legality of the initial resource, and convert the initial resource into the to-be-allocated resource conforming to the characteristics of a preset memory structure according to the corresponding verification result;
[0069] The resource storage unit is configured to store the to-be-allocated resource corresponding to the initial resource in a preset search engine in the preset resource management platform.
[0070] In some specific embodiments, the corresponding relationship determining module 11 further comprises:
[0071] a relationship structure construction unit, configured to sequentially read dependency relationships between a plurality of the resource subscribers by using preset background threads of the e-government intranet, and construct an initial virtual relationship structure between the resource subscribers according to the dependency relationships;
[0072] a relationship structure determination unit, configured to determine whether the initial virtual relationship structure is legal, and determine the initial virtual relationship structure as the target virtual relationship structure based on a corresponding determination result.
[0073] In some embodiments, the mark adding module 12 specifically comprises:
[0074] a mark adding unit, configured to determine a process state generated in a resource subscription process by using a plurality of bits in the target control object, and add the target mark for determining the corresponding relationship to the to-be-allocated resource in the preset resource management platform according to the process state.
[0075] In some embodiments, the resource sending module 13 specifically comprises:
[0076] a resource obtaining unit, configured to obtain the to-be-allocated resource from the target message queue by using different sending threads in the preset thread group;
[0077] a resource sending unit, configured to send the to-be-allocated resource to the corresponding target resource subscriber based on the target mark by using the sending thread corresponding to the to-be-allocated resource;
[0078] Correspondingly, the network resource allocation apparatus further comprises:
[0079] a process monitoring module, configured to monitor a resource sending process;
[0080] a resource retransmission module, configured to perform a corresponding resource retransmission operation if it is monitored that any resource sending process has a sending error, so as to re-send the corresponding to-be-allocated resource in the target message queue to the corresponding target resource subscriber by using the corresponding sending thread.
[0081] In some embodiments, the resource retransmission module specifically comprises:
[0082] a resource retransmission unit, configured to re-store the to-be-allocated resource corresponding to the sending error into the target message queue if it is monitored that any resource sending process has a sending error, so as to re-send the to-be-allocated resource corresponding to the sending error.
[0083] In some embodiments, the resource sending module 13 further comprises:
[0084] The resource traversal unit is configured to sequentially store the to-be-allocated resources into a preset sent queue, and check the to-be-allocated resources in the preset sent queue to determine whether all the to-be-allocated resources have been sent to the corresponding target resources.
[0085] Further, the embodiment of the present application further discloses an electronic device, Figure 7 The electronic device 20 is shown in a structural diagram according to an exemplary embodiment, and the content in the diagram should not be considered as any limitation on the use range of the present application.
[0086] Figure 7 The electronic device 20 is shown in a structural diagram according to an exemplary embodiment, and the content in the diagram should not be considered as any limitation on the use range of the present application.
[0087] In the embodiment, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 is capable of creating a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited here; the input and output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited here.
[0088] In addition, the memory 22 as a resource storage carrier can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.
[0089] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the network resource allocation method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.
[0090] Further, the present application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the network resource allocation method disclosed above. For the specific steps of the method, refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0091] The various embodiments are described in the present specification in progressive order, and each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, refer to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and refer to the method part for the relevant content.
[0092] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the above description in general terms. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0093] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0094] Finally, it should be noted that, in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0095] The technical solutions provided by the present application are described in detail above, and the principles and implementation manners of the present application are described by using specific examples. The above description of the examples is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed, and the above description of the content of the specification should not be understood as a limitation on the present application.
Claims
1. A method of allocating network resources, characterized by, Be applied to the e-government intranet, including: Determine the target resource subscription strategy based on the target virtual relationship structure between resource subscribers, and determine the corresponding relationship between the to-be-allocated resource and the target resource subscriber according to the target resource subscription strategy; Add a target mark for determining the corresponding relationship to the to-be-allocated resource in the preset resource management platform by using a target control object; Insert the to-be-allocated resource into a target message queue, and send the to-be-allocated resource in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target mark by using different sending threads in a preset thread group; Before determining the target resource subscription strategy based on the target virtual relationship structure between resource subscribers, the method further includes: extracting an initial resource from a preset database of the e-government intranet, verifying the legality of the initial resource, and converting the initial resource into the to-be-allocated resource conforming to the characteristics of a preset memory structure according to the corresponding verification result; and storing the corresponding to-be-allocated resource of the initial resource in a preset search engine in the preset resource management platform; Before determining the target resource subscription strategy based on the target virtual relationship structure between resource subscribers, the method further includes: sequentially reading the dependency relationship between a plurality of resource subscribers by using a preset background thread of the e-government intranet, and constructing an initial virtual relationship structure between the resource subscribers according to the dependency relationship; determining whether the initial virtual relationship structure is legal, and determining the initial virtual relationship structure as the target virtual relationship structure based on the corresponding determination result.
2. The network resource allocation method of claim 1, wherein, The method further includes: Determining the process state generated in the resource subscription process by using a plurality of bit positions in the target control object, and adding the target mark for determining the corresponding relationship to the to-be-allocated resource in the preset resource management platform according to the process state.
3. The network resource allocation method of claim 1, wherein, The method further includes: Acquiring the to-be-allocated resource from the target message queue by using different sending threads in the preset thread group; Sending the to-be-allocated resource to the corresponding target resource subscriber based on the target mark by using the corresponding sending thread and the target mark; Correspondingly, the network resource allocation method further includes: Monitoring the resource sending process; If it is monitored that any resource sending process has a sending error, performing a corresponding resource retransmission operation to retransmit the corresponding to-be-allocated resource in the target message queue to the corresponding target resource subscriber by using the corresponding sending thread.
4. The network resource allocation method of claim 3, wherein, The method further includes: If any sending process is monitored to have a sending error, the to-be-allocated resource corresponding to the sending error is re-stored in the target message queue, so as to re-send the to-be-allocated resource corresponding to the sending error.
5. The method of claim 1 to 4, wherein, After the to-be-allocated resource in the target message queue is sent to the corresponding target resource subscriber based on the target resource subscription strategy and the target mark, the method further comprises: The sent to-be-allocated resource is sequentially stored in a preset sent queue, and whether all the to-be-allocated resources have been sent to the corresponding target resource subscriber is determined by traversing and checking the to-be-allocated resource in the preset sent queue.
6. A network resource allocation apparatus characterized by comprising: The method is applied to an e-government intranet, and comprises: A corresponding relationship determining module is configured to determine a target resource subscription strategy based on a target virtual relationship structure among resource subscribers, and determine a corresponding relationship between a to-be-allocated resource and a target resource subscriber according to the target resource subscription strategy; A mark adding module is configured to add a target mark for determining the corresponding relationship to the to-be-allocated resource in a preset resource management platform by using a target control object; A resource sending module is configured to insert the to-be-allocated resource into a target message queue, send the to-be-allocated resource in the target message queue to the corresponding target resource subscriber based on the target resource subscription strategy and the target mark by using a plurality of sending threads in a preset thread group, and determine whether all the to-be-allocated resources have been sent to the corresponding target resource subscriber by traversing and checking the to-be-allocated resource in a preset sent queue. The corresponding relationship determining module further comprises: a resource converting unit configured to extract an initial resource from a preset database of the e-government intranet, verify the legality of the initial resource, and convert the initial resource into the to-be-allocated resource conforming to the characteristics of a preset memory structure according to a corresponding verification result; and a resource storing unit configured to store the to-be-allocated resource corresponding to the initial resource in a preset search engine in the preset resource management platform. The corresponding relationship determining module further comprises: a relationship structure constructing unit configured to sequentially read a plurality of dependency relationships among the resource subscribers by using a preset background thread of the e-government intranet, and construct an initial virtual relationship structure among the resource subscribers according to the dependency relationships; and a relationship structure determining unit configured to determine whether the initial virtual relationship structure is legal, and determine the initial virtual relationship structure as the target virtual relationship structure based on a corresponding determination result.
7. An electronic device, comprising: The method comprises: A memory is configured to save a computer program; A processor is configured to execute the computer program to implement the network resource allocation method in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, A computer program is saved, and the computer program is executed by a processor to implement the network resource allocation method in any one of claims 1 to 5.
Citation Information
Patent Citations
Resource management platform having topics distribution function and its method
CN101064619A
Close fulfillment of content requests
US20140337875A1