CN108334442A - A kind of test method and device of simulation search main broadcaster - Google Patents

A kind of test method and device of simulation search main broadcaster Download PDF

Info

Publication number
CN108334442A
CN108334442A CN201710040545.9A CN201710040545A CN108334442A CN 108334442 A CN108334442 A CN 108334442A CN 201710040545 A CN201710040545 A CN 201710040545A CN 108334442 A CN108334442 A CN 108334442A
Authority
CN
China
Prior art keywords
main broadcaster
data
simulation
map server
simulation main
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
Application number
CN201710040545.9A
Other languages
Chinese (zh)
Other versions
CN108334442B (en
Inventor
周志刚
胡卫谊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710040545.9A priority Critical patent/CN108334442B/en
Publication of CN108334442A publication Critical patent/CN108334442A/en
Application granted granted Critical
Publication of CN108334442B publication Critical patent/CN108334442B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/78Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25808Management of client data
    • H04N21/25841Management of client data involving the geographical location of the client

Abstract

An embodiment of the present invention provides a kind of test method and device of simulation search main broadcaster, the method includes:N number of simulation main broadcaster's data, each data simulated main broadcaster's data and be used to simulate a true main broadcaster are sent to map server, simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation main broadcaster position, and N is positive integer;It creates and runs first thread, the first thread is for generating M searching request, described search request includes analog subscriber data, the analog subscriber data are used to simulate the data of a real user, and the analog subscriber data include at least an analog subscriber mark and an analog subscriber position, M is positive integer;The M searching request is sent to the map server;The search result that the map server returns is received, and using described search result as the test result.

Description

A kind of test method and device of simulation search main broadcaster
Technical field
The present invention relates to field of computer technology more particularly to a kind of test methods and device of simulation search main broadcaster.
Background technology
Network direct broadcasting (hereinafter referred to as " being broadcast live ") has succeeded a kind of completely new entertainment way.In the prior art, Yong Huke To directly input or select the live streaming to be watched of oneself determination, direct broadcast server is then asked to provide corresponding live streaming.But have When, user can not may determine oneself interested live streaming.So direct broadcast server or other servers can also be pushed away to user Recommend live streaming.
A kind of way of recommendation is:According to user current location, main broadcaster position is recommended to be located at the live streaming near user to user Or main broadcaster.This way of recommendation needs the map server for providing positioning service to have higher stability, ensures in main broadcaster Accurate result is still capable of providing when quantity and/or more number of users.
Therefore, just seem particularly significant to the test of map server.
Invention content
An embodiment of the present invention provides a kind of test methods and device of simulation search main broadcaster, are searched for passing through analog subscriber Rope tests map server.
In a first aspect, the present invention provides a kind of test methods of simulation search main broadcaster, including:
N number of simulation main broadcaster's data are sent to map server, each main broadcaster's data of simulating are for simulating a true main broadcaster Data, simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation main broadcaster position, and N is positive integer;
First thread is created and runs, for the first thread for generating M searching request, described search request includes mould Quasi- user data, the analog subscriber data are used to simulate the data of a real user, and the analog subscriber data are at least Including an analog subscriber mark and an analog subscriber position, M is positive integer;
The M searching request is sent to the map server, so that the map server is based on each mould Quasi- user data and N number of simulation main broadcaster's data, searching out the simulation main broadcaster position, to be located at the analog subscriber position attached Close simulation main broadcaster mark;
The search result that the map server returns is received, and using described search result as the test result, institute It states search result and includes at least the simulation main broadcaster mark searched out.
Optionally, N number of simulation main broadcaster's data are sent to map server, including:
The curl_easy_perform interfaces of libcurl are called to be sent to the data creation interface of the map server N number of simulation main broadcaster's data;
The M searching request is sent to the map server, including:
The curl_easy_perform interfaces of libcurl are called to be sent to the data search interface of the map server The M searching request.
Optionally, the method further includes:
Record the simulation main broadcaster mark of K sent to the map server simulation main broadcaster's data;K is Positive integer less than or equal to N;
Based on the K simulation main broadcaster marks, K simulation update main broadcaster's data are generated;Wherein, each simulation update Main broadcaster's data include at least the simulation main broadcaster and identify and simulate update main broadcaster position;
K simulation update main broadcaster's data are sent to the map server, so that the map server is according to institute It is that the simulation updates main broadcaster position that simulation main broadcaster mark, which is stated, by corresponding simulation main broadcaster's location updating.
Optionally, the method further includes:
It is identified based on the Q simulation main broadcasters in the K simulation main broadcaster marks and generates Q removal request;Wherein, Q is Positive integer less than or equal to K;
The Q removal requests are sent to the map server, so that the map server is deleted according to each described Corresponding simulation main broadcaster's data are deleted except the simulation main broadcaster of request instruction identifies.
Optionally, it is spaced to the map server according to first and sends simulation main broadcaster's data, according to the second interval The removal request is sent to the map server;
As Q=K, second interval is less than described first and is spaced.
Second aspect, the present invention provides a kind of test devices of simulation search main broadcaster, including:
First sending module, for sending N number of simulation main broadcaster's data to map server, each main broadcaster's data of simulating are used for The data of a true main broadcaster are simulated, simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation main broadcaster Position, N are positive integer;
Module is created and runs, for creating and running first thread, the first thread is asked for generating M search It asks, described search request includes analog subscriber data, and the analog subscriber data are used to simulate the data of a real user, and The analog subscriber data include at least an analog subscriber mark and an analog subscriber position, and M is positive integer;
Second sending module, for sending the M searching request to the map server, so that the Map Services Device is based on each analog subscriber data and N number of simulation main broadcaster's data, searches out the simulation main broadcaster position and is located at institute State the simulation main broadcaster mark near analog subscriber position;
Test result obtains module, the search result returned for receiving the map server, and by described search knot For fruit as the test result, described search result includes at least the simulation main broadcaster mark searched out.
Optionally, first sending module is used to call the curl_easy_perform interfaces of libcurl to described The data creation interface of figure server sends N number of simulation main broadcaster's data;
Second sending module is used to call the curl_easy_perform interfaces of libcurl to the Map Services The data search interface of device sends the M searching request.
Optionally, described device further includes:
Logging modle, the mould for recording the K sent to the map server simulation main broadcaster's data Quasi- main broadcaster's mark;K is the positive integer less than or equal to N;
Update module, for based on the K simulation main broadcaster marks, generating K simulation update main broadcaster's data;Wherein, often A simulation update main broadcaster's data include at least the simulation main broadcaster and identify and simulate update main broadcaster position;
Third sending module, for sending K simulation update main broadcaster's data to the map server, so that described It is that the simulation updates main broadcaster that map server, which is identified according to the simulation main broadcaster by corresponding simulation main broadcaster's location updating, Position.
Optionally, described device further includes:
Removing module generates Q deletion for being identified based on the Q simulation main broadcasters in the K simulation main broadcaster marks Request;Wherein, Q is the positive integer less than or equal to K;
4th sending module, for sending the Q removal requests to the map server, so that the Map Services Device identifies according to the simulation main broadcaster of each removal request instruction and deletes corresponding simulation main broadcaster's data.
Optionally, first sending module is spaced to the map server according to first and sends simulation main broadcaster's number According to the 4th sending module is spaced to the map server according to second and sends the removal request;
As Q=K, second interval is less than described first and is spaced.
Said one in the embodiment of the present application or multiple technical solutions at least have following one or more technology effects Fruit:
In the technical solution of the embodiment of the present invention, N number of simulation main broadcaster's data, Mei Gemo are sent to map server first Quasi- main broadcaster's data are used to simulate the data of a true main broadcaster, and simulation main broadcaster's data include at least simulation main broadcaster's mark With a simulation main broadcaster position, N is positive integer;Then first thread is created and runs, the first thread is searched for generating M Rope is asked, and described search request includes analog subscriber data, and the analog subscriber data are used to simulate the number of a real user According to, and the analog subscriber data include at least an analog subscriber mark and an analog subscriber position, M is positive integer;And The M searching request is sent to the map server, so that the map server is based on each analog subscriber number According to N number of simulation main broadcaster's data, search out the simulation main broadcaster position be located at it is described near the analog subscriber position Simulate main broadcaster's mark;The search result that the map server returns finally is received, and using described search result as the survey Test result, described search result include at least the simulation main broadcaster mark searched out.So the N number of simulation master for passing through transmission Multicast data sends main broadcaster's data to simulate N number of true main broadcaster to map server, and generates and sends M search instruction and carry out mould Intend M real user and send search instruction to map server, and then simulates M user and ask near map server search The scene of main broadcaster, thus tests map server.
Description of the drawings
Fig. 1 is the test method of simulation search main broadcaster in the embodiment of the present invention;
Fig. 2 is the test device of simulation search main broadcaster in the embodiment of the present invention.
Specific implementation mode
An embodiment of the present invention provides a kind of test methods and device of simulation search main broadcaster, are searched for passing through analog subscriber Rope tests map server.
In order to solve the above technical problem, the present invention provides technical solution general thought it is as follows:
In the technical solution of the embodiment of the present invention, N number of simulation main broadcaster's data, Mei Gemo are sent to map server first Quasi- main broadcaster's data are used to simulate the data of a true main broadcaster, and simulation main broadcaster's data include at least simulation main broadcaster's mark With a simulation main broadcaster position, N is positive integer;Then first thread is created and runs, the first thread is searched for generating M Rope is asked, and described search request includes analog subscriber data, and the analog subscriber data are used to simulate the number of a real user According to, and the analog subscriber data include at least an analog subscriber mark and an analog subscriber position, M is positive integer;And The M searching request is sent to the map server, so that the map server is based on each analog subscriber number According to N number of simulation main broadcaster's data, search out the simulation main broadcaster position be located at it is described near the analog subscriber position Simulate main broadcaster's mark;The search result that the map server returns finally is received, and using described search result as the survey Test result, described search result include at least the simulation main broadcaster mark searched out.So the N number of simulation master for passing through transmission Multicast data sends main broadcaster's data to simulate N number of true main broadcaster to map server, and generates and sends M search instruction and carry out mould Intend M real user and send search instruction to map server, and then simulates M user and ask near map server search The scene of main broadcaster, thus tests map server.
Technical solution of the present invention is described in detail below by attached drawing and specific embodiment, it should be understood that the application Specific features in embodiment and embodiment are the detailed description to technical scheme, rather than to present techniques The restriction of scheme, in the absence of conflict, the technical characteristic in the embodiment of the present application and embodiment can be combined with each other.
The terms "and/or", only a kind of incidence relation of description affiliated partner, indicates that there may be three kinds of passes System, for example, A and/or B, can indicate:Individualism A exists simultaneously A and B, these three situations of individualism B.In addition, herein Middle character "/", it is a kind of relationship of "or" to typically represent forward-backward correlation object.
First aspect present invention provides a kind of test method of simulation search main broadcaster, referring to FIG. 1, this method includes:
S101:N number of simulation main broadcaster's data are sent to map server;
S102:It creates and runs first thread;
S103:The M searching request is sent to the map server;
S104:The search result that the map server returns is received, and is tied described search result as the test Fruit.
Specifically, for the application scenarios of analog map server, first in S101, N is sent to map server A simulation main broadcaster's data.
Specifically, simulation main broadcaster's data in the embodiment of the present invention are for simulating the number that main broadcaster sends to map server According to, therefore data type, agreement, data packet for simulating main broadcaster's data etc. is consistent with the data that true main broadcaster sends.One mould The data of quasi- main broadcaster one true main broadcaster of digital simulation, therefore N number of simulation main broadcaster's data are sent to map server, simulation is N number of Main broadcaster accesses map server, and to map server transmission data.
Wherein, N indicates the number of simulation main broadcaster's data, and N is positive integer.During specific implementation, neck belonging to the present invention The those of ordinary skill in domain can be not particularly limited according to the value of actual setting N, the present invention.For example, if daily About 3000 main broadcasters provide live streaming, then can N be set as 3000.N then can more be tested out closer to true main broadcaster's quantity The performance of map server when true application.N is bigger, then can more test the stability of map server.
Each simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation main broadcaster position.Wherein, main broadcaster It is identified as the unique mark of a main broadcaster, such as ID or main broadcaster's name etc., main broadcaster position indicates the main broadcaster current location that positioning obtains. Further, if true main broadcaster's data further include the other types data such as main broadcaster's gender, city of residence and grade, master is simulated Multicast data should also be as accordingly including the analogue data of consistent type, just no longer be described in detail herein.
Optionally, map server records and safeguards main broadcaster's data, is realized by a table.Therefore, before S101, Further include:
Map server is asked to create the table for recording and safeguarding main broadcaster's data.
Specifically, map server externally provides table and creates interface, and in test, test device is to will test The table of map server create interface and send corresponding HTTP (hypertext transfer protocol, HyperText Transfer Protocol it) asks, and then the map server is asked to create table.It, can for the ease of creating table for test device The HTTP request for creating table is sent using libcurl.The major function of libcurl is with different agreement connections and to link up Different servers supports HTTP, HTTPS (Hyper text transfer security protocol, Hypertext Transfer Protocol Secure), the agreements such as FTP (File Transfer Protocol, File Transfer Protocol).
Specifically, in embodiments of the present invention, HTTP is arranged by the curl_easy_setopt interfaces of libcurl Address.As an example it is assumed that the HTTP request address that the setting of curl_easy_setopt interfaces creates table is http:// xxx.amap.com/datamanage/table/create.Wherein, amap.com indicates map server domain name ,/ Datamanage/table/create is then that table creates interface IP address.Then pass through the curl_easy_ of libcurl The request for creating table is sent to map server by perform interfaces.
After success creates table in map server, so that it may be sent to map server progress so that main broadcaster's data will be simulated It stores.
In embodiments of the present invention, simulation main broadcaster data can be pre-stored fixed analogue data, such as each There are about 3000 main broadcasters to be broadcast live, then can prestore 3000 simulation main broadcaster's data, or by all masters in any day The true main broadcaster's data record broadcast is got off, and using these true main broadcaster's data as fixed-analog data.
Certainly, due to during specific implementation, the position of each main broadcaster has randomness, therefore, every time test with Machine generates simulation main broadcaster's data and is more nearly real scene.Specifically, if random generate simulation main broadcaster's data, in this hair In bright embodiment, need to create the second thread for generating simulation main broadcaster's data.
To those skilled in the art, it can specifically create a primary operation and generate N number of simulation main broadcaster's data Second thread, then primary second thread of operation, will obtain N number of simulation main broadcaster's data.Alternatively, creating a primary operation life At the second thread of simulation main broadcaster's data, then operation n times second thread, will obtain N number of simulation main broadcaster's data successively.
For example, the system API (application programming interfaces, Application Program Interface) for passing through Windows Function creates following second thread:
Wherein, LPTHREAD_START_ROUTINE lpStartAddr indicate that thread needs the logic executed.For side Just it tests, in above-mentioned thread, setting lpStartAddr is true main broadcaster's data creation function CreateLocation.Reason It is, it is function name that lpStartAddr, which is on the one hand arranged, need not rewrite code, alleviate size of code and tester On the other hand the workload of member due to directly invoking true main broadcaster's data creation function, can directly obtain and true main broadcaster The consistent simulation main broadcaster's data of data standard, less manual calibration.
In addition, in above-mentioned second thread, LPSECURITY_ATTRIBUTES lpsa are for being arranged thread-safe, because surveying It is not directed to safety test in examination, therefore is set as sky Null.DWORD cbStack indicate the storehouse size of thread, are set as Null, mark thread use default size.LPVOID lpvThreadParam indicate thread parameter, are set as Null, marking line Journey does not need parameter.DWORD fdwCreate indicate thread creation attribute, are set as Null, mark need not be concerned about thread category Property.LPDWORD lpIDThread indicate Thread Id.It is set as Null, mark need not obtain Thread Id.
During specific implementation, when CreatLocation function operations need the positioning knot that acquisition mapping function provides When fruit, a position is provided at random to CreatLocation functions.So, just raw after above-mentioned second thread end of run At simulation main broadcaster's data.
Next, in S101, N number of simulation main broadcaster's data are sent to map server.
Specifically, map server externally provides a data creation interface, and in test, test device is to will test The data creation interface of map server send corresponding HTTP request, and then ask the map server to create and record master Multicast data.
Specifically, in embodiments of the present invention, HTTP is arranged by the curl_easy_setopt interfaces of libcurl Address.For example, example above is continued to use, the domain name of map server is amap.com, and curl_easy_setopt connects The specific setting HTTP request address of mouth is http://xxx.amap.com/datasearch/./ datasearch/ creates for data Build interface IP address.Then each simulation main broadcaster's data are sent to ground by the curl_easy_perform interfaces of libcurl Figure server.
Map server often receives simulation main broadcaster's data, will be identified according to simulation main broadcaster and store corresponding simulation main broadcaster Position.Further, map server can also store the corresponding main broadcaster's gender of each main broadcaster, city of residence etc. in the table, this Invention is not particularly limited.
In addition, during specific implementation, if the operation of the second thread is primary to generate simulation main broadcaster's data, it is contemplated that Not all main broadcaster sends main broadcaster's data to map server simultaneously, therefore, every preset first interval operation one time the Two threads, and then it is preferably selection to send simulation main broadcaster's data to map server at each interval.First interval example Such as it is 10s or 20s, the application is not particularly limited.
Next, S102:It creates and runs first thread.
Specifically, first thread is for generating M searching request.Searching request is for asking map server search to be used Main broadcaster near family.Searching request includes analog subscriber data.Similar to simulation main broadcaster's data, an analog subscriber data mould Intend the data of a real user, a searching request simulates the master near the request map server search of a real user It broadcasts, then, M search instruction simulates the main broadcaster that M user asks map server search neighbouring.
Each analog subscriber data include at least an analog subscriber mark and an analog subscriber position.Analog subscriber Data type, agreement, data packet of data etc. are consistent with the data of real user.Wherein, user identifier is a user Unique mark, such as ID or user name etc., user location indicate the user current location that positioning obtains.Further, if really User data further include the other types data such as user gradation and user's gender, then analog subscriber data should also be as include accordingly The analogue data of consistent type, is just no longer described in detail herein.
During specific implementation, for the ease of test, N number of simulation main broadcaster position and M simulation in primary test are used Family position can select the position in same predeterminable area map, such as Beijing Area's map or Wuhan area map etc..
M indicates the number of analog subscriber data, and M is positive integer.It is of the art general during specific implementation Logical technical staff can be not particularly limited according to the value of actual setting M, the present invention.Citing comes institute, if daily about 106Main broadcaster near a user's search, then can be set as 10 by M6.M then can more be tested out true closer to real user quantity The performance of map server when real application.M is bigger, then can more test the stability of map server.
Similar to the second thread is created, for those skilled in the art, it can specifically create a primary operation and generate M The first thread of analog subscriber data, then the primary first thread of operation, will obtain M analog subscriber data.Alternatively, creating One primary operation generates the first thread of an analog subscriber data, then the M first thread of operation, will obtain M successively A analog subscriber data.For example, creating following first thread by the API calls of Windows:
Wherein, it tests for convenience, in above-mentioned thread, setting lpStartAddr is the letter of main broadcaster near actual search Number Search.Reason is similar with lpStartAddr is set to true CreateLocation functions above, just no longer heavy herein It repeats again.
During specific implementation, when Search function operations need to obtain the positioning result of mapping function offer, to Search functions provide a position at random.So, after above-mentioned thread end of run, it includes that simulation is used just to generate one The searching request of user data.
Next, in S103, M searching request is sent to map server.
Specifically, map server externally provides a data searching interface, and in test, test device is to will test The data search interface of map server send corresponding HTTP request, and then ask near map server search user Main broadcaster.
Specifically, in embodiments of the present invention, HTTP is arranged by the curl_easy_setopt interfaces of libcurl Address.For example, example above is continued to use, the domain name of map server is amap.com, and curl_easy_setopt connects The specific setting HTTP request address of mouth is http://xxx.amap.com/datasearch/./ datasearch/ searches for data Rope interface IP address.Then each searching request is sent to by Map Services by the curl_easy_perform interfaces of libcurl Device.
After map server receives a searching request, table, the analog subscriber position for including based on searching request are obtained It sets, the simulation main broadcaster position near the analog subscriber position is determined from the simulation main broadcaster position of charting, and be based on The simulation main broadcaster corresponding to simulation main broadcaster position near the analog subscriber position, which identifies, generates search result.Wherein, search knot Fruit includes at least the simulation main broadcaster mark searched, can also further be identified including the simulation main broadcaster each searched corresponding Main broadcaster position, main broadcaster's gender and main broadcaster's head portrait etc. are simulated, the present invention is not particularly limited.
During specific implementation, if first thread operation once generates an analog subscriber data, it is contemplated that specific It is one by one, therefore, every preset third interval that user, which asks main broadcaster near map server search, during realization A first thread is run, and then it is preferably selection to send a searching request to map server every third interval.Third For example, 10s or 20s, the present invention are not particularly limited at interval.
Finally, in S104, the search result that map server returns is received, and using search result as test result.
Administrative staff can assess map server performance and stability according to test result.Such as according to local The analog subscriber data and simulation main broadcaster's data of record, judge whether the search result that map server returns is correct, search knot The simulation main broadcaster that fruit includes identifies whether quantity reaches threshold value etc..
Further, during specific implementation, since main broadcaster position may update, in test map server When, it is also contemplated that the update to main broadcaster position.So the method in the embodiment of the present invention can also include:
Record the simulation main broadcaster mark of K sent to the map server simulation main broadcaster's data;K is Positive integer less than or equal to N;
Based on the K simulation main broadcaster marks, K simulation update main broadcaster's data are generated;Wherein, each simulation update Main broadcaster's data include at least the simulation main broadcaster and identify and simulate update main broadcaster position;
K simulation update main broadcaster's data are sent to the map server, so that the map server is according to institute It is that the simulation updates main broadcaster position that simulation main broadcaster mark, which is stated, by corresponding simulation main broadcaster's location updating.
Specifically, not fully identical at the time of transmission N number of simulation main broadcaster's data, in other words, N number of simulation main broadcaster's data In there is part first to send, sent behind part.The embodiment of the present invention assumes that the number of the simulation main broadcaster's data sent is K, and K is small In the positive integer equal to N.If update main broadcaster position, newer is the simulation main broadcaster's data not yet sent, then Map Services Device may judge that the data are wrong.So will to record sent K simulation main broadcaster's data corresponding for the embodiment of the present invention Module main broadcaster identifies.During specific implementation, test device can also create a table, often send simulation main broadcaster's data The simulation main broadcaster mark of simulation main broadcaster's data is just recorded in the table.
Next, generating K simulation update main broadcaster's data.During module update main broadcaster's data are used to update the data with simulation The same simulation main broadcaster of simulation update location updating identifies corresponding simulation main broadcaster position.Wherein, simulation update main broadcaster position is also Position in predeterminable area map.Similar to simulation main broadcaster's data, simulation update main broadcaster's data can be pre-stored fixation Analogue data, or the data generated at random.
Specifically, if the random simulation update main broadcaster's data that generate need establishment to be used in embodiments of the present invention Generate the third thread of simulation update main broadcaster's data.
For those skilled in the art, K simulation update main broadcaster's data of a primary operation generation can be specifically created Third thread, then the primary third thread of operation, will obtain K simulation update main broadcaster's data.Alternatively, creating a primary fortune Row generates the third thread of simulation update main broadcaster's data, then K second thread of operation, will obtain K simulation successively Update main broadcaster's data.For example, creating following third thread by the API calls of Windows:
Wherein, it tests for convenience, in above-mentioned thread, setting lpStartAddr is the letter of true update main broadcaster's data Number UpdateLocation.Reason is similar with lpStartAddr is set to true CreateLocation functions above, herein Just it is no longer repeated.
During specific implementation, when each run UpdateLocation functions, by UpdateLocation functions Main broadcaster's mark is revised as a simulation main broadcaster mark for having sent simulation main broadcaster's data.When UpdateLocation function operations need When the positioning result of mapping function offer is provided, a position is provided at random to UpdateLocation functions.So, After above-mentioned thread end of run, simulation update main broadcaster's data of simulation main broadcaster's mark of this modification are just generated.
Map server outer can provide a data update interface, and in test, test device takes to map to be tested The data update interface of business device sends corresponding HTTP request, and then asks map server update main broadcaster position.
Specifically, in embodiments of the present invention, HTTP is arranged by the curl_easy_setopt interfaces of libcurl Address.For example, example above is continued to use, the domain name of map server is amap.com, and curl_easy_setopt connects The specific setting HTTP request address of mouth is http://xxx.amap.com/datamanage/data/update./ Datamanage/data/update is data update interface IP address.Then it is connect by the curl_easy_perform of libcurl Mouth will simulate update main broadcaster's data and be sent to map server.
After map server receives simulation update main broadcaster's data, table is obtained, based on simulation update main broadcaster's data Main broadcaster's mark is simulated, the location updating by same simulation main broadcaster mark in table is that the simulation of simulation update main broadcaster's data updates master Broadcast position.
In addition, during specific implementation, if the operation of third thread is primary to generate simulation update main broadcaster's data, examine Consider not all main broadcaster while updating position, therefore, third thread of each preset 4th interval operation, so it is every It is spaced to map server every the 4th and updates the position of a simulation main broadcaster for preferably selection.4th interval for example, 10s or 20s, the present invention are not particularly limited.
Further, can be offline after being broadcast live due to main broadcaster during specific implementation, in test Map Services When device, it is also contemplated that the deletion to main broadcaster position.So the method in the embodiment of the present invention can also include:
It is identified based on the Q simulation main broadcasters in the K simulation main broadcaster marks and generates Q removal request;Wherein, Q is Positive integer less than or equal to K;
The Q removal requests are sent to the map server, so that the map server is deleted according to each described Corresponding simulation main broadcaster's data are deleted except the simulation main broadcaster of request instruction identifies.
Specifically, when needing to simulate deletion main broadcaster's data, what it is due to deletion is the simulation main broadcaster's data not yet sent, Then map server may judge that the data are wrong.So in embodiments of the present invention, the simulation master that will have been sent from K Q are determined in multicast data to be deleted.Wherein, Q is the positive integer less than or equal to K.
Next, after according to the Q simulation main broadcaster's data determined, Q deletion of corresponding Q simulation main broadcaster's mark is generated Request.Removal request is used to ask map server to delete the simulation main broadcaster's data of a record in the table.
Specifically, in embodiments of the present invention, it needs to create the 4th thread for generating removal request.
For those skilled in the art, the 4th thread that a primary operation generates Q removal request can be specifically created, Primary 4th thread is so run, Q removal request will be obtained.It is asked alternatively, creating a primary operation and generating a deletion The 4th thread asked, then Q the 4th thread of operation, will obtain Q removal request successively.For example, being by Windows Api function unite to create following 4th thread:
Wherein, it tests for convenience, in above-mentioned thread, setting lpStartAddr is the true letter for deleting main broadcaster's data Number DeleteLocation.Reason is similar with lpStartAddr is set to true CreateLocation functions above, herein Just it is no longer repeated.
During specific implementation, when each run DeleteLocation functions, by DeleteLocation functions Main broadcaster's mark is revised as the simulation main broadcaster mark of the Q simulation one of data of main broadcaster's data.So, above-mentioned thread end of run Afterwards, the removal request of simulation main broadcaster's mark of this modification is just generated.
Map server outer can provide a data and delete interface, and in test, test device takes to map to be tested The data of business device delete interface and send corresponding HTTP request, and then the map server is asked to delete main broadcaster's data.
Specifically, in embodiments of the present invention, HTTP is arranged by the curl_easy_setopt interfaces of libcurl Address.For example, example above is continued to use, the domain name of map server is amap.com, and curl_easy_setopt connects The specific setting HTTP request address of mouth is http://xxx.amap.com/datamanage/data/delete./ Datamanage/data/delete is that data delete interface IP address.Then it is connect by the curl_easy_perform of libcurl Each removal request is sent to map Cloud Server by mouth.
After map server receives a removal request, table is obtained, the simulation main broadcaster mark for including based on removal request Know, the position of the same simulation main broadcaster recorded in table mark and simulation main broadcaster are identified and deleted.It can also further incite somebody to action Simulation main broadcaster identifies other corresponding data and also deletes.
In addition, during specific implementation, if the operation of the 4th thread once generates a removal request, it is contemplated that not That all main broadcasters are offline simultaneously, therefore, the 4th thread of each preset second interval operation, so every second be spaced to It is preferably selection that map server, which deletes simulation main broadcaster's data,.Second interval for example, 10s or 20s, the application, which is not done, to be had Body limits.
Further, Q=K needs to delete the simulation main broadcaster's data recorded in all map server tables when testing, So, search can be normally carried out in order to ensure map server after receiving searching request and returns to search result, should set The second interval is set less than the first interval.For example, first is set to 20s, second is set to 10s.
It is created by above-mentioned simulation, the main broadcaster near update and deletion main broadcaster's data and analog subscriber search, is just simulated The application scenarios of map server are gone out, therefore by test result, i.e. search result can test out map server Stability.
Based on inventive concept same as the test method of simulation search main broadcaster in previous embodiment, second aspect of the present invention A kind of test device of simulation search main broadcaster is also provided, as shown in Fig. 2, including:
First sending module 101, it is each to simulate main broadcaster's data for sending N number of simulation main broadcaster's data to map server Data for simulating a true main broadcaster, simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation Main broadcaster position, N are positive integer;
Module 102 is created and runs, for creating and running first thread, the first thread is for generating M search Request, described search request includes analog subscriber data, and the analog subscriber data are used to simulate the data of a real user, And the analog subscriber data include at least an analog subscriber mark and an analog subscriber position, M is positive integer;
Second sending module 103, for sending the M searching request to the map server, so that the map Server is based on each analog subscriber data and N number of simulation main broadcaster's data, searches out the simulation main broadcaster position position Simulation main broadcaster mark near the analog subscriber position;
Test result obtains module 104, the search result returned for receiving the map server, and by described search As a result the test result, described search result is used as to include at least the simulation main broadcaster mark searched out.
Specifically, the first sending module 101 is used to call the curl_easy_perform interfaces of libcurl to described The data creation interface of map server sends N number of simulation main broadcaster's data.Second sending module 103 is for calling The curl_easy_perform interfaces of libcurl send the M search to the data search interface of the map server and ask It asks.
Further, the device in the embodiment of the present invention further includes:
Logging modle, the mould for recording the K sent to the map server simulation main broadcaster's data Quasi- main broadcaster's mark;K is the positive integer less than or equal to N;
Update module, for based on the K simulation main broadcaster marks, generating K simulation update main broadcaster's data;Wherein, often A simulation update main broadcaster's data include at least the simulation main broadcaster and identify and simulate update main broadcaster position;
Third sending module, for sending K simulation update main broadcaster's data to the map server, so that described It is that the simulation updates main broadcaster that map server, which is identified according to the simulation main broadcaster by corresponding simulation main broadcaster's location updating, Position.
Further, the device in the embodiment of the present invention further includes:
Removing module generates Q deletion for being identified based on the Q simulation main broadcasters in the K simulation main broadcaster marks Request;Wherein, Q is the positive integer less than or equal to K;
4th sending module, for sending the Q removal requests to the map server, so that the Map Services Device identifies according to the simulation main broadcaster of each removal request instruction and deletes corresponding simulation main broadcaster's data.
Further, the first sending module 101 is spaced to the map server according to first and sends the simulation main broadcaster Data, the 4th sending module are spaced to the map server according to second and send the removal request;
As Q=K, second interval is less than described first and is spaced.
The various change mode and specific example of the test method of simulation search main broadcaster in 1 embodiment of earlier figures are equally suitable The test device of simulation search main broadcaster for the present embodiment passes through retouching in detail for the aforementioned test method to simulation search main broadcaster It states, those skilled in the art are clear that the implementation of the test device of simulation search main broadcaster in the present embodiment, institute With succinct for specification, this will not be detailed here.
Said one in the embodiment of the present application or multiple technical solutions at least have following one or more technology effects Fruit:
In the technical solution of the embodiment of the present invention, N number of simulation main broadcaster's data, Mei Gemo are sent to map server first Quasi- main broadcaster's data are used to simulate the data of a true main broadcaster, and simulation main broadcaster's data include at least simulation main broadcaster's mark With a simulation main broadcaster position, N is positive integer;Then first thread is created and runs, the first thread is searched for generating M Rope is asked, and described search request includes analog subscriber data, and the analog subscriber data are used to simulate the number of a real user According to, and the analog subscriber data include at least an analog subscriber mark and an analog subscriber position, M is positive integer;And The M searching request is sent to the map server, so that the map server is based on each analog subscriber number According to N number of simulation main broadcaster's data, search out the simulation main broadcaster position be located at it is described near the analog subscriber position Simulate main broadcaster's mark;The search result that the map server returns finally is received, and using described search result as the survey Test result, described search result include at least the simulation main broadcaster mark searched out.So the N number of simulation master for passing through transmission Multicast data sends main broadcaster's data to simulate N number of true main broadcaster to map server, and generates and sends M search instruction and carry out mould Intend M real user and send search instruction to map server, and then simulates M user and ask near map server search The scene of main broadcaster, thus tests map server.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of test method of simulation search main broadcaster, which is characterized in that including:
N number of simulation main broadcaster's data, each number simulated main broadcaster's data and be used to simulate a true main broadcaster are sent to map server According to simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation main broadcaster position, and N is positive integer;
First thread is created and runs, the first thread includes that simulation is used for generating M searching request, described search request User data, the analog subscriber data are used to simulate the data of a real user, and the analog subscriber data include at least One analog subscriber mark and an analog subscriber position, M is positive integer;
The M searching request is sent to the map server, so that the map server is based on each simulation and uses User data and N number of simulation main broadcaster's data search out the simulation main broadcaster position and are located near the analog subscriber position The simulation main broadcaster mark;
The search result that the map server returns is received, and using described search result as the test result, it is described to search Hitch fruit includes at least the simulation main broadcaster mark searched out.
2. the method as described in claim 1, which is characterized in that N number of simulation main broadcaster's data are sent to map server, including:
The curl_easy_perform interfaces of libcurl are called to send the N to the data creation interface of the map server A simulation main broadcaster's data;
The M searching request is sent to the map server, including:
The curl_easy_perform interfaces of libcurl are called to send the M to the data search interface of the map server A searching request.
3. method as claimed in claim 2, which is characterized in that the method further includes:
Record the simulation main broadcaster mark of K sent to the map server simulation main broadcaster's data;K be less than Positive integer equal to N;
Based on the K simulation main broadcaster marks, K simulation update main broadcaster's data are generated;Wherein, each simulation updates main broadcaster Data include at least the simulation main broadcaster and identify and simulate update main broadcaster position;
K simulation update main broadcaster's data are sent to the map server, so that the map server is according to the mould Corresponding simulation main broadcaster's location updating is that the simulation updates main broadcaster position by quasi- main broadcaster's mark.
4. method as claimed in claim 3, which is characterized in that the method further includes:
It is identified based on the Q simulation main broadcasters in the K simulation main broadcaster marks and generates Q removal request;Wherein, Q be less than Positive integer equal to K;
The Q removal requests are sent to the map server, so that the map server is asked according to each deletion It asks the simulation main broadcaster of instruction to identify and deletes corresponding simulation main broadcaster's data.
5. method as claimed in claim 4, which is characterized in that be spaced to the map server according to first and send the mould Quasi- main broadcaster's data are spaced to the map server according to second and send the removal request;
As Q=K, second interval is less than described first and is spaced.
6. a kind of test device of simulation search main broadcaster, which is characterized in that including:
First sending module, for sending N number of simulation main broadcaster's data to map server, each main broadcaster's data of simulating are for simulating The data of one true main broadcaster, simulation main broadcaster's data include at least a simulation main broadcaster mark and a simulation main broadcaster position It sets, N is positive integer;
Module is created and runs, for creating and running first thread, the first thread is for generating M searching request, institute It includes analog subscriber data to state searching request, and the analog subscriber data are used to simulate the data of a real user, and described Analog subscriber data include at least an analog subscriber mark and an analog subscriber position, and M is positive integer;
Second sending module, for sending the M searching request to the map server, so that the map server base In each analog subscriber data and N number of simulation main broadcaster's data, searches out the simulation main broadcaster position and be located at the mould Simulation main broadcaster mark near quasi- user location;
Test result obtains module, the search result returned for receiving the map server, and described search result is made For the test result, described search result includes at least the simulation main broadcaster mark searched out.
7. device as claimed in claim 6, which is characterized in that first sending module is used to call the curl_ of libcurl Easy_perform interfaces send N number of simulation main broadcaster's data to the data creation interface of the map server;
Second sending module is used to call the curl_easy_perform interfaces of libcurl to the map server Data search interface sends the M searching request.
8. device as claimed in claim 7, which is characterized in that described device further includes:
Logging modle, the simulation master for recording the K sent to the map server simulation main broadcaster's data Broadcast mark;K is the positive integer less than or equal to N;
Update module, for based on the K simulation main broadcaster marks, generating K simulation update main broadcaster's data;Wherein, Mei Gesuo Simulation update main broadcaster's data are stated to include at least simulation main broadcaster mark and simulate update main broadcaster position;
Third sending module, for sending K simulation update main broadcaster's data to the map server, so that the map It is that the simulation updates main broadcaster position that server, which is identified according to the simulation main broadcaster by corresponding simulation main broadcaster's location updating,.
9. device as claimed in claim 8, which is characterized in that described device further includes:
Removing module generates Q removal request for being identified based on the Q simulation main broadcasters in the K simulation main broadcaster marks; Wherein, Q is the positive integer less than or equal to K;
4th sending module, for sending the Q removal requests to the map server, so that the map server root It is identified according to the simulation main broadcaster of each removal request instruction and deletes corresponding simulation main broadcaster's data.
10. device as claimed in claim 9, which is characterized in that first sending module is spaced to described according to first Figure server sends simulation main broadcaster's data, and the 4th sending module is spaced to the map server according to second and sends The removal request;
As Q=K, second interval is less than described first and is spaced.
CN201710040545.9A 2017-01-20 2017-01-20 Test method and device for simulating search anchor Active CN108334442B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710040545.9A CN108334442B (en) 2017-01-20 2017-01-20 Test method and device for simulating search anchor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710040545.9A CN108334442B (en) 2017-01-20 2017-01-20 Test method and device for simulating search anchor

Publications (2)

Publication Number Publication Date
CN108334442A true CN108334442A (en) 2018-07-27
CN108334442B CN108334442B (en) 2021-05-28

Family

ID=62922901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710040545.9A Active CN108334442B (en) 2017-01-20 2017-01-20 Test method and device for simulating search anchor

Country Status (1)

Country Link
CN (1) CN108334442B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1184789A2 (en) * 2000-08-31 2002-03-06 Hewlett-Packard Company Method for accessing data and processing metrics data using encoded inbound anchors and automatically generated markup language files
CN102004693A (en) * 2010-11-24 2011-04-06 北京世纪高通科技有限公司 System performance test method and device
CN103729361A (en) * 2012-10-12 2014-04-16 百度在线网络技术(北京)有限公司 Method and device for testing performance of database
CN104077212A (en) * 2013-03-26 2014-10-01 阿里巴巴集团控股有限公司 Pressure test system and method
KR20140147227A (en) * 2013-06-19 2014-12-30 주식회사 큐에이엔씨 Gui software test automatic system having functon for script maintenance and method of controlling the same
CN104461891A (en) * 2014-12-11 2015-03-25 百度在线网络技术(北京)有限公司 Method and device for testing positioning-related applications
US9075918B1 (en) * 2014-02-25 2015-07-07 International Business Machines Corporation System and method for creating change-resilient scripts
CN105607997A (en) * 2015-11-26 2016-05-25 珠海多玩信息技术有限公司 Background service test method, apparatus and system for software product
CN106303603A (en) * 2016-08-16 2017-01-04 武汉斗鱼网络科技有限公司 A kind of system and method realizing neighbouring main broadcaster's search based on Map Services
CN106776300A (en) * 2016-12-01 2017-05-31 北京驰波信息工程有限公司 The pressure testing system and method for a kind of intermediate system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1184789A2 (en) * 2000-08-31 2002-03-06 Hewlett-Packard Company Method for accessing data and processing metrics data using encoded inbound anchors and automatically generated markup language files
CN102004693A (en) * 2010-11-24 2011-04-06 北京世纪高通科技有限公司 System performance test method and device
CN103729361A (en) * 2012-10-12 2014-04-16 百度在线网络技术(北京)有限公司 Method and device for testing performance of database
CN104077212A (en) * 2013-03-26 2014-10-01 阿里巴巴集团控股有限公司 Pressure test system and method
KR20140147227A (en) * 2013-06-19 2014-12-30 주식회사 큐에이엔씨 Gui software test automatic system having functon for script maintenance and method of controlling the same
US9075918B1 (en) * 2014-02-25 2015-07-07 International Business Machines Corporation System and method for creating change-resilient scripts
CN104461891A (en) * 2014-12-11 2015-03-25 百度在线网络技术(北京)有限公司 Method and device for testing positioning-related applications
CN105607997A (en) * 2015-11-26 2016-05-25 珠海多玩信息技术有限公司 Background service test method, apparatus and system for software product
CN106303603A (en) * 2016-08-16 2017-01-04 武汉斗鱼网络科技有限公司 A kind of system and method realizing neighbouring main broadcaster's search based on Map Services
CN106776300A (en) * 2016-12-01 2017-05-31 北京驰波信息工程有限公司 The pressure testing system and method for a kind of intermediate system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MA HONGSHENG等: "Large-Scale Shaking Table Test Study on Pre-stressed Anchor Cable of Counter-tilt Layer Rock Slope", 《INSTITUTE OF ELECTRICAL AND ELECTRONIC ENGINEERS》 *

Also Published As

Publication number Publication date
CN108334442B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN104965691B (en) The method, apparatus and system of the page elements of the configuration webpage page
CN104283933B (en) Method, client and the system of downloading data
CN103780652B (en) A kind of method and system of microblogging resource sharing
CN106341438A (en) Request processing method and device
CN112988608B (en) Data testing method and device, computer equipment and storage medium
CN109474844A (en) Video information processing method and device, computer equipment
CN110347946A (en) A kind of page display method, device, computer equipment and storage medium
CN105893044A (en) Icon generation method and device
CN107612833A (en) A kind of URI method for routing and relevant apparatus based on storage system
CN104615719B (en) Application program intelligence distribution method and device
CN108256006A (en) A kind of direct broadcasting room badge picture loading method and system
CN104915864B (en) The method and device that the dispensing effect of impression information is evaluated and tested
CN106446210A (en) Multimedia file searching method, server and client
CN107968807A (en) Automatically update the method and device of local cache resource
CN108228197A (en) A kind of method and apparatus for installing software in the cluster
CN105868399A (en) Method and device of managing photo album folders
CN103684809B (en) A kind of method for managing network resource, device, client and system
CN108287891A (en) A kind of application information method for pushing and server
CN108334442A (en) A kind of test method and device of simulation search main broadcaster
CN103699630B (en) Method and device for recommending information in browser
CN106341449A (en) Data synchronization method and device
CN107871021B (en) Method and device for obtaining identification features of webpage search keywords
CN113329233B (en) Live broadcast data processing method and device, electronic equipment and storage medium
CN107181715A (en) A kind of business method of calibration and device
CN103220327B (en) user information storage method and device

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