CN111562989A - Method and device for separate deployment of dynamic resources and static resources - Google Patents
Method and device for separate deployment of dynamic resources and static resources Download PDFInfo
- Publication number
- CN111562989A CN111562989A CN202010671499.4A CN202010671499A CN111562989A CN 111562989 A CN111562989 A CN 111562989A CN 202010671499 A CN202010671499 A CN 202010671499A CN 111562989 A CN111562989 A CN 111562989A
- Authority
- CN
- China
- Prior art keywords
- deployment
- virtual map
- distance
- virtual
- resources
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a method and a device for separately deploying dynamic resources and static resources, wherein the method comprises the following steps: step S1: acquiring Web resources and separating static resources and dynamic resources; step S2: acquiring a first list and a second list; step S3: screening out a first deployment position from the first list based on a first preset rule and deploying the static resource; step S4: and screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource. According to the method for separately deploying the dynamic resources and the static resources, the dynamic resources and the static resources are separately deployed at different deployment positions, and when a WEB request of a client is received, the static resources and the dynamic resources in the WEB request are acquired from the different deployment positions, so that the speed of acquiring the dynamic resources is increased, and further the response speed of WEB service is increased.
Description
Technical Field
The invention relates to the technical field of separation deployment, in particular to a method and a device for separation deployment of dynamic resources and static resources.
Background
At present, static resources are generally designed html pages, and dynamic resources realize dynamic response according to requirements by means of designed programs;
the WEB system returns the static resources and the dynamic resources included in the accessed page to the browser according to the WEB request of the user, so that the page to be accessed by the user is displayed on the browser.
The static resources and the dynamic resources are both deployed in the same deployment position (such as a WEB container), and each time a user sends a WEB request through a client, the deployment position loads the static resources and acquires the dynamic resources according to the WEB request, and then returns the static resources and the dynamic resources to the client to complete WEB service.
However, after receiving the WEB request, the deployment location needs to load the required static resource and run the corresponding program to obtain the dynamic resource, which requires a long time to complete the step of obtaining the dynamic resource.
Disclosure of Invention
One of the objectives of the present invention is to provide a method for separately deploying dynamic resources and static resources, where the dynamic resources and the static resources are separately deployed at different deployment positions, and when a WEB request of a client is received, the static resources and the dynamic resources in the WEB request are acquired from the different deployment positions, so as to improve the speed of acquiring the dynamic resources, and further improve the response speed of the WEB service.
The method for separately deploying the dynamic resources and the static resources, provided by the embodiment of the invention, comprises the following steps:
step S1: acquiring Web resources and separating static resources and dynamic resources;
step S2: obtaining a first list and a second list, the first list comprising: a plurality of first deployment locations for static resource deployment, the second list comprising: a plurality of second deployment locations for dynamic resource deployment;
step S3: screening out a first deployment position from the first list based on a first preset rule and deploying the static resource;
step S4: and screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource.
Preferably, step S3: screening out a first deployment position from the first list and deploying the static resources based on a first preset rule, specifically comprising:
step S31: determining the size of a static resource to be deployed;
step S32: deleting a first deployment position of which the deployable residual capacity is smaller than or equal to the size of the static resource in the first list;
step S33: establishing a first virtual map based on spatial position attributes corresponding to the remaining first deployment positions in the first list;
step S34: determining a first deployment location at a first virtual map center location;
step S35: taking a first deployment position located at the center position of a first virtual map as a first reference, and when the maximum distance between the other first deployment positions on the first virtual map and the reference is greater than a first preset value, determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first reference;
step S36: deploying the static resource at a first deployment location as a first reference and a first secondary reference;
step S4: screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource, wherein the method specifically comprises the following steps:
step S41: determining the size of a dynamic resource to be deployed;
step S42: deleting a second deployment position of which the deployable residual capacity is less than or equal to the size of the dynamic resource in the second list;
step S43: establishing a second virtual map based on the spatial position attribute corresponding to the remaining second deployment positions in the second list;
step S44: determining a second deployment location at a second virtual map center location;
step S45: taking a second deployment position located at the center position of the second virtual map as a second reference, and when the maximum distance between the second deployment position on the second virtual map and the second reference is greater than a second preset value, determining a plurality of second secondary references in a plurality of preset directions according to the distance between the second deployment position on the second virtual map and the second reference;
step S46: the dynamic resource is deployed at the first deployment location as a second benchmark and a second secondary benchmark.
Preferably, step S34: determining a first deployment location at a first virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the remaining first deployment locations in the first list and other first deployment locations;
calculating the variance of the relative distance;
the first deployment position with the smallest difference is the first deployment position located at the center position of the first virtual map;
step S34: determining a second deployment location at a second virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the remaining second deployment locations in the second list and other second deployment locations;
calculating the variance of the relative distance;
the second deployment position with the smallest difference is the second deployment position located at the center position of the second virtual map.
Preferably, the determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first references specifically includes:
acquiring a first distance judgment value of a first secondary standard and a first standard;
determining a first secondary reference based on the first distance decision value and the distance of the other first deployment location on the first virtual map from the first reference; the error between the distance of the first secondary reference from the first reference and the first distance judgment value is minimum;
determining a plurality of first judging position points according to the first initial included angles and the first distance judgment values by taking the included angle between the first secondary reference and the first reference as a first initial included angle;
calculating distances of other first deployment positions on the first virtual map from the first decision position pointThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the first virtual mapA virtual longitude and a virtual latitude corresponding to the first deployment location;represents a first distance determination value;representing a first initial included angle;is a preset constant;,representing a virtual longitude and a virtual latitude corresponding to the first reference;
determining a plurality of second secondary references in a plurality of preset directions according to distances between other second deployment positions on the second virtual map and the second references, specifically including:
acquiring a second distance judgment value of a second secondary standard and a second standard;
determining a second secondary reference based on the second distance decision value and the distance of the other second deployment location on the second virtual map from the second reference; the error of the distance between the second secondary reference and the second distance judgment value is minimum;
determining a plurality of second judgment position points according to the second initial included angle and a second distance judgment value by taking the included angle between the second secondary standard and the second standard as a second initial included angle;
calculating the distance between the other second deployment position and the second judgment position on the second virtual mapThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on a second virtual mapA virtual longitude and a virtual latitude corresponding to the second deployment location;represents a second distance determination value;representing a second initial included angle;is a preset constant;,and indicates a virtual longitude and a virtual latitude corresponding to the second reference.
Preferably, the method for separately deploying the dynamic resource and the static resource further includes:
step S5: acquiring a Web request of a client and the position of the client;
step S6: mapping the location of the client to a first virtual map and a second virtual map;
step S7: acquiring static resources in the Web request by using a first deployment position with a distance from a client side in a first virtual map as a preset first threshold;
step S8: and acquiring the dynamic resources in the Web request at a second deployment position which is away from the client side in the second virtual map and is a preset second threshold value.
The invention also provides a system for separately deploying dynamic resources and static resources, which comprises:
the Web resource acquisition module is used for acquiring Web resources and separating static resources and dynamic resources;
a list obtaining module, configured to obtain a first list and a second list, where the first list includes: a plurality of first deployment locations for static resource deployment, the second list comprising: a plurality of second deployment locations for dynamic resource deployment;
the static resource deployment module is used for screening out a first deployment position from the first list based on a first preset rule and deploying the static resource;
and the dynamic resource deployment module is used for screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource.
Preferably, the static resource deployment module performs operations including:
determining the size of a static resource to be deployed;
deleting a first deployment position of which the deployable residual capacity is smaller than or equal to the size of the static resource in the first list;
establishing a first virtual map based on spatial position attributes corresponding to the remaining first deployment positions in the first list;
determining a first deployment location at a first virtual map center location;
taking a first deployment position located at the center position of a first virtual map as a first reference, and when the maximum distance between the other first deployment positions on the first virtual map and the reference is greater than a first preset value, determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first reference;
deploying the static resource at a first deployment location as a first reference and a first secondary reference;
the dynamic resource deployment module executes the following operations:
determining the size of a dynamic resource to be deployed;
deleting a second deployment position of which the deployable residual capacity is less than or equal to the size of the dynamic resource in the second list;
establishing a second virtual map based on the spatial position attribute corresponding to the remaining second deployment positions in the second list;
determining a second deployment location at a second virtual map center location;
taking a second deployment position located at the center position of the second virtual map as a second reference, and when the maximum distance between the second deployment position on the second virtual map and the second reference is greater than a second preset value, determining a plurality of second secondary references in a plurality of preset directions according to the distance between the second deployment position on the second virtual map and the second reference;
the dynamic resource is deployed at the first deployment location as a second benchmark and a second secondary benchmark.
Preferably, a first deployment position located at the center position of the first virtual map is determined; the method specifically comprises the following steps:
calculating relative distances between the remaining first deployment locations in the first list and other first deployment locations;
calculating the variance of the relative distance;
the first deployment position with the smallest difference is the first deployment position located at the center position of the first virtual map;
determining a second deployment location at a second virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the remaining second deployment locations in the second list and other second deployment locations;
calculating the variance of the relative distance;
the second deployment position with the smallest difference is the second deployment position located at the center position of the second virtual map.
Preferably, the determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first references specifically includes:
acquiring a first distance judgment value of a first secondary standard and a first standard;
determining a first secondary reference based on the first distance decision value and the distance of the other first deployment location on the first virtual map from the first reference; the error between the distance of the first secondary reference from the first reference and the first distance judgment value is minimum;
determining a plurality of first judging position points according to the first initial included angles and the first distance judgment values by taking the included angle between the first secondary reference and the first reference as a first initial included angle;
calculating distances of other first deployment positions on the first virtual map from the first decision position pointThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the first virtual mapA virtual longitude and a virtual latitude corresponding to the first deployment location;represents a first distance determination value;representing a first initial included angle;is a preset constant;,representing a virtual longitude and a virtual latitude corresponding to the first reference;
determining a plurality of second secondary references in a plurality of preset directions according to distances between other second deployment positions on the second virtual map and the second references, specifically including:
acquiring a second distance judgment value of a second secondary standard and a second standard;
determining a second secondary reference based on the second distance decision value and the distance of the other second deployment location on the second virtual map from the second reference; the error of the distance between the second secondary reference and the second distance judgment value is minimum;
determining a plurality of second judgment position points according to the second initial included angle and a second distance judgment value by taking the included angle between the second secondary standard and the second standard as a second initial included angle;
calculating the distance between the other second deployment position and the second judgment position on the second virtual mapThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on a second virtual mapA virtual longitude and a virtual latitude corresponding to the second deployment location;represents a second distance determination value;representing a second initial included angle;is a preset constant;,and indicates a virtual longitude and a virtual latitude corresponding to the second reference.
Preferably, the system for separately deploying dynamic resources and static resources further includes:
the Web request acquisition module is used for acquiring a Web request of a client and the position of the client;
a mapping module for mapping a location of a client to a first virtual map and a second virtual map;
the static resource acquisition module is used for acquiring static resources in the Web request at a first deployment position with a distance from the client side in the first virtual map as a preset first threshold;
and the dynamic resource acquisition module is used for acquiring the dynamic resources in the Web request at a second deployment position with the distance from the client side in the second virtual map as a preset second threshold value.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic diagram of a method for separately deploying dynamic resources and static resources in an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
An embodiment of the present invention provides a method for separately deploying dynamic resources and static resources, as shown in fig. 1, including:
step S1: acquiring Web resources and separating static resources and dynamic resources;
step S2: obtaining a first list and a second list, the first list comprising: a plurality of first deployment locations for static resource deployment, the second list comprising: a plurality of second deployment locations for dynamic resource deployment;
step S3: screening out a first deployment position from the first list based on a first preset rule and deploying the static resource;
step S4: and screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource.
The working principle and the beneficial effects of the technical scheme are as follows:
the method comprises the steps of firstly separating Web resources into static resources and dynamic resources, and separately deploying the static resources and the dynamic resources to provide a data basis for responding WEB services. Then, acquiring a first list of a plurality of first deployment positions where static resources can be deployed and a second list of a plurality of second deployment positions where dynamic static resources can be deployed, specifically: inquiring nodes deployed by each static resource in the WEB system when the Web resource is received, and adding the static resource into a first list after receiving the response of the nodes deployed by the static resource; and inquiring each dynamic resource deployed node in the WEB system when the Web resource is received, and adding the dynamic resource into the second list after receiving the response of the dynamic resource deployed node. Finally, screening out a first deployment position from the first list and deploying the static resources based on a first preset rule, and screening out a second deployment position from the second list and deploying the dynamic resources based on a second preset rule; and realizing the separate deployment of the static resources and the dynamic resources. The first preset rule and the second preset rule may both include one or more of parameters [ hardware parameters, software version numbers, response speeds, network transmission speeds, and the like ] of the first deployment location, and a real location of the first deployment location.
According to the method for separately deploying the dynamic resources and the static resources, the dynamic resources and the static resources are separately deployed at different deployment positions, and when a WEB request of a client is received, the static resources and the dynamic resources in the WEB request are acquired from the different deployment positions, so that the speed of acquiring the dynamic resources is increased, and further the response speed of WEB service is increased.
In one embodiment, step S3: screening out a first deployment position from the first list and deploying the static resources based on a first preset rule, specifically comprising:
step S31: determining the size of a static resource to be deployed;
step S32: deleting a first deployment position of which the deployable residual capacity is smaller than or equal to the size of the static resource in the first list;
step S33: establishing a first virtual map based on spatial position attributes corresponding to the remaining first deployment positions in the first list;
step S34: determining a first deployment location at a first virtual map center location;
step S35: taking a first deployment position located at the center position of a first virtual map as a first reference, and when the maximum distance between the other first deployment positions on the first virtual map and the reference is greater than a first preset value, determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first reference;
step S36: deploying the static resource at a first deployment location as a first reference and a first secondary reference;
step S4: screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource, wherein the method specifically comprises the following steps:
step S41: determining the size of a dynamic resource to be deployed;
step S42: deleting a second deployment position of which the deployable residual capacity is less than or equal to the size of the dynamic resource in the second list;
step S43: establishing a second virtual map based on the spatial position attribute corresponding to the remaining second deployment positions in the second list;
step S44: determining a second deployment location at a second virtual map center location;
step S45: taking a second deployment position located at the center position of the second virtual map as a second reference, and when the maximum distance between the second deployment position on the second virtual map and the second reference is greater than a second preset value, determining a plurality of second secondary references in a plurality of preset directions according to the distance between the second deployment position on the second virtual map and the second reference;
step S46: the dynamic resource is deployed at the first deployment location as a second benchmark and a second secondary benchmark.
The working principle and the beneficial effects of the technical scheme are as follows:
first, a first step of screening is carried out on a first deployment position and a second deployment position in a first list and a second list according to the size of a static resource and a dynamic resource in a WEB resource, and the deployment positions with the residual capacity smaller than the size of the static resource and the size of the dynamic resource are removed. Mapping the first deployment position and the second deployment position to a first virtual map and a second virtual map respectively, and performing multipoint deployment according to virtual longitudes and virtual latitudes of the first deployment position and the second deployment position in the first virtual map and the second virtual map; when a WEB request of a client is received, static resources and dynamic resources can be conveniently obtained nearby according to the position of the client, and the speed of obtaining the static resources and the dynamic resources is improved; and further improve the response to the WEB request of the client.
In one embodiment, step S34: determining a first deployment location at a first virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the remaining first deployment locations in the first list and other first deployment locations;
calculating the variance of the relative distance;
the first deployment position with the smallest difference is the first deployment position located at the center position of the first virtual map;
step S34: determining a second deployment location at a second virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the remaining second deployment locations in the second list and other second deployment locations;
calculating the variance of the relative distance;
the second deployment position with the smallest difference is the second deployment position located at the center position of the second virtual map.
The working principle and the beneficial effects of the technical scheme are as follows:
and determining the first deployment position located at the central position according to the variance of the relative distance between the first deployment positions, so that the accuracy of the central determination is improved. Similarly, the second deployment position located at the center position is determined according to the variance of the relative distance between the second deployment positions, so that the accuracy of center determination is improved.
In one embodiment, the determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment locations on the first virtual map and the first references specifically includes:
acquiring a first distance judgment value of a first secondary standard and a first standard;
determining a first secondary reference based on the first distance decision value and the distance of the other first deployment location on the first virtual map from the first reference; the error between the distance of the first secondary reference from the first reference and the first distance judgment value is minimum;
determining a plurality of first judging position points according to the first initial included angles and the first distance judgment values by taking the included angle between the first secondary reference and the first reference as a first initial included angle;
calculating distances of other first deployment positions on the first virtual map from the first decision position pointThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the first virtual mapA virtual longitude and a virtual latitude corresponding to the first deployment location;represents a first distance determination value;representing a first initial included angle;is a preset constant;,representing a virtual longitude and a virtual latitude corresponding to the first reference;
determining a plurality of second secondary references in a plurality of preset directions according to distances between other second deployment positions on the second virtual map and the second references, specifically including:
acquiring a second distance judgment value of a second secondary standard and a second standard;
determining a second secondary reference based on the second distance decision value and the distance of the other second deployment location on the second virtual map from the second reference; the error of the distance between the second secondary reference and the second distance judgment value is minimum;
determining a plurality of second judgment position points according to the second initial included angle and a second distance judgment value by taking the included angle between the second secondary standard and the second standard as a second initial included angle;
calculating the distance between the other second deployment position and the second judgment position on the second virtual mapThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on a second virtual mapA virtual longitude and a virtual latitude corresponding to the second deployment location;represents a second distance determination value;representing a second initial included angle;is a preset constant;,and indicates a virtual longitude and a virtual latitude corresponding to the second reference.
The working principle and the beneficial effects of the technical scheme are as follows:
determining a plurality of first deployment positions from the first deployment position by taking the first deployment position of the central position as a reference, deploying static resources at the first deployment position taken as the reference and the other determined plurality of first deployment positions, determining a plurality of second deployment positions from the second deployment position by taking the second deployment position of the central position as a reference, and deploying dynamic resources at the second deployment position taken as the reference and the other determined plurality of second deployment positions; when a WEB request of a client is received, the static resource and the dynamic resource are acquired nearby according to the position of the client, and the speed of acquiring the static resource and the dynamic resource is increased; and further improve the response to the WEB request of the client.
In one embodiment, the method for separately deploying the dynamic resource and the static resource further includes:
step S5: acquiring a Web request of a client and the position of the client;
step S6: mapping the location of the client to a first virtual map and a second virtual map;
step S7: acquiring static resources in the Web request by using a first deployment position with a distance from a client side in a first virtual map as a preset first threshold;
step S8: and acquiring the dynamic resources in the Web request at a second deployment position which is away from the client side in the second virtual map and is a preset second threshold value.
The working principle and the beneficial effects of the technical scheme are as follows:
when a WEB request of a client is received, the position of the client is synchronously acquired, the position of the client is mapped into a first virtual map and a second virtual map, and static resources and dynamic resources are acquired nearby according to the position of the client, so that the speed of acquiring the static resources and the dynamic resources is improved; and further improve the response to the WEB request of the client.
The invention also provides a system for separately deploying dynamic resources and static resources, which comprises:
the Web resource acquisition module is used for acquiring Web resources and separating static resources and dynamic resources;
a list obtaining module, configured to obtain a first list and a second list, where the first list includes: a plurality of first deployment locations for static resource deployment, the second list comprising: a plurality of second deployment locations for dynamic resource deployment;
the static resource deployment module is used for screening out a first deployment position from the first list based on a first preset rule and deploying the static resource;
and the dynamic resource deployment module is used for screening out a second deployment position from the second list based on a second preset rule and deploying the dynamic resource.
The working principle and the beneficial effects of the technical scheme are as follows:
the method comprises the steps of firstly separating Web resources into static resources and dynamic resources, and separately deploying the static resources and the dynamic resources to provide a data basis for responding WEB services. Then, acquiring a first list of a plurality of first deployment positions where static resources can be deployed and a second list of a plurality of second deployment positions where dynamic static resources can be deployed, specifically: inquiring nodes deployed by each static resource in the WEB system when the Web resource is received, and adding the static resource into a first list after receiving the response of the nodes deployed by the static resource; and inquiring each dynamic resource deployed node in the WEB system when the Web resource is received, and adding the dynamic resource into the second list after receiving the response of the dynamic resource deployed node. Finally, screening out a first deployment position from the first list and deploying the static resources based on a first preset rule, and screening out a second deployment position from the second list and deploying the dynamic resources based on a second preset rule; and realizing the separate deployment of the static resources and the dynamic resources. The first preset rule and the second preset rule may both include one or more of parameters [ hardware parameters, software version numbers, response speeds, network transmission speeds, and the like ] of the first deployment location, and a real location of the first deployment location.
According to the system for separately deploying the dynamic resources and the static resources, the dynamic resources and the static resources are separately deployed at different deployment positions, and when a WEB request of a client is received, the static resources and the dynamic resources in the WEB request are acquired from the different deployment positions, so that the speed of acquiring the dynamic resources is increased, and further the response speed of WEB service is increased.
In one embodiment, the static resource deployment module performs operations comprising:
determining the size of a static resource to be deployed;
deleting a first deployment position of which the deployable residual capacity is smaller than or equal to the size of the static resource in the first list;
establishing a first virtual map based on spatial position attributes corresponding to the remaining first deployment positions in the first list;
determining a first deployment location at a first virtual map center location;
taking a first deployment position located at the center position of a first virtual map as a first reference, and when the maximum distance between the other first deployment positions on the first virtual map and the reference is greater than a first preset value, determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first reference;
deploying the static resource at a first deployment location as a first reference and a first secondary reference;
the dynamic resource deployment module executes the following operations:
determining the size of a dynamic resource to be deployed;
deleting a second deployment position of which the deployable residual capacity is less than or equal to the size of the dynamic resource in the second list;
establishing a second virtual map based on the spatial position attribute corresponding to the remaining second deployment positions in the second list;
determining a second deployment location at a second virtual map center location;
taking a second deployment position located at the center position of the second virtual map as a second reference, and when the maximum distance between the second deployment position on the second virtual map and the second reference is greater than a second preset value, determining a plurality of second secondary references in a plurality of preset directions according to the distance between the second deployment position on the second virtual map and the second reference;
the dynamic resource is deployed at the first deployment location as a second benchmark and a second secondary benchmark.
The working principle and the beneficial effects of the technical scheme are as follows:
first, a first step of screening is carried out on a first deployment position and a second deployment position in a first list and a second list according to the size of a static resource and a dynamic resource in a WEB resource, and the deployment positions with the residual capacity smaller than the size of the static resource and the size of the dynamic resource are removed. Mapping the first deployment position and the second deployment position to a first virtual map and a second virtual map respectively, and performing multipoint deployment according to virtual longitudes and virtual latitudes of the first deployment position and the second deployment position in the first virtual map and the second virtual map; when a WEB request of a client is received, static resources and dynamic resources can be conveniently obtained nearby according to the position of the client, and the speed of obtaining the static resources and the dynamic resources is improved; and further improve the response to the WEB request of the client.
In one embodiment, a first deployment location is determined that is centered on a first virtual map; the method specifically comprises the following steps:
calculating relative distances between the remaining first deployment locations in the first list and other first deployment locations;
calculating the variance of the relative distance;
the first deployment position with the smallest difference is the first deployment position located at the center position of the first virtual map;
determining a second deployment location at a second virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the remaining second deployment locations in the second list and other second deployment locations;
calculating the variance of the relative distance;
the second deployment position with the smallest difference is the second deployment position located at the center position of the second virtual map.
The working principle and the beneficial effects of the technical scheme are as follows:
and determining the first deployment position located at the central position according to the variance of the relative distance between the first deployment positions, so that the accuracy of the central determination is improved. Similarly, the second deployment position located at the center position is determined according to the variance of the relative distance between the second deployment positions, so that the accuracy of center determination is improved.
In one embodiment, the determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment locations on the first virtual map and the first references specifically includes:
acquiring a first distance judgment value of a first secondary standard and a first standard;
determining a first secondary reference based on the first distance decision value and the distance of the other first deployment location on the first virtual map from the first reference; the error between the distance of the first secondary reference from the first reference and the first distance judgment value is minimum;
determining a plurality of first judging position points according to the first initial included angles and the first distance judgment values by taking the included angle between the first secondary reference and the first reference as a first initial included angle;
calculating distances of other first deployment positions on the first virtual map from the first decision position pointThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the first virtual mapA virtual longitude and a virtual latitude corresponding to the first deployment location;represents a first distance determination value;representing a first initial included angle;is a preset constant;,representing a virtual longitude and a virtual latitude corresponding to the first reference;
determining a plurality of second secondary references in a plurality of preset directions according to distances between other second deployment positions on the second virtual map and the second references, specifically including:
acquiring a second distance judgment value of a second secondary standard and a second standard;
determining a second secondary reference based on the second distance decision value and the distance of the other second deployment location on the second virtual map from the second reference; the error of the distance between the second secondary reference and the second distance judgment value is minimum;
determining a plurality of second judgment position points according to the second initial included angle and a second distance judgment value by taking the included angle between the second secondary standard and the second standard as a second initial included angle;
calculating the distance between the other second deployment position and the second judgment position on the second virtual mapThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on a second virtual mapA virtual longitude and a virtual latitude corresponding to the second deployment location;represents a second distance determination value;representing a second initial included angle;is a preset constant;,and indicates a virtual longitude and a virtual latitude corresponding to the second reference.
The working principle and the beneficial effects of the technical scheme are as follows:
determining a plurality of first deployment positions from the first deployment position by taking the first deployment position of the central position as a reference, deploying static resources at the first deployment position taken as the reference and the other determined plurality of first deployment positions, determining a plurality of second deployment positions from the second deployment position by taking the second deployment position of the central position as a reference, and deploying dynamic resources at the second deployment position taken as the reference and the other determined plurality of second deployment positions; when a WEB request of a client is received, the static resource and the dynamic resource are acquired nearby according to the position of the client, and the speed of acquiring the static resource and the dynamic resource is increased; and further improve the response to the WEB request of the client.
In one embodiment, the system for separately deploying dynamic resources and static resources further includes:
the Web request acquisition module is used for acquiring a Web request of a client and the position of the client;
a mapping module for mapping a location of a client to a first virtual map and a second virtual map;
the static resource acquisition module is used for acquiring static resources in the Web request at a first deployment position with a distance from the client side in the first virtual map as a preset first threshold;
and the dynamic resource acquisition module is used for acquiring the dynamic resources in the Web request at a second deployment position with the distance from the client side in the second virtual map as a preset second threshold value.
The working principle and the beneficial effects of the technical scheme are as follows:
when a WEB request of a client is received, the position of the client is synchronously acquired, the position of the client is mapped into a first virtual map and a second virtual map, and static resources and dynamic resources are acquired nearby according to the position of the client, so that the speed of acquiring the static resources and the dynamic resources is improved; and further improve the response to the WEB request of the client.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A method for separate deployment of dynamic resources and static resources is characterized by comprising the following steps:
step S1: acquiring Web resources and separating static resources and dynamic resources;
step S2: obtaining a first list and a second list, wherein the first list comprises: a plurality of first deployment locations for the static resource deployment, the second list comprising: a plurality of second deployment locations for the dynamic resource deployment;
step S3: screening out the first deployment position from the first list based on a first preset rule and deploying the static resource;
step S4: and screening the second deployment position from the second list based on a second preset rule and deploying the dynamic resource.
2. The method for separate deployment of dynamic resources and static resources according to claim 1, wherein the step S3: screening out the first deployment position from the first list and deploying the static resource based on a first preset rule, specifically comprising:
step S31: determining the size of the static resource to be deployed;
step S32: deleting the first deployment position with the deployable residual capacity less than or equal to the size of the static resource in the first list;
step S33: establishing a first virtual map based on spatial position attributes corresponding to the remaining first deployment positions in the first list;
step S34: determining the first deployment location at the first virtual map center location;
step S35: taking the first deployment position located at the center position of the first virtual map as a first reference, and when the maximum distance between the other first deployment positions on the first virtual map and the reference is greater than a first preset value, determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first reference;
step S36: deploying the static resource at the first deployment location as the first benchmark and the first secondary benchmark;
the step S4: screening out the second deployment position from the second list based on a second preset rule and deploying the dynamic resource, specifically comprising:
step S41: determining the size of the dynamic resource to be deployed;
step S42: deleting the second deployment position with the deployable residual capacity less than or equal to the size of the dynamic resource in the second list;
step S43: establishing a second virtual map based on spatial location attributes corresponding to the second deployment locations remaining in the second list;
step S44: determining the second deployment location at the second virtual map center location;
step S45: taking the second deployment position located at the center position of the second virtual map as a second reference, and when the maximum distance between the other second deployment positions on the second virtual map and the second reference is greater than a second preset value, determining a plurality of second secondary references in a plurality of preset directions according to the distances between the other second deployment positions on the second virtual map and the second reference;
step S46: deploying the dynamic resource at the first deployment location as the second benchmark and the second secondary benchmark.
3. The method for separate deployment of dynamic resources and static resources according to claim 2, wherein the step S34: determining the first deployment location at the first virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the first deployment locations remaining in the first list and the other first deployment locations;
calculating a variance of the relative distance;
the first deployment position with the minimum variance is the first deployment position located at the center position of the first virtual map;
the step S34: determining the second deployment location at the second virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the second deployment locations remaining in the second list and the other second deployment locations;
calculating a variance of the relative distance;
the second deployment position with the minimum variance is the second deployment position located at the center position of the second virtual map.
4. The method for separate deployment of dynamic resources and static resources according to claim 2, wherein the determining a plurality of first secondary references in a plurality of preset directions according to the distances between the first deployment locations on the first virtual map and the first references specifically includes:
acquiring a first distance judgment value of the first secondary reference and the first reference;
determining a first secondary reference based on the first distance decision value and the distance of the other first deployment locations on the first virtual map from the first reference; the distance of the first secondary reference from the first reference and the first distance decision value error are minimum;
determining a plurality of first judging position points according to the first initial included angles and the first distance judging values by taking the included angle between the first secondary reference and the first reference as a first initial included angle;
calculating distances of the other first deployment locations on the first virtual map from the first determination location pointThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the first virtual mapA virtual longitude and a virtual latitude corresponding to the first deployment location;represents a first distance determination value;representing the first initial included angle;is a preset constant;,representing a virtual longitude and a virtual latitude corresponding to the first reference;
the determining, according to the distances between the other second deployment positions on the second virtual map and the second reference, a plurality of second secondary references in a plurality of preset directions specifically includes:
acquiring a second distance judgment value of the second secondary standard and the second standard;
determining a second secondary reference based on the second distance decision value and the distance of the other second deployment location on the second virtual map from the second reference; the error between the distance of the second secondary reference from the second reference and the second distance determination value is minimum;
determining a plurality of second judgment position points according to the second initial included angle and the second distance judgment value by taking the included angle between the second secondary standard and the second standard as a second initial included angle;
calculating distances between the second deployment positions and the second judgment position points on the second virtual mapThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the second virtual mapA virtual longitude and a virtual latitude corresponding to the second deployment location;represents a second distance determination value;representing the second initial included angle;is a preset constant;,and the virtual longitude and the virtual latitude corresponding to the second reference are represented.
5. The method for split deployment of dynamic and static resources according to claim 4, further comprising:
step S5: acquiring a Web request of a client and the position of the client;
step S6: mapping the location of the client to the first virtual map and the second virtual map;
step S7: acquiring the static resource in the Web request by using the first deployment position which is away from the client in the first virtual map and is a preset first threshold;
step S8: and acquiring the dynamic resources in the Web request by using the second deployment position which is in the second virtual map and is away from the client as a preset second threshold.
6. A system for separate deployment of dynamic resources and static resources, comprising:
the Web resource acquisition module is used for acquiring Web resources and separating static resources and dynamic resources;
a list obtaining module, configured to obtain a first list and a second list, where the first list includes: a plurality of first deployment locations for the static resource deployment, the second list comprising: a plurality of second deployment locations for the dynamic resource deployment;
the static resource deployment module is used for screening out the first deployment position from the first list based on a first preset rule and deploying the static resource;
and the dynamic resource deployment module is used for screening out the second deployment position from the second list based on a second preset rule and deploying the dynamic resource.
7. The system for split deployment of dynamic and static resources of claim 6, wherein the static resource deployment module performs operations comprising:
determining the size of the static resource to be deployed;
deleting the first deployment position with the deployable residual capacity less than or equal to the size of the static resource in the first list;
establishing a first virtual map based on spatial position attributes corresponding to the remaining first deployment positions in the first list;
determining the first deployment location at the first virtual map center location;
taking the first deployment position located at the center position of the first virtual map as a first reference, and when the maximum distance between the other first deployment positions on the first virtual map and the reference is greater than a first preset value, determining a plurality of first secondary references in a plurality of preset directions according to the distances between the other first deployment positions on the first virtual map and the first reference;
deploying the static resource at the first deployment location as the first benchmark and the first secondary benchmark;
the dynamic resource deployment module performs operations comprising:
determining the size of the dynamic resource to be deployed;
deleting the second deployment position with the deployable residual capacity less than or equal to the size of the dynamic resource in the second list;
establishing a second virtual map based on spatial location attributes corresponding to the second deployment locations remaining in the second list;
determining the second deployment location at the second virtual map center location;
taking the second deployment position located at the center position of the second virtual map as a second reference, and when the maximum distance between the other second deployment positions on the second virtual map and the second reference is greater than a second preset value, determining a plurality of second secondary references in a plurality of preset directions according to the distances between the other second deployment positions on the second virtual map and the second reference;
deploying the dynamic resource at the first deployment location as the second benchmark and the second secondary benchmark.
8. The system for split deployment of dynamic and static resources according to claim 7, wherein said determining said first deployment location is centered on said first virtual map; the method specifically comprises the following steps:
calculating relative distances between the first deployment locations remaining in the first list and the other first deployment locations;
calculating a variance of the relative distance;
the first deployment position with the minimum variance is the first deployment position located at the center position of the first virtual map;
the determining the second deployment location at the second virtual map center location; the method specifically comprises the following steps:
calculating relative distances between the second deployment locations remaining in the second list and the other second deployment locations;
calculating a variance of the relative distance;
the second deployment position with the minimum variance is the second deployment position located at the center position of the second virtual map.
9. The system for separate deployment of dynamic resources and static resources according to claim 7, wherein the determining a plurality of first secondary references in a plurality of preset directions according to the distances between the first deployment locations on the first virtual map and the first references specifically includes:
acquiring a first distance judgment value of the first secondary reference and the first reference;
determining a first secondary reference based on the first distance decision value and the distance of the other first deployment locations on the first virtual map from the first reference; the distance of the first secondary reference from the first reference and the first distance decision value error are minimum;
determining a plurality of first judging position points according to the first initial included angles and the first distance judging values by taking the included angle between the first secondary reference and the first reference as a first initial included angle;
calculating the saidDistances of other first deployment locations on a first virtual map from the first decision location pointThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the first virtual mapA virtual longitude and a virtual latitude corresponding to the first deployment location;represents a first distance determination value;representing the first initial included angle;is a preset constant;,representing a virtual longitude and a virtual latitude corresponding to the first reference;
the determining, according to the distances between the other second deployment positions on the second virtual map and the second reference, a plurality of second secondary references in a plurality of preset directions specifically includes:
acquiring a second distance judgment value of the second secondary standard and the second standard;
determining a second secondary reference based on the second distance decision value and the distance of the other second deployment location on the second virtual map from the second reference; the error between the distance of the second secondary reference from the second reference and the second distance determination value is minimum;
determining a plurality of second judgment position points according to the second initial included angle and the second distance judgment value by taking the included angle between the second secondary standard and the second standard as a second initial included angle;
calculating distances between the second deployment positions and the second judgment position points on the second virtual mapThe calculation formula is as follows:
wherein the content of the first and second substances,,representing the second on the second virtual mapA virtual longitude and a virtual latitude corresponding to the second deployment location;represents a second distance determination value;representing the second initial included angle;is a preset constant;,and the virtual longitude and the virtual latitude corresponding to the second reference are represented.
10. The system for decoupled deployment of dynamic and static resources according to claim 9, further comprising:
the Web request acquisition module is used for acquiring a Web request of a client and the position of the client;
a mapping module to map a location of the client to the first virtual map and the second virtual map;
a static resource obtaining module, configured to obtain the static resource in the Web request at the first deployment location in the first virtual map, where a distance from the client is a preset first threshold;
and the dynamic resource acquisition module is used for acquiring the dynamic resources in the Web request according to the second deployment position with the distance from the client side in the second virtual map as a preset second threshold value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010671499.4A CN111562989B (en) | 2020-07-14 | 2020-07-14 | Method and device for separate deployment of dynamic resources and static resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010671499.4A CN111562989B (en) | 2020-07-14 | 2020-07-14 | Method and device for separate deployment of dynamic resources and static resources |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111562989A true CN111562989A (en) | 2020-08-21 |
CN111562989B CN111562989B (en) | 2020-11-10 |
Family
ID=72070167
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010671499.4A Active CN111562989B (en) | 2020-07-14 | 2020-07-14 | Method and device for separate deployment of dynamic resources and static resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111562989B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103347089A (en) * | 2013-07-16 | 2013-10-09 | 星云融创(北京)信息技术有限公司 | Method and device for separating and accelerating dynamic resources and static resources of website |
CN105956030A (en) * | 2016-04-25 | 2016-09-21 | 浪潮电子信息产业股份有限公司 | WEB system and WEB request processing method |
CN107547596A (en) * | 2016-06-27 | 2018-01-05 | 中兴通讯股份有限公司 | A kind of cloud platform control method and device based on Docker |
US20180276044A1 (en) * | 2017-03-27 | 2018-09-27 | International Business Machines Corporation | Coordinated, topology-aware cpu-gpu-memory scheduling for containerized workloads |
CN108833517A (en) * | 2018-06-05 | 2018-11-16 | 中国平安人寿保险股份有限公司 | Data processing system, method, electronic equipment and storage medium |
-
2020
- 2020-07-14 CN CN202010671499.4A patent/CN111562989B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103347089A (en) * | 2013-07-16 | 2013-10-09 | 星云融创(北京)信息技术有限公司 | Method and device for separating and accelerating dynamic resources and static resources of website |
CN105956030A (en) * | 2016-04-25 | 2016-09-21 | 浪潮电子信息产业股份有限公司 | WEB system and WEB request processing method |
CN107547596A (en) * | 2016-06-27 | 2018-01-05 | 中兴通讯股份有限公司 | A kind of cloud platform control method and device based on Docker |
US20180276044A1 (en) * | 2017-03-27 | 2018-09-27 | International Business Machines Corporation | Coordinated, topology-aware cpu-gpu-memory scheduling for containerized workloads |
CN108833517A (en) * | 2018-06-05 | 2018-11-16 | 中国平安人寿保险股份有限公司 | Data processing system, method, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111562989B (en) | 2020-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
USRE41983E1 (en) | Method of organizing and compressing spatial data | |
CN107341220B (en) | Multi-source data fusion method and device | |
CN107462910B (en) | Cloud fusion-based field data measurement and real-time processing method | |
US11449898B2 (en) | Method, device, and storage medium for recommending point of interest for location-based service | |
WO2007001660A2 (en) | Positioning service utilizing existing radio base stations | |
JP2002259422A (en) | Environment interactive context-aware device, and method | |
CN109934892A (en) | Inertial navigation motion profile method for drafting, device and computer equipment | |
CN108537352A (en) | A kind of data processing method, device and server | |
US20130328882A1 (en) | Named Area Generation | |
JP6149080B2 (en) | Measurement data collection system, server device, terminal device, program, and measurement data collection method | |
US20190011269A1 (en) | Position estimation device, position estimation method, and recording medium | |
CN106131102A (en) | A kind of method and device of distribution server | |
CN111194001A (en) | LTE fingerprint positioning correction method, device and system | |
CN114500428A (en) | Navigation sharing method and device, electronic equipment, storage medium and program product | |
CN111562989B (en) | Method and device for separate deployment of dynamic resources and static resources | |
CN107454100B (en) | Data processing method, device and server | |
CN108427710B (en) | Enterprise data visualization processing method, server and storage medium | |
CN109639767A (en) | A kind of Service Gateway data processing method, device, equipment | |
CN107580297B (en) | Meteorological data transmission method and accurate push system based on meteorological base stations and mobile terminals of various regions | |
Sik et al. | Toward cognitive data analysis with big data environment | |
CN110247989A (en) | The geographical position information acquisition method and system of smart home device | |
KR100776821B1 (en) | Method for representing location information with local geographical code and Apparatus thereof | |
CN114448849B (en) | Method for detecting supporting mode of IPv6 network of website and electronic equipment | |
CN110691023B (en) | Address system | |
Pratama et al. | Implementation Messaging Broker Middleware for Architecture of Public Transportation Monitoring System |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |